Item cooldowns

While a player is in combat, items can get a cooldown or be blocked. Outside combat every item works as normal.

How it works

Cooldowns are under item-cooldowns: in config.yml. This is the default:

yaml
item-cooldowns:
  ENDER_PEARL: 15
  ELYTRA: -1
ValueMeaning
A number, for example 15After using the item in combat, it can’t be used again for that many seconds. The vanilla cooldown overlay shows on the item.
-1The item can’t be used in combat at all. The overlay stays on the item until combat ends.

Item names are the Minecraft item IDs, for example ENDER_PEARL, CHORUS_FRUIT, WIND_CHARGE, GOLDEN_APPLE, ENCHANTED_GOLDEN_APPLE, FIREWORK_ROCKET, TRIDENT or BOW.

  • Works for any item a player uses: pearls, chorus fruit, wind charges, food, potions, fireworks, bows and so on. Items that are never used, like totems, aren’t affected.
  • A trident’s cooldown also covers riptide.
  • Items are never taken away or locked in place. Players can still move, wear and drop them. Only using them is blocked.
  • Using a blocked item shows item-blocked from messages.yml, at most once every 2 seconds.
  • To block potions by their effect instead of the whole item, use blocked potions.

Add, remove or turn off cooldowns

ToDo this
Add a cooldownAdd a line under item-cooldowns:, for example GOLDEN_APPLE: 10.
Block an item in combatSet it to -1, for example WIND_CHARGE: -1.
Remove one cooldownDelete its line. 0 does the same.
Turn all cooldowns offReplace the whole section with item-cooldowns: {}.

To turn every item cooldown off, including the elytra rule:

yaml
item-cooldowns: {}

item-cooldowns: [] works too. Run /combat reload after the change.

Delete the lines under it
Put item-cooldowns: {} in place of the whole section and delete the item lines that were under it. Leaving them there breaks the file.

Elytra

Gliding isn’t an item use, so ELYTRA has its own rule. With ELYTRA: -1, while in combat:

  • The elytra can be moved, put on and taken off in the inventory like any item.
  • It can’t be used to glide. Every glide is stopped before it starts, so spamming jump doesn’t get a glide through.
  • A player who is gliding when they get tagged stops gliding. The elytra stays where it is.
  • The cooldown overlay shows on the elytra until combat ends, like on a blocked item. While it shows, the elytra can’t be put on with right-click from the hand, but it can still be put on in the inventory.
  • Players see elytra-blocked from messages.yml, at most once every 2 seconds.

With a number, for example ELYTRA: 10, a player who starts a glide in combat can’t start another one for 10 seconds, and the overlay shows on the elytra for those 10 seconds. Delete the ELYTRA line to allow gliding in combat.

Unknown item names

A name that isn’t a Minecraft item is skipped and the console shows Unknown item 'NAME' in item-cooldowns. Check the spelling and use the item ID with underscores, for example GOLDEN_APPLE.