Creating an item that can be used and triggers a cooldown group, but isn't consumed.
I'm trying to create an item that can be used by right-clicking, triggers a cooldown (a la the
use_cooldowncomponent), is not consumed on use, and can trigger arbitrary functions. This is what I've tried so far:The carrot on a stick, detected with a scoreboard. Using the carrot on a stick doesn't seem to be able to trigger the
use_cooldowneven if you manually add one.A generic item, I used red dye, given the
use_cooldowncomponent and detected with a scoreboard usingminecraft.used:minecraft.red_dye. The scoreboard does not detect the right-click event, so this doesn't work at all.An ender eye being used in a world with no strongholds, given the
use_cooldowncomponent and detected using aminecraft.used:minecraft.red_dyescoreboard. This does trigger theuse_cooldowncorrectly, and the item isn't lost as long as there is no stronghold in the world. Unfortunately, the scoreboard doesn't detect the ender eye being right-clicked.An ender eye being used in a world with no strongholds, given the
use_cooldowncomponent and detected using theminecraft:used_ender_eyeachievement trigger. The achievement trigger only goes off in worlds with strongholds for some reason.A piece of food (or an item given the
consumablecomponent), given theuse_cooldowncomponent and detected using a scoreboard. This does correctly use theuse_cooldowncomponent and the scoreboard detects it fine, but the item is lost in the process. There doesn't seem to be any way to disable an item being consumed on use this way. I think a workaround would be giving the same item back to the player on use, but I'm hoping to avoid this because the item might be placed in a different slot than it started or be dropped due to an item being picked up at the same time as the food is used, which is not desirable.If anyone has advice on tweaking one of these methods or another method I don't know about yet, I would greatly appreciate it!