#API
1 messages · Page 1 of 1 (latest)
public List<ItemStack> warriorKit() {
ItemStack helmet = new ItemStack(Material.IRON_HELMET);
ItemMeta helmetM = helmet.getItemMeta();
helmetM.setDisplayName(Utils.hex("#d1060aWarrior Helmet"));
helmetM.addEnchant(Enchantment.DURABILITY, 8, false);
helmetM.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 6, false);
helmetM.addEnchant(Enchantment.PROTECTION_FIRE, 5, false);
helmetM.addEnchant(Enchantment.PROTECTION_PROJECTILE, 7, false);
List<String> lore = new ArrayList<>();
lore.add("");
lore.add(Utils.hex("#0ee37cTouches » +8"));
lore.add(Utils.hex("#0ee37cHealth » +6"));
lore.add(Utils.hex("#0ee37cStrength » +2"));
lore.add(Utils.hex(""));
lore.add(Utils.hex("#e03804ABILITY » Damage loss 25%"));
lore.add(Utils.hex(""));
lore.add(Utils.hex("#d1060aWARRIOR KIT"));
helmetM.setLore(lore);
AureliumAPI.addArmorModifier(helmet, Stats.HEALTH, 6, false);
AureliumAPI.addArmorModifier(helmet, Stats.TOUGHNESS, 8, false);
AureliumAPI.addArmorModifier(helmet, Stats.STRENGTH, 2, false);
helmet.setItemMeta(helmetM);
List<ItemStack> items = new ArrayList<>();
items.add(helmet);
return items;
}```
I see the issue here
The Method returns you the new modified ItemStack
meaning that you need to create something like a helmettwo that is the result of AureliumAPI.addArmorModifier(helmet, Stats.HEALTH, 6, false); and so on.
that's means i should create three itemstack ?
in your case you would need three more itemstacks yes
But I guess you can just reasign it too
AureliumAPI.addArmorModifier(helmet, Stats.HEALTH, 6, false);
ItemStack helmet2 = helmet;
AureliumAPI.addArmorModifier(helmet2, Stats.TOUGHNESS, 8, false);
ItemStack helmet3 = helmet2;
AureliumAPI.addArmorModifier(helmet3, Stats.STRENGTH, 2, false);
helmet3.setItemMeta(helmetM);```
Like this ?
not quite
hmm i do not understand
ItemStack helmet2 = AureliumAPI.addArmorModifier(helmet, Stats.HEALTH, 6, false);
...
Also, set the ItemMeta before using the addArmorModifier method
ow
Thank you
that would override the changes and make it not work again