1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

How to set color to armor?

Discussion in 'Development' started by SerezhaIvanov, Jun 21, 2018.

  1. SerezhaIvanov

    SerezhaIvanov Silverfish

    Messages:
    23
    GitHub:
    serezhaivanov02
    Hi, how to set custom color to leather armor?
     
  2. KHAV

    KHAV Baby Zombie

    Messages:
    152
    GitHub:
    xkhhv
    PHP:
    $chestplate Item::get(29901);
    $customColor 0x00ff3300//Color
    $tempTag = new CompoundTag("", []);
    $tempTag->setInt("customColor"$customColor);
    $chestplate->setCompoundTag($tempTag);
    $chestplate->setCustomName("§r§cRed Chestplate");
    $red->getArmorInventory()->setChestplate($chestplate);
     
  3. SerezhaIvanov

    SerezhaIvanov Silverfish

    Messages:
    23
    GitHub:
    serezhaivanov02
    thank
     
  4. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    There's a method for armors.
    PHP:
    $color = new Color(25500);//r, g, b
    $armor->setCustomColor($color);
     
  5. Levi

    Levi Skeleton

    Messages:
    955
    GitHub:
    captainleviftw
    Is that for all armora
     
  6. KHAV

    KHAV Baby Zombie

    Messages:
    152
    GitHub:
    xkhhv
    Oh my god that was very simple xD
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.