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

Colored leather armor

Comments in 'Plugin Development' started by JackboyPlay, May 11, 2016.

  1. JackboyPlay
    Offline

    JackboyPlay Active Member

    Joined:
    Apr 25, 2015
    Posts:
    507
    Minecraft User:
    JackboyPlay
    I know that it was already asked but I cant take a good solution from the another threads so I'll ask you can someone send a code how I can dye a leather armor in green?
  2. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    Code by @60FF00 all credits goes to him
    PHP:
    public function applyColorToLeatherChestplate(\pocketmine\Player $player$customColor 0x0064ff00)
    {
            
    $chestPlate Item::get(299);
            
    $tempTag = new CompoundTag("", []);
            
    $tempTag->customColor = new IntTag("customColor"$customColor);
            
    $chestPlate->setCompoundTag($tempTag);
            
    $player->getInventory()->setChestplate($chestPlate);
    }
  3. JackboyPlay
    Offline

    JackboyPlay Active Member

    Joined:
    Apr 25, 2015
    Posts:
    507
    Minecraft User:
    JackboyPlay
    Thanks

Share This Page

Advertisement