how make item transform when right click, using statement

Started by Baiter_Yamato on

Topic category: Help with MCreator software

Last seen on 21:45, 14. Oct 2023
Joined May 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
how make item transform when right click, using statement

im trying to do a hidden blade, but i cant make it work.
If the only way is to replace item, then I would like to know how to maintain the previous item durability



Last seen on 20:37, 26. Jul 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I've tried messing with…
Thu, 10/12/2023 - 21:41

I've tried messing with itemstates a bit, but it doesn't seem like the most predictable system. You can swap items out pretty easily, (really easily if you're just replacing the item in the player's main hand). Before you do, you can use local variables to save the durability, enchantments, and name of the previous item, and transfer them to the new item. Enchantments are annoying as you basically have to check for them individually, and names are annoying as you need to first check the name doesn't match the registry name, and make sure to remove square brackets from name strings to make sure you get the correct display name. However, durability should be as easy as saving the damage of the old item as a local number variable, and then applying that much damage to the new item.