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

Setting armor without knowing the type.

Comments in 'Plugin Development' started by Legoboy0215, Mar 2, 2016.

  1. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    setHelmet, setBoots blah... I want to know a way to just simply set the armor without needing to determine the type of armor it is. Not add it into the inv, but SET it.
  2. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    PHP:
    $inv->setArmorItem(($item->getId() - 2) % 4$item);
    (This requires determining the type too, but in a simple way)
    PocketKiller and Legoboy0215 like this.
  3. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    Explain?
  4. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    All helmet item IDs are 4n+2, chestplates 4n+3, vice versa
    Legoboy0215 likes this.

Share This Page

Advertisement