📣Events
The "events" section of a block or item's YAML allows you to execute Minecraft commands when certain interactions are performed.
# "events" is formatted as a list of event objects:
events:
- onRightClick: # <-- event name
commands:
- say block right clicked!
cooldown: 20 # <-- cooldown in ticks
- onBroken:
commands:
# this is a list of Minecraft commands, with or without the slash
- say block broken!
- say goodbye world!
# adding a cooldown is optionalList of event names
Last updated