Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Spawn a Human with armor

Comments in 'Plugin Development' started by Tethered_, Feb 3, 2015.

  1. Tethered_
    Offline

    Tethered_ Active Member Plugin Developer

    Joined:
    Jun 24, 2014
    Posts:
    178
    Plugins:
    2
    Minecraft User:
    Frostbyte58
    What should I use in an nbt compound for armor?
  2. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    In the Inventory part.
    Tethered_ likes this.
  3. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    We're talking about using the API.
    You can also use the previous snippet I gave you, and then:
    PHP:
    $human->getInventory()->setHelmet(new LeatherCap);
  4. Samueljh1
    Offline

    Samueljh1 Active Member Plugin Developer

    Joined:
    Jan 9, 2015
    Posts:
    316
    Plugins:
    5
    Minecraft User:
    Samueljh1_
    Lol no, if you used my code that I gave you, there will be a variable called
    $itemEntity. Now just do this:

    PHP:
                $Inv $itemEntity->getInventory();

                
    $Inv->setHelmet(Item::get(123));
                
    $Inv->setChestplate(Item::get(456));
                
    $Inv->setLeggings(Item::get(789));
                
    $Inv->setBoots(Item::get(123));

Share This Page

Advertisement