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

Coloured Armor

Comments in 'Plugin Development' started by CaptainKenji17, Jul 2, 2016.

  1. CaptainKenji17
    Offline

    CaptainKenji17 Active Member

    Joined:
    Apr 22, 2014
    Posts:
    252
    Minecraft User:
    CaptainKenji17
    public function GivePlayerItems(Player $player){
    $player->getInventory()->clearAll();
    $i1 = new Item(Item::WOOD_SWORD, 0, 1);
    $i2 = new Item(Item::GOLDEN_APPLE, 0, 1);
    $i3 = new Item(Item::BOW, 0, 1);
    $i4 = new Item(Item::ARROW, 0, 20);
    $i5 = new Item(Item::STICK, 0, 1);
    $player->getInventory()->setItem(1, $i1);
    $player->getInventory()->setItem(2, $i2);
    $player->getInventory()->setItem(3, $i3);
    $player->getInventory()->setItem(4, $i4);
    $player->getInventory()->setItem(5, $i5);
    $player->getInventory()->setHelmet(new Item(Item::IRON_HELMET, 0, 1));
    $player->getInventory()->setBoots(new Item(Item::IRON_BOOTS, 0, 1));
    $player->getInventory()->setChestplate(new Item(Item::IRON_CHESTPLATE, 0, 1));
    $player->getInventory()->setLeggings(new Item(Item::IRON_LEGGINGS, 0, 1));
    }

    can anyone make me a code that do violet leather armor with this method? instead of IRON_LEGGINGS and etc

Share This Page

Advertisement