Template: EDIBLE - ThePix/QuestJS GitHub Wiki

The EDIBLE template takes a flag indicating if the object is a liquid (so should use "drink").

createItem("sandwich",  EDIBLE(false), {
  loc:"lounge",
  examine:"A tasty looking thing.",
  afterIngest:function() {
    msg("That was Great!")
  },
});

Events

You can optionally give the object an "afterIngest" function as in the example. It could be used to increase - or decrease - the player's health, or whatever.