Solved Banner on head

Discussion in 'Spigot Plugin Development' started by Switch, Jun 3, 2016.

  1. Hello !
    Do you know how can i put a red banner on a player's head ?
    Thx :33
     
  2. First set a itemstack and itemmeta and then do set Helmet.
     
  3. use : player.getInventory().setHelmet(yourbanner);
     
  4. Yay :D It's work :3
    Thanks a lot ^^

    Code:

    ItemStack banner = new ItemStack(Material.BANNER, 1);
    BannerMeta meta = (BannerMeta)banner.getItemMeta();
    meta.setBaseColor(DyeColor.RED);
    banner.setItemMeta(meta);
    p.getInventory().setHelmet(banner);