-
Notifications
You must be signed in to change notification settings - Fork 0
"Before" events
Frontrider edited this page Oct 31, 2019
·
2 revisions
Some events have the ability to stop the event at their start. Canceling will block the execution of code, even the things that Minecraft would run otherwise! Long "_before" events can cause lag, unlike normal ones, so keep them as brief as possible! NOT every event can be canceled atm.
For event canceling look at the Event command.
| Event name | action | included objects |
|---|---|---|
| namespace:block/name/before/placed | called before the block was placed down | called in the name of the block, in it's position, the placer is also included |
| namespace:block/name/before/activate | called before the block was right clicked | called in the name of the block, in it's position, the placer is also included |
| namespace:block/name/before/activate_offhand | called before the block was right clicked | called in the name of the block, in it's position, the placer is also included. Will trigger when the offhand was used |
| namespace:block/name/before/broken | called before the block was broken or mined | called in the name of the block, in it's position |
| namespace:block/name/before/entity_landed | called before an entity has landed on the block. Canceling it will prevent fall damage! | called in the name of the block, in it's position, the entity is also included |
| namespace:item/name/before/use_on_block | called before the item was used on a block | called in the name of the user, in the block's position |
| namespace:item/name/before/use_on_block_offhand | called before the item was used on a block | called in the name of the user, in the block's position, as the offhand item |
| namespace:item/name/before/use_on_entiy | called before the item was used on an entity | called in the name of the entity, in it's position |
| namespace:item/name/before/use_on_entiy_offhand | called before the item was used on an entity | called in the name of the entity, in it's position |
| namespace:entity/name/before/damage | called before the entity takes damage. | called in the name of the entity, in it's position |