Started by
Ghoulander
on
Topic category: Help with Minecraft modding (Java Edition)
Trying to add NBT Tags to an items Lore Description area.
Found code that works for 1.16 but not for 1.18.2
@Override
public void addInformation(ItemStack itemstack, World world, List<ITextComponent> list, ITooltipFlag flag) {
super.addInformation(itemstack, world, list, flag);
String line1 = (String) ((itemstack).getOrCreateTag().getString("line1"));
String line2 = (String) ((itemstack).getOrCreateTag().getString("line2"));
list.add(new StringTextComponent((("\u00A75") + "" + (line1))));
list.add(new StringTextComponent((("\u00A75") + "" + (line2))));
}
Did some of this code change with the 1.18.2 update?
Im pretty sure "addInformation" method was replaced by "appendHoverText" in any of the versions 1.16.x (in 1.16.5 its appendHoverText).
Also in 1.17 changed class names:
Thanks Azzier.
That did the trick!
For anyone who would like to use NBT Variables in Lore Descriptions..for 1.17+...Here ya go!