Войти или зарегистрироваться

Помогите Как вызвать цвет, у кожаной вещи ?

  • Автор темы Автор темы RusDieF
  • Дата начала Дата начала

RusDieF

Активный участник
Пользователь
Баллы
66
Имя в Minecraft
DieF
@EventHandler
public void onEntitySpawnSkeletons(CreatureSpawnEvent e)
{
LivingEntity ent = e.getEntity();
if(e.getEntityType() == EntityType.SKELETON)
{
byte s = (byte) rng.nextInt(3);
if(s == 0)
{
ent.setCustomName("Ghost1");
ent.setCustomNameVisible(true);
ent.setMaxHealth(30);
ent.setHealth((int) 30.0D);
ent.getEquipment().setItemInHand(new ItemStack(Material.IRON_HOE));
ent.getEquipment().setChestplate(new ItemStack(Material.LEATHER_CHESTPLATE));
ent.getEquipment().setHelmet(new ItemStack(Material.SKULL_ITEM, (short)1));
}
как сделать так что бы Material.Leather_Chestplate при спауне был черный ?
 
Выдать итемстак с изменённой LeatherMeta
 
спасибо

ItemStack leather = new ItemStack(Material.LEATHER_CHESTPLATE, 1);
LeatherArmorMeta leatherMeta = (LeatherArmorMeta) leather.getItemMeta();
leatherMeta.setColor(Color.BLACK);
вот так верно ?
Не забудьте приделать эту мету итемстаку
 
item.setItemMeta((ItemMeta) meta);
ent.getEquipment().setChestplate(new ItemStack(Material.LEATHER_CHESTPLATE));
ItemStack leather = new ItemStack(Material.LEATHER_CHESTPLATE);
LeatherArmorMeta leatherMeta = (LeatherArmorMeta) leather.getItemMeta();
leatherMeta.setColor(Color.BLACK);
leather.setItemMeta(leatherMeta);
все ровно создает моба с обычной кожаной броней
 
ent.getEquipment().setChestplate(new ItemStack(Material.LEATHER_CHESTPLATE));
ItemStack leather = new ItemStack(Material.LEATHER_CHESTPLATE);
LeatherArmorMeta leatherMeta = (LeatherArmorMeta) leather.getItemMeta();
leatherMeta.setColor(Color.BLACK);
leather.setItemMeta(leatherMeta);
все ровно создает моба с обычной кожаной броней

Скинте весь код метода. И желательно в блоке
Код:
. Так читать удобнее.
 
Назад
Верх