How to make cooldown for multiple items?

Started by abobo_le_sus on

Topic category: Help with MCreator software

Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make cooldown for multiple items?

How to make a cooldown for multiple items/weapons at the same time?
I have a special weapons in the mod that adds effects on right click, and of course it has a cooldown, but i don't want players to stack the effects duration, did anyone know how to make cooldown for all weapons at the same use?
(also, the game crashes after drinking milk, i don't know why, if anyone know how to solve it- please write in the comments)

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Instead of just cooling down…
Tue, 01/17/2023 - 19:42

Instead of just cooling down the one item, use a 'Get each item as itemstack iterator' in the entity's inventory. If the Itemstack iterator matches the item you want to cooldown, cooldown the itemstack iterator instead of just the provided itemstack. This will search each slot in the player's inventory individually and execute a procedure on them.

Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
so the cooldown will be to…
Thu, 01/19/2023 - 13:48

so the cooldown will be to all items on inventory?