Backpack Plugin

Discussion in 'Plugin Development' started by Charliecharles, Jan 30, 2019.

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

    Charliecharles

    I wrote a Plugin that allows players to have a Backpack.

    Problem: when you right click with the right item, it opens the Inventory bound to your Name, so only you can access your inventory.

    I want to change it so the Inventory is bound to the item, so i can give my Backpack to a friend and he can access the same items as i can.

    But i dont know how :(

    Please help
     
  2. Offline

    user_91277742

    You can add a lore to the item and use that to acces
     
  3. Offline

    KarimAKL

  4. Offline

    Tango_

    I remember doing something like this before, I needed to give each item a data / durability value, so if your item was a stick for example, I would set a durability value to a number that's not yet taken. Then I would store that durability value inside a config file with the contents of the inventory, so then when ever you need to open the inventory you just check the items ID meta data has the correct durability value to the one set in the config file. Then you should know what to do from there.
     
  5. Offline

    KarimAKL

    @Charliecharles To add on to what @Tango_ said you could generate a uuid for the backpack with 'UUID.randomUUID();', the chance of it being the same is very low and if it should happen a simple if check should handle it. :p
     
    Tango_ likes this.
Thread Status:
Not open for further replies.

Share This Page