Entity Has Pressed Key
Checks if an entity has pressed a keybinding.
Type ID: kaya:entity_has_pressed_key
Format
| Field | Type | Default | Description |
|---|---|---|---|
key |
Array of Key Predicates or single Key Predicate | The key predicate to check. | |
entity |
Entity Provider | The entity to get the state of the keybindings from. |
Example
{
"type": "kaya:entity_has_pressed_key",
"key": [
"key.hotbar.0",
"key.hotbar.1"
],
"entity": "this"
}
This example will check if the entity provided by the kaya:this_entity context parameter has pressed the key.hotbar.0 and key.hotbar.1 keybindings simultaneously.
History
| Minecraft | Mod | Changelog |
| 1.21.5 | 0.1.0 | Added the type. |