Listeners are how we listen to specific game events, and direct those events to snippets when fired.
LISTENFOR_EntitySpawned({
snippet: "es_snippet_to_execute",
ownerVillageId: OWNER_VILLAGE_OPT_OUT,
includeTags: ["mob"],
payloadString: "hello"
})
snippet: required for all listeners, this defines the snippet to execute.ownerVillageId: required for all listeners, this defines the village that owns this listener. See section Villages below.includeTags: a listener rule for this type of listener. Each listener accepts a different set of rules (sometimes required) that determine if the event should trigger the snippet.payloadString: a payload to forward to the snippet when it executes. See section Payloads below.