Started by
ColdSeason
on
Topic category: Help with Minecraft modding (Java Edition)
I made an Item, and I want it to run a procedure when right-click, and it works! however, now it runs the procedure every time i right click WITH ANY ITEM, I just want it to be on the Item I created, how do i specify that I only want the procedure to run when a specific Item is right-clicked
Edited by ColdSeason on Tue, 05/07/2024 - 15:22
You should be much, much more descriptive in your topic subject. No one's gonna want to click it with such little info.
You need to assign the procedure to the item's right click IN the item's configuration, not use the global trigger "on right click" in the procedure.
Calling topic "please help me" does not follow General Publishing Guidelines. Please carefully read them
Renamed topic to "How to detect right click item"
In your code, add a condition to verify that the clicked item matches your created Item.