How to save armor and tools after death?

Discussion in 'Plugin Development' started by makcoh2018, Jul 11, 2021.

Thread Status:
Not open for further replies.
  1. Offline

    makcoh2018

    Hey. I need to save armor and tools after death but doesn't save other things? How am i can do this?
     
  2. Offline

    Strahan

    Loop their inventory, save armor and tools (don't forget to remove them from drops) then when they respawn, restore said items. A map with UUID and a List of ItemStack would suffice, just be sure on disable that you flush it to disk so if someone died then walked away to get a drink before clicking respawn and you restart server whilst they are away they don't lose their stuff.
     
    makcoh2018 likes this.
Thread Status:
Not open for further replies.

Share This Page