MineTinker icon indicating copy to clipboard operation
MineTinker copied to clipboard

Turn "broken" items into a non tool item (like a stick) until repaired

Open Draycia opened this issue 5 years ago • 6 comments

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?

Draycia avatar Aug 19 '19 19:08 Draycia

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.

Draycia avatar Aug 19 '19 19:08 Draycia

How should the items be repaired?

  1. In the Inventory like repairing a non broken item
  2. In the Anvil like vanilla reparations
  3. 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.

Flo56958 avatar Aug 22 '19 00:08 Flo56958

Option 2 would be the most intuitive but option 3 would make sense too.

Draycia avatar Aug 22 '19 00:08 Draycia

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?

Flo56958 avatar Aug 22 '19 00:08 Flo56958

Don't know, if it is still a good solution. (as it could be to complicated)

Flo56958 avatar Jun 12 '20 20:06 Flo56958

when #150: could be part of the ItemManager

Flo56958 avatar Jun 16 '20 00:06 Flo56958