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 02:25, 2. 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?