minecraft:cooldown

Adds a cooldown to the item so that, after performing an action of the specified "type", all items with a "minecraft:cooldown" component in the same "category" become unable to perform that same type of action for the number of seconds defined in "duration".

Properties

PropertyTypeDefaultWhat it does
category requiredText—All items sharing the same "category" are put on cooldown when an action of the specified "type" is performed.
duration requiredDecimal—Duration of the cooldown, in seconds, before the item can perform an action of the specified "type" again.
typeTextuse, attack"use"The type of action the cooldown applies to. Options are mutually exclusive, so cooldown for one type of action does not affect the others. Values: "use" (when using an item), "attack" (when attack with an item).

Example from the game files

This is how vanilla copper_spear uses it in Minecraft Bedrock 1.26.60.5:

{
  "minecraft:cooldown": {
    "category": "spear",
    "duration": 0.85,
    "type": "attack"
  }
}

Used by 8

Vanilla items with minecraft:cooldown in their definition:

copper_speardiamond_speargolden_speariron_spearnetherite_spearstone_spearwind_chargewooden_spear

Related components