Solved Get player Inventory

Discussion in 'Plugin Development' started by Aragone, Mar 29, 2020.

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

    Aragone

    Wtf it indicates me a folder which does not exist

    Will try something
     
  2. Offline

    timtower Administrator Administrator Moderator

    One in the plugins folder?
    With your plugin name attached?
    Folder does not need to exist, you can create it.
     
  3. Offline

    Aragone

    Yes that's what I did and it works lol

    Thank you now I will try to serialize the inventory

    And to answer your question , yes in the plugins folder, with the name of my server, not my plugin because my plugin's name is a little different. So Idk what was this folder but I created it
     
  4. Offline

    timtower Administrator Administrator Moderator

    @Aragone Should be the name of the plugin in the plugin.yml, not something else.
     
  5. Offline

    Aragone

    It works well now

    How can I load it now in the file and then put itemstacks in the inventory ?

    upload_2020-3-30_18-55-14.png

    @timtower
     
    Last edited by a moderator: Mar 30, 2020
  6. Offline

    timtower Administrator Administrator Moderator

    @Aragone You store each itemstack into a value, don't just save the list.
    Then you can call getItemStack on them.
     
  7. Offline

    Aragone

    value is the "v" in the file ?

    How do you change it Item per item
     
  8. Offline

    timtower Administrator Administrator Moderator

    @Aragone Now you are setting an array.
    Set it per item in the array instead.
     
  9. Offline

    Aragone

    look my code : https://pastebin.com/raw/ZJSBh4cU

    There is no way more simple to get the inventory in the file and just put restore it ? Like the reverse of GetContents method ?
     
  10. Offline

    timtower Administrator Administrator Moderator

    @Aragone 1. It isn't a single Itemstack.
    2. It is programming, it is never simple.
     
    FreakyPear5 and bowlerguy66 like this.
  11. Offline

    Aragone

    Ok I found something more simple.

    Thanks for your help
     
Thread Status:
Not open for further replies.

Share This Page