I'm coding this really long script for an SMP I'm making with my friends. It's supposed to assign you a custom sword (I haven't coded abilities yet), and give you it. They have Curse of Vanishing so when you die, it doesn't drop. When you respawn, it's supposed to give you the sword back, but for some reason, it's not working.
https://pastebin.com/fmma9skB
On line 23, I made a subcommand that gives a certain player their assigned sword, and that seems to work. I made it so that when you die (Using the on death event), it runs the same subcommand from the console, but it doesn't seem to work. I tried switching the on death event to the on respawn event, but it still doesn't work. If anyone knows why, please tell me.
https://pastebin.com/fmma9skB
On line 23, I made a subcommand that gives a certain player their assigned sword, and that seems to work. I made it so that when you die (Using the on death event), it runs the same subcommand from the console, but it doesn't seem to work. I tried switching the on death event to the on respawn event, but it still doesn't work. If anyone knows why, please tell me.