Wiki 9Minecraft Wiki 9Minecraft

Snippets

Minecraft Legends

BSharpReferenceSheet
Official docs

Snippets are your “functions” or logic to execute when a listener triggers.

SNIPPET_EntitySpawned("es_snippet_to_execute", (entity, payload) => {
    // do stuff here!
})

  • "es_snippet_to_execute" : First parameter is the snippet name. Listeners with the same snippet value will trigger this snippet.
- It is possible to have multiple listeners point to a single snippet, but not the other way around (when a snippet is defined its name must be unique).
  • (entity, ...) : Each snippet will be provided a set number of arguments to operate on. See the documentation for more details on each snippet type.
  • (..., payload) : The last argument for any snippet is always the payload.