Skip to main content

๐Ÿช‡ 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 zero
  • block_break โ€” the item is being used when the player breaks a block
  • right_click
  • left_click
  • consume
  • pick_up
  • attack

blocksโ€‹

  • block_break โ€” the block is broken
  • place
  • right_click
  • left_click
  • step

Furnitureโ€‹

  • furniture_break โ€” the furniture is broken
  • place
  • right_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