Adding Item information for Armor on MCreator 2020.2

Started by _Ness on

Topic category: Advanced modding

Last seen on 07:12, 23. Jan 2023
Joined Oct 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Adding Item information for Armor on MCreator 2020.2

I'm trying to add lore/item information on armor pieces via code editing, but I can't figure out what I have to do. Can someone please help me on that ?

Last seen on 05:29, 31. Jan 2022
Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
override the addInformation…
Wed, 04/29/2020 - 16:29

override the addInformation method in your item's class

Last seen on 07:12, 23. Jan 2023
Joined Oct 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Could you be a bit more…
Wed, 04/29/2020 - 17:01

Could you be a bit more precise please ? I don't understand completely...

Last seen on 05:29, 31. Jan 2022
Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
after you created the armor…
Wed, 04/29/2020 - 19:17

after you created the armor element, save it and go to the main window where all your mod elements are displayed.

on the left of the window click the button "Edit code of selected mod element".

you will see in the code lines like this: 

    elements.items.add(() -> new ItemArmor(enuma, 0, EntityEquipmentSlot.HEAD) { .... }

there's code blocks like this for each of your armor pieces. in the one you want to add text info, add this method:

@Override
public void addInformation(ItemStack stack, World worldIn, List<String> tooltip, ITooltipFlag flagIn) {
    super.addInformation(stack, worldIn, tooltip, flagIn);
    tooltip.add("Info text 1: blah");
    tooltip.add("Info text 2: blah blah");
}