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 TheBison_, Jun 11, 2016.

  1. TheBison_
    Offline

    TheBison_ New Member

    Joined:
    Mar 31, 2014
    Posts:
    46
    Minecraft User:
    TheBisonXD_
    Is it possible to give a player a colored leather armor?
    I found many old threads but i think nothing works...
    Please help me :)
  2. wolfdale
    Offline

    wolfdale Active Member Plugin Developer

    Joined:
    Dec 3, 2014
    Posts:
    276
    Plugins:
    1
    Minecraft User:
    ace
  3. SOFe
    Offline

    SOFe Banned

    Joined:
    May 28, 2016
    Posts:
    386
    Minecraft User:
    Herobrine
  4. Hotshot_9930
    Offline

    Hotshot_9930 Notable Member Plugin Developer

    Joined:
    May 26, 2014
    Posts:
    665
    Plugins:
    2
    Minecraft User:
    HotshotHD
    PHP:
    $item Item::get($item);
    $tempTag = new CompoundTag("", []);
    $tempTag->customColor = new IntTag("customColor"$colorCode);

    $item->setCompoundTag($tempTag);
    $player->getInventory()->setHelmet($item);
    #Or
    $player->getInventory()->setChestplate($item);
    #etc..
    AndrewBit likes this.
  5. TheBison_
    Offline

    TheBison_ New Member

    Joined:
    Mar 31, 2014
    Posts:
    46
    Minecraft User:
    TheBisonXD_
    The $colorCode is a hexa code, right?
  6. TheBison_
    Offline

    TheBison_ New Member

    Joined:
    Mar 31, 2014
    Posts:
    46
    Minecraft User:
    TheBisonXD_
    Ok nice it works, thanks!
    Hotshot_9930 likes this.
  7. SOFe
    Offline

    SOFe Banned

    Joined:
    May 28, 2016
    Posts:
    386
    Minecraft User:
    Herobrine
    More precisely, the resultant numeric value of the hexadecimal code. For instance, "ABCDEF" is the hexadecimal code; 0xABCDEF is the numeric value of it ;)
    applqpak and TheBison_ like this.
  8. Yupai
    Offline

    Yupai New Member

    Joined:
    Aug 30, 2015
    Posts:
    2
    Minecraft User:
    Yupai
    And how is the code of red color? Please :)
  9. xBeastMode
    Offline

    xBeastMode Active Member

    Joined:
    Nov 27, 2015
    Posts:
    292
    0xDA2623
    applqpak likes this.
  10. Yupai
    Offline

    Yupai New Member

    Joined:
    Aug 30, 2015
    Posts:
    2
    Minecraft User:
    Yupai
    And the blue? How do you do it?
  11. JackboyPlay
    Offline

    JackboyPlay Active Member

    Joined:
    Apr 25, 2015
    Posts:
    507
    Minecraft User:
    JackboyPlay
  12. MyNameIsTriXz
    Offline

    MyNameIsTriXz Notable Member

    Joined:
    Aug 17, 2015
    Posts:
    538
    Minecraft User:
    MyNameIsTriXz
  13. SOFe
    Offline

    SOFe Banned

    Joined:
    May 28, 2016
    Posts:
    386
    Minecraft User:
    Herobrine
    https://www.jetbrains.com/help/phpstorm/2016.2/color-picker.html

    (Sorry, but I personally have a bad impression in w3schools. Not only me, but the below)
    Gamecrafter, applqpak and Primus like this.
  14. MyNameIsTriXz
    Offline

    MyNameIsTriXz Notable Member

    Joined:
    Aug 17, 2015
    Posts:
    538
    Minecraft User:
    MyNameIsTriXz
    Everyone has his decision, we3schools helped me out the most times when I searched for the right HTML tag and the usage, they are for me like the HTML docs, compared to PHP with php.net. ^^

Share This Page

Advertisement