Skip to content

Prevent Key Use

Power Type

Prevents the entity from pressing certain keybinds.

Type ID: eggolib:prevent_key_use

Note

This power type will only work for players.

Fields

Field Type Default Description
key Functional Key optional If specified, this key will be prevented from being pressed.
keys Array of Functional Keys optional If specified, these keys will be prevented from being pressed.

Examples

{
    "type": "eggolib:prevent_key_use",
    "key": "key.inventory"
}

This example will prevent the entity that has the power from pressing the key.inventory keybind, therefore preventing the entity from accessing their inventory.

{
    "type": "eggolib:prevent_key_use",
    "keys": [
        "key.hotbar.1",
        {
            "key": "key.jump",
            "action": {
                "type": "apoli:execute_command",
                "command": "title @s actionbar {\"text\": \"You cannot jump!\", \"color\": \"red\"}"
            }
        }
    ]
}

This example will prevent the entity from pressing the key.hotbar.1 keybind and the key.jump keybind with a "You cannot jump!" red-colored message.