Weapon levelling

Discussion in 'Plugin Development' started by dajako, Aug 28, 2013.

Thread Status:
Not open for further replies.
  1. I have yet to start this but I want to help prior so that I won't have to recode it a load of times.

    The idea is to replace enchanting.
    When a player kills a zombie 1 point will be added to the sword in use, I can make this happen without issue. But how would I save that to the sword?

    I believe that is all I need to say but if you are confused please comment!
    Please do not discard this thread!

    Thanks in advance!
     
  2. Offline

    fireblast709

    you have a few options:
    • Using the name to store it
    • Using the lore
    • Somehow magically track it yourself
    I would go with either of the first two (as it gives a bit of a graphical boost too).
     
  3. How would I come up with a unique name/lore each time though? I'd need to store them again to make sure that they weren't reused right?
     
  4. Offline

    fireblast709

    There is no need for an unique name just to store a level. You can just add "Level: <replace this with the level>" to the lore.
     
  5. Ok, I think I am still confused but I'll have to start making it to see.
     
  6. Offline

    lycano

    Or combine it. Use the lore to state the level of the weapon like "Sword of Destruction +1" and store the weapon xp in Item Metadata. Note: You would have to restore the metadata on server-reload/restart as its not permanent. Using the item UUID should help you restoring the metadata for the item as its permanent and unique.
     
Thread Status:
Not open for further replies.

Share This Page