How to get the name of the main hand item

Started by himaP on

Topic category: Help with Minecraft modding (Java Edition)

Joined Sep 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to get the name of the main hand item

Sorry,I cannot use English unless I rely on Google Translate.So this is a copy of the result from Google translation.

 

So please forgive me for poor English.I couldn't paraphrase it for the same reason, so I couldn't find a similar topic.

 

The question is, as mentioned in the title, that I want to know how to get the name of the main hand item when right-clicking on a particular block.

Joined Dec 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
maybe for that you should…
Thu, 02/13/2020 - 05:45

maybe for that you should make a procedure on block righgclicked and try to lock the code and make a string variable that will equal as the clicked block name (not sure if possible as i'd need to check if the rightclick function has a block parameter or if you could use some sort or raycasting on the block in the procedure)