Callback Block Break
Invokes an action upon the player breaking a block.
Type ID: kaya:callback/block/break
Info
This type provides the following context parameters:
| Parameter | Description |
|---|---|
kaya:broken_block |
The block broken by the player. |
kaya:broken_side |
The side at which the player broke the block. |
Format
| Field | Type | Default | Description |
|---|---|---|---|
on_break_action |
Action | The action to invoke when a block is broken. | |
only_when_harvested |
Boolean Provider | false |
Determines whether the action should only be invoked when the block is broken with its correct tool. |
priority |
Integer | 0 |
Determines the order of which powers of this type will be iterated. |
About priorities
The instances of this type will be sorted in its reversed natural order meaning that instances that have a higher priority value will be executed first before those that have lower priority values.
Example
{
"type": "kaya:callback/block/break",
"on_break_action": {
"type": "kaya:set_entity_on_fire",
"ticks": 20,
"entity": "this"
},
"active_condition": {
"type": "kaya:check_block_type",
"key": "minecraft:magma_block",
"block": "broken_block"
}
}
This example sets the entity on fire if the block they broke was a Magma block.
History
| Minecraft | Mod | Changelog |
| 1.21.5 | 0.1.0 | Added the type. |