Item on cooldown
origins-powerful-powers:item_on_cooldownentity conditionplayers only
Checks vanilla's item cooldown: the one that greys out an ender pearl or chorus fruit in the hotbar after you use it, or a shield after an axe hits it. Origins' origins:cooldown power is a separate timer.
| Field | Type | Default | Description |
|---|---|---|---|
item | Identifier | none | The item to check, like minecraft:ender_pearl. When it's set, slot is ignored. |
slot | String | "weapon.mainhand" | Without item: check whatever item is in this slot. Same names as Item.id: weapon.mainhand, weapon.offhand, armor.head … armor.feet, hotbar.0 to 8, inventory.0 to 26, enderchest.0 to 26. |
comparison | Comparison | none | Optional. With it, compares the ticks left on the cooldown with compare_to. |
compare_to | Integer | 0 | ticks |
- Without
comparisonit's true while the item is on cooldown at all. - With
comparison, an item that isn't on cooldown has0ticks left. - Cooldowns belong to the item type, so every ender pearl shares one. Each item type has its own cooldown in 1.20.1.
- An empty slot is never on cooldown. A bad
slotname is an error when the datapack loads. - Vanilla sends cooldowns to the client, so this also works in client-checked places like
hud_render. - Set one yourself with
set_item_cooldown. Read the ticks in code withItem.cooldown.
Example: a pearl's recoil. While your ender pearl is cooling down, you're slower.
{
"type": "origins:conditioned_attribute",
"condition": {
"type": "origins-powerful-powers:item_on_cooldown",
"item": "minecraft:ender_pearl"
},
"modifier": {
"attribute": "minecraft:generic.movement_speed",
"operation": "multiply_base",
"value": -0.3
},
"tick_rate": 1
}For the 20 ticks after you throw a pearl, you move 30% slower.
Example: the item in your hand has more than 5 seconds of cooldown left.
{
"type": "origins-powerful-powers:item_on_cooldown",
"comparison": ">",
"compare_to": 100
}Attribute: mainhand_cooldown (ticks left on the item in your main hand)