Started by
Lizardinthedeep
on
Topic category: Help with Minecraft modding (Java Edition)
I'm trying to add sounds when I use an item however when I use the item it plays the sound for every other item you use. I need help with how to add it so the sound only plays for one item only.
Edited by Lizardinthedeep on Tue, 07/18/2023 - 01:08
Is your custom item playing a default item sounds, or are all items playing your custom sounds?
Either way, just write a procedure to play the sound when you right click with the item, either connecting it exclusively to the 'item used' trigger of the custom item, or making it so it's triggered by right clicking with an item, but then only plays if the item in the player's main or off hand is the custom item.
You might also want to add cooldown to the item so the sound can't be spammed, otherwise the sound may play multiple times on use.
Would you know how I can do that with using the procedure block instead of write out the code?