1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

How to save inventory per world, and then load it?

Discussion in 'Development' started by DrakerZR, May 6, 2018.

  1. DrakerZR

    DrakerZR Silverfish

    Messages:
    21
    GitHub:
    drakerzr
    Hi.
    How may I save an inventory for a world and then clear it, and if then the player back to that world, load it?
    Example: If player was in world "survival" and he run /spawn, save his inventory and clear it. If he's in world "world" and then he go to the world "survival" it loads the Survival inventory.
     
  2. LewBr

    LewBr Zombie

    Messages:
    385
    GitHub:
    lewbr
    You should save an data of a player to each world (dat/yml/sql/mysql) and then if the player quit from the server it saves to the data what was on the player inventory, when they changes the world with EntityWorldChangeEvent you should return and give the items what was stored on your file data of that player with the world located, if you want i can do this plugin today when i have time.. but I do not promise
     
    DrakerZR likes this.
  3. DrakerZR

    DrakerZR Silverfish

    Messages:
    21
    GitHub:
    drakerzr
    Thanks!
    And if it's not too much trouble, could you do the plugin, please?
     
  4. Kabluinc

    Kabluinc Baby Zombie

    Messages:
    129
  5. LewBr

    LewBr Zombie

    Messages:
    385
    GitHub:
    lewbr
    Last edited: May 7, 2018
  6. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    DrakerZR, Sandertv and Kabluinc like this.
  7. LewBr

    LewBr Zombie

    Messages:
    385
    GitHub:
    lewbr
    DrakerZR likes this.
  8. DrakerZR

    DrakerZR Silverfish

    Messages:
    21
    GitHub:
    drakerzr
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.