Started by
Baiter_Yamato
on
Topic category: Help with MCreator software
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
Topic category: Help with MCreator software
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
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.