Adding an inventory to zombies

Discussion in 'Plugin Development' started by 15987632, Jun 9, 2014.

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

    15987632

    im making a plugin that when a player dies they turn into a zombie with all their armor and inventory. i know how to set their armor but how do i duplicate the inventory
     
  2. Offline

    Dubehh

    Not sure,
    Code:java
    1. zombiething.setDrops(p.getInventory().getContents());


    Its not an actual method, but something like that could work :)
     
  3. You can't. You could save the items in a hashmap with the uuid of the zombie as key, and when the zombie dies you set the drops to the items you saved, and optionally you can remove the items from the hashmap to save memory
     
  4. Offline

    15987632

Thread Status:
Not open for further replies.

Share This Page