minecraft:cooldown for you with a switch.Get GodCraftOverview
minecraft:cooldown is an item component: it goes in the components object of a custom item. Adds a wait time after the item is used or swung. Every item that shares the same category goes on cooldown together, like how all ender pearls wait at once.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
category | string | none | A name shared by items that should go on cooldown together. |
duration | number | none | How many seconds the wait lasts. |
type | ItemCooldownType | "use" | Which action starts and is blocked by the cooldown: "use" or "attack". The two types are tracked separately. |
Example
Inside the components object of BP/items/<name>.json (values are the defaults or placeholders):
BP/items/<name>.json
{
"minecraft:cooldown": {
"category": "",
"duration": 1,
"type": "use"
}
}