๐ช Events
Introductionโ
The events section determines which item/furniture/block will execute predefined behaviors during specific events. Under the events section, you need to specify an event trigger, such as "right_click" for a right-click action. Below the event trigger, you must pass a list of functions with their corresponding types. For example, command executes a specific command.
events:
- on: right_click
functions:
- type: command
command: say 1
conditions:
- type: permission
permission: "craftengine.admin"
- type: command
command: say 2
conditions: []
- on:
- attack
- left_click
functions:
- type: command
command: say 3
๐งจ Event Triggersโ
itemsโ
item_breakโ the item is destroyed after its durability reaches zeroblock_breakโ the item is being used when the player breaks a blockright_clickleft_clickconsumepick_upattack
blocksโ
block_breakโ the block is brokenplaceright_clickleft_clickstep
Furnitureโ
furniture_breakโ the furniture is brokenplaceright_click
caution
Please note that the corresponding events should be placed in the appropriate configuration area. For example, if you want to execute a command when interacting with a piece of furniture, the correct approach is to place the events under the furniture section, not under your item section.
items:
default:bench:
events: # โ๏ธ
right_click:
- type: command
behavior:
type: furniture_item
furniture:
events: # โ
๏ธ
right_click:
- type: command