How do I check what block is in my off hand without a lot of if statements

Started by oddmandrill on

Topic category: Help with modding (Java Edition)

Last seen on 21:49, 10. Oct 2024
Joined Dec 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do I check what block is in my off hand without a lot of if statements

I wanted to make it so I would place down a lot of whatever block is in my off hand. If its oak planks, place oak planks. If its cobble, set down cobble. Is there a way to check what block I have in my offhand without needing to make a series of if statements for each block in the game?

Last seen on 21:50, 10. Oct 2024
Joined Dec 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You can do this with the …
Wed, 10/02/2024 - 11:33

You can do this with the "Item in main-hand" block

Last seen on 21:50, 10. Oct 2024
Joined Dec 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
^ and then to be able to use…
Wed, 10/02/2024 - 11:34

^ and then to be able to use it as a block in your procedure.

Last seen on 21:49, 10. Oct 2024
Joined Dec 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
OH MY GOD THANK YOU
Wed, 10/02/2024 - 23:09

OH MY GOD THANK YOU