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

Set armor of entity 0.12.1

Comments in 'Plugin Development' started by MrGenga, Sep 30, 2015.

  1. MrGenga
    Offline

    MrGenga Active Member

    Joined:
    Jul 24, 2015
    Posts:
    75
    Minecraft User:
    MrGenga
    Hello, I need help with the new version of MCPE and PocketMine. In 0.12.1 is added armor and item in hand to entities, usually zombies. I found Human entity with armor and item in hand on one server. How to do this, and this is possible in 1.13.0 API, or only 2.0.0? Here is the screenshot. Screenshot_2015-09-30-15-24-29.png
    jojoe77777 likes this.
  2. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    jojoe77777 likes this.
  3. MrGenga
    Offline

    MrGenga Active Member

    Joined:
    Jul 24, 2015
    Posts:
    75
    Minecraft User:
    MrGenga
    Ok, I'll see his plugin.
    jojoe77777 likes this.
  4. Hotshot_9930
    Offline

    Hotshot_9930 Notable Member Plugin Developer

    Joined:
    May 26, 2014
    Posts:
    665
    Plugins:
    2
    Minecraft User:
    HotshotHD
    Im not too sure about the zombies and skeletons but to set a humans armour
    PHP:
    $huuman->getInventory()->setHelmet($helmet);
    $huuman->getInventory()->setChestplate($chestplate);
    /*
    etc...
    */
    CrazedMiner likes this.
  5. MrGenga
    Offline

    MrGenga Active Member

    Joined:
    Jul 24, 2015
    Posts:
    75
    Minecraft User:
    MrGenga
    PHP:
    $huuman->getInventory()->sendArmorContents($huuman);
    Yes?
    And...
    PHP:
    $huuman->getInventory()->setItemInHand(Item::get(id,dmg,count));
    Yes?
  6. Hotshot_9930
    Offline

    Hotshot_9930 Notable Member Plugin Developer

    Joined:
    May 26, 2014
    Posts:
    665
    Plugins:
    2
    Minecraft User:
    HotshotHD
    Second one is correct. Idk what ur doing with the first one, just use the method i showed u
  7. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    To resend the armor contents?
    iksaku likes this.
  8. Hotshot_9930
    Offline

    Hotshot_9930 Notable Member Plugin Developer

    Joined:
    May 26, 2014
    Posts:
    665
    Plugins:
    2
    Minecraft User:
    HotshotHD
    Whats the point of sending the human their own armour contents?
  9. iksaku
    Offline

    iksaku Notable Member Plugin Developer

    Joined:
    Sep 2, 2013
    Posts:
    1,130
    Plugins:
    4
    Minecraft User:
    iksaku
    Ask @MrGenga
  10. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Actually, that is pointless. But some pm bug makes that necessary to do so in previous versions, not sure if it still hapepns now.
  11. Hotshot_9930
    Offline

    Hotshot_9930 Notable Member Plugin Developer

    Joined:
    May 26, 2014
    Posts:
    665
    Plugins:
    2
    Minecraft User:
    HotshotHD
    Ah ok.
  12. jojoe77777
    Offline

    jojoe77777 Notable Member Plugin Developer

    Joined:
    May 28, 2015
    Posts:
    653
    Plugins:
    1
    Minecraft User:
    jojoe77777
    For the item on hand on a human I had to set the held item slot too (
    PHP:
    $human->getInventory()->setHeldItemSlot($number);
    )

Share This Page

Advertisement