Moisten the interior of an 8-inch square pan with water.
Blend the pandan leaves with a little water, then strain and reserve the juice.
Place the water and agar-agar in a pot and boil with the knotted pandan leaf until agar-agar dissolves. Add sugar and simmer till it dissolves, then add the salt, pandan juice and green food coloring, if using.
Whisk the egg into the santan, then pour into the agar-agar mixture. Stir for 3 minutes over low heat.
Pour mixture into the pan, making sure you don't move it around too much so that the layers form. Once slightly set, chill in the fridge for at least 1 hour. Cut into pieces before serving.