MineTinker
MineTinker copied to clipboard
Turn "broken" items into a non tool item (like a stick) until repaired
Is your feature request related to a problem? Please describe. Other plugins can behave weirdly with MT when items are "broken". Causing duplication glitches (?) or other weird behaviour.
Describe the solution you'd like Turn items into sticks or another non usable item when "broken". When the item is repaired it turns back to the original item.
Describe alternatives you've considered N/A
Additional context I can see this working well when MT repair is used but I don't know how anvil repairing would work with this. We would probably have to manually listen to inventory clicks.
We'd also have to have ways of converting items to and from sticks. I know vanilla has JSON serialization and deserialization for items. We could probably go with that?
Additional note: New players are very often confused when items break and aren't usable. The item turning into a stick or something else would grab their attention. If the broken item has lore saying why it's a stick would help even more.
How should the items be repaired?
- In the Inventory like repairing a non broken item
- In the Anvil like vanilla reparations
- With the crafting table (with a custom recipe)
Option 1 should be implemented as it would tie in nicely with the current repair system but as it can be toggled off there must be another option for repairing. (I'd prefer option 2 as that would tie in nicely with modding the item)
Idea on implementation: The stick can have all attributes, enchants and NBT-Values assigned to it. So only a material change should be all that is needed. Maybe the Listener for broken items can do that. The durability check could be removed. Tools is easy. Armor is something different. This feature would also make armor "unbreakable". Plugins can force any item into the armor slots so no dropping of broken items is needed either.
If UnbreakableItems is turned off the feature should be deactivated.
The stick with a NBT-Tag (like BrokenMTitem: "DIAMOND_PICKAXE") could also be used to add textures to the broken items.
Option 2 would be the most intuitive but option 3 would make sense too.
The AnvilListener would be easier to implement as the crafting one, as you can not have a recipe with variable input and output or can you?
Don't know, if it is still a good solution. (as it could be to complicated)
when #150: could be part of the ItemManager