Code for Lavaproof Armor

Started by YurinaMaekawa on

Topic category: Help with modding (Java Edition)

Last seen on 07:12, 23. Jun 2021
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Code for Lavaproof Armor

Hi there~~
I noticed there isn't a button to make armor items fire/lava proof. I tried to just pick the code for it from a lava proof sword but didn't work, so how do I do this?

Last seen on 07:12, 23. Jun 2021
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Okay, I'm just an idiot, I…
Sun, 05/16/2021 - 07:54

Okay, I'm just an idiot, I was also copying the properties of tools (like attack speed).

 

Second try I realized what I had to do, but something was somehow wrong and it failed, so I came here to ask. I repeated the process a third time and it worked, so the solution is as simple as opening the code for your armor, find this line of code:

elements.items.add(() -> new ArmorItem(armormaterial, EquipmentSlotType.LEGS, new Item.Properties().group(ItemGroup.COMBAT)) {

 

and then add ".isImmuneToFire()", so it looks like this:

 

elements.items.add(() -> new ArmorItem(armormaterial, EquipmentSlotType.LEGS, new Item.Properties().group(ItemGroup.COMBAT).isImmuneToFire()) {

 

Do this for the 4 pieces, not only for one.

 

(Since this post turned out to be kinda useless for me not realizing what I was doing wrong, I took advantage of the situation to turn it into kind of a tutorial so it doesn't go to waste, now people with the same issue can go through it)