How to get the name of the main hand item

Started by himaP on

Topic category: Help with modding (Java Edition)

Last seen on 11:06, 4. Mar 2020
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.

Last seen on 08:13, 21. Jun 2021
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)