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

Solved setCustomColor help

Discussion in 'Development' started by mm899, May 14, 2019.

  1. mm899

    mm899 Spider Jockey

    Messages:
    32
    So I'm trying to set a colour to leather armor...but my IDE keeps saying:
    Method 'setCustomeColor' not found in \pocketmine\item\Item

    my uses:
    PHP:
    use pocketmine\item\Armor;
    use 
    pocketmine\item\Item;
    use 
    pocketmine\level\Position;
    use 
    pocketmine\Player;
    use 
    pocketmine\Server;
    use 
    pocketmine\block\Block;
    use 
    pocketmine\utils\Color;
    use 
    pocketmine\utils\TextFormat;
    My IDE also says that
    PHP:
    use pocketmine\item\Item;
    is never used.

    The code:
    PHP:
    $boots Armor::get(Armor::LEATHER_BOOTS);
    $color = new Color(25500);
    $boots->setCustomColor($color);
     
  2. SavionLegendZzz

    SavionLegendZzz Slime

    Messages:
    75
    GitHub:
    savionlegends
    check if $boots is an instanceof \pocketmine\item\Armor
     
    mm899 likes this.
  3. mm899

    mm899 Spider Jockey

    Messages:
    32
    I should of had thought of that smh, thanks it worked :)
     
  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.