Hello Lately i have tried adding a custom sword to my server, wich uses a custom enchanting system, I just wanted to give the first Diamond axe (its different swords with Custom Model Data) a Tag or variable so only the original player can use it, the whole reason behind this is so that players cant copy their old sword enchantments on new sword. Ive tried this with nbt tags and normal Variables this didnt seem to work for me, but i probably just dont understand really how its supposed to work, anyway if you have any questions just ask me in this thread thanks in advance for this amazing community and all of your help
Code:
on right click:
if player's held item is diamond axe:
if {itemweapontemporary%event-item%} is not set:
set {itemweapontemporary%event-item%} to player
if {itemweapontemporary%event-item%} != "%player%":
if {itemweapontemporary%event-item%} has permission "weapon.bypass": #for admins to still open the enchant menu
enchanting(player) #just opens the enchant menu