Add the /itemcooldown command that allows to get the current cooldown of the group/item, get the value of the cooldown, and modify the current cooldown of the group/item and set the current cooldown of the item/group in seconds.
Like this we can execute things for example set the cooldown of our chestplate if we take damages and execute a command that create an explosion and the itemcooldown command to set the cooldown of the group to 60 seconds, and if the chestplate have the current cooldown at more than 0 second (by getting the current cooldown with itemcooldown command), we can't create another explosion with the chestplate (same example for used items).
Syntax :
itemcooldown <item / group> <get | set>
item : the item id, like "minecraft:diamond"
group : the cooldown group id, like "namespace:wand" for example
get : you get the current cooldown in seconds of the item/group that it's set with the command
set (seconds (float)) : you set the current cooldown to the item/group (for example with a function, you set the cooldown to 1 second when an item is used, or you can set to 0 to remove the cooldown)
We can already set cooldown of items/groups with use_cooldown component when consumed the item, but we can't get the value of the cooldown or change it with another way that when consumed the item.
0 Comments
Please sign in to leave a comment.
Post a new comment: