Wearing a block right-clicked while sneaking as a helmet if its item counterpart has a certain tag

Started by AbelIsDisabled on

Topic category: Help with modding (Java Edition)

Last seen on 19:05, 22. Oct 2023
Joined Oct 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Wearing a block right-clicked while sneaking as a helmet if its item counterpart has a certain tag

I'm attempting to add a feature to my mod where there are certain blocks that I want the player to be able to wear as a hat when right-clicked while sneaking but I only want it to occur with those blocks and future blocks that have a certain item tag

Last seen on 19:05, 22. Oct 2023
Joined Oct 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I've gotten it to work after…
Sat, 10/21/2023 - 17:11

I've gotten it to work after some trial and error with an if statement that checks if the block has a certain block tag instead of an item tag, converting it to an item, and setting it as the helmet slot while also providing whatever was previously there back into the inventory