Skip to main content

Cooldown (Item Action Type)

Puts the item on cooldown for the player holding it, with the same grey sweep an ender pearl shows after a throw. While it lasts, the player can't use that item.

Type ID: apoli:cooldown

Fields

FieldTypeDefaultDescription
ticksInteger or ExpressionrequiredHow long the cooldown lasts, in ticks (20 ticks is one second). An expression is evaluated once each time the action runs, against the player holding the item. 0 or less does nothing.

Examples

{
    "type": "apoli:action_on_key_press",
    "key": "key.apoli.primary_active",
    "entity_action": {
        "type": "apoli:equipped_item_action",
        "equipment_slot": "mainhand",
        "action": {
            "type": "apoli:cooldown",
            "ticks": 100
        }
    }
}

This puts whatever the player is holding on a 5-second cooldown when they press their primary ability key.

"item_action": {
    "type": "apoli:cooldown",
    "ticks": "20 * 3"
}

This uses an expression for a 3-second cooldown.

note

The cooldown applies to the item type, not to one stack. Putting one ender pearl on cooldown puts every ender pearl in that player's inventory on cooldown, just like vanilla does.

note

A new cooldown replaces the one the item already has instead of adding to it. If vanilla also sets a cooldown on the same use, such as an ender pearl's 1-second throw cooldown, whichever runs last wins.

note

Only players have item cooldowns. If the item is held by a mob, isn't in anyone's hands, or the slot is empty, the action does nothing.