Drop all of a players inventory and get a logged off players inventory

Discussion in 'Plugin Development' started by kevinspl2000, Nov 2, 2013.

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

    kevinspl2000

    Okay so I have come up with a basic code and I want to do drop an inventory if something happens. I tried using world.dropItem(loc, player.getInventory);
    but the inventory isn't an item. Any way to fix this?
    EDIT: I also want to get an inventory from a player that isn't online. Would this affect it or do I have to make a place to store the contents?
    Thanks
     
  2. Offline

    Tss1410

    To get a players inventory when he is offline, you have to store the items of the player before he logs out
     
  3. Offline

    kevinspl2000

    Tss1410
    Thanks man.
    But how would I store it?
     
  4. Offline

    GaaTavares

    for drop all the items, store them in a hashmap/arraylist, and use:
    Code:java
    1. for (ItemStack is: yourarray/hashmethod){
    2. world.dropItem(loc, is);
    3. }
     
Thread Status:
Not open for further replies.

Share This Page