Code for Lavaproof Armor

Started by YurinaMaekawa on Sun, 05/16/2021 - 07:28

Topic category: Help with modding (Java Edition)

Last seen on 14:24, 11. Jun 2021
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Code for Lavaproof Armor
Sun, 05/16/2021 - 07:28

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 14:24, 11. Jun 2021
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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)