Question TranslatableComponent from item type in an item's lore

  • After careful consideration and due to limited usage, we’ve made the decision to discontinue the PaperMC forums. Moving forward, we recommend using Hangar for plugin uploads, and for all other community discussions and support, please join us on Discord.

Slav ebb

New member
May 26, 2024
7
1
3
Helloo, i'd like to know how can i use a translatable component of an item type, in an item's lore (the title speaks for itself)

I've never used translatableComponents before so i dont really know what am i doing XD

TranslatableComponent text = new TranslatableComponent(is.getType().translationKey()); lore.add(ChatColor.WHITE+ text);
/.\ i thought this would of worked, but it does not at all
 

Slav ebb

New member
May 26, 2024
7
1
3
I FFFINALY figured it out
List<Component> lore = new ArrayList<Component>(); final Component message = Component.translatable(is.getType().translationKey()); lore.add(message);
 
  • Like
Reactions: mbaxter