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!
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).
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?
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.
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.