How to detect right click item

Started by ColdSeason on

Topic category: Help with Minecraft modding (Java Edition)

Joined May 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to detect right click item
Tue, 05/07/2024 - 15:22 (edited)

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
Joined Aug 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You should be much, much…
Sun, 05/05/2024 - 22:34

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. 

Joined Dec 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@block blast I made an Item,…
Mon, 12/16/2024 - 03:45

@block blast

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

In your code, add a condition to verify that the clicked item matches your created Item.