MagicPlugin icon indicating copy to clipboard operation
MagicPlugin copied to clipboard

Durability

Open lashiam opened this issue 4 months ago • 4 comments

Is it possible to give wands, durability? So that they break after a certain amount of uses, but they can also be repaired.

lashiam avatar Sep 15 '25 21:09 lashiam

You can add a "uses" property to a wand and it will break after being used a certain number of times. Uses will show in lore, it doesn't use the durability bar or vanilla durability in any way.

I don't know that I have a specific example of repairing, but I imagine you could use ModifyProperties in a spell to make them repairable in some way.

Let me know if you want more info on that!

NathanWolf avatar Sep 15 '25 21:09 NathanWolf

i do!! :D it sounds like it'd be really cool to create a durability system so that its actually useful to repair your wand, like a sword wand.

lashiam avatar Sep 15 '25 21:09 lashiam

I've got a few examples in the builtin configs. Take the bombs from the potter pack for instance:

bombs:
    mode: cast
    quiet: 2
    active_spell: bombtastic
    icon: magma_cream
    indestructible: clay_ball
    effect_color: 'FF0000'
    uses: 16
    spells:
        - bombtastic

This is meant to represent a bag of 16 bombs that you toss out one at a time.

The thing I have not ever done (that I can remember) is make some way to repair them. The wand has no memory of its original # of uses, so this might be kind of a challenge to set up. I think the basic idea would be a spell that sets the uses to some number, or maybe adds more uses up to some maximum.

You could put this spell in a menu, like the survival enchantment table menu, something like that.

The spell itself I think would use the ModifyProperties action to change the uses ... and I think that would work but clearly I haven't tried it myself so I can't say for sure.

I think it would be nice to have a better system that uses item durability, but that hasn't been implemented for a couple of reasons:

  1. Item durability used to be used to show different models, way back before custom model data existed
  2. The more important point, I think we still can't control max durability for items. I should check if there's now a component for this, but I want to say it's still hard-coded based on item type. So you'd be restricted to using tools, and those would be restricted somewhat to using whatever the durability of that tool is.

NathanWolf avatar Sep 15 '25 21:09 NathanWolf

that would be really cool, hopefully i can figure it out to try and make a durability system where players can fix their items

lashiam avatar Sep 16 '25 04:09 lashiam