Posted October 7, 20204 yr After a lot of searching and trial and error, I would like to know if it is possible to create custom armor similar to using IArmorMaterial but using IForgeItem.The reason I want to do this is because IForgeItem has some fields that IArmorMaterial does not, and I would like to use those while maintaining the same fields that IArmorMaterial has. (IForgeItem#isEnderMask in particular) Any help would be appreciated. Edited October 7, 20204 yr by ThatGuyDavid
October 7, 20204 yr I am not really sure that i got what your question right but IArmorMaterial is just used to get material specific stats for your armor pieces..this is unrelated to IForgeItem. When you create your custom armor piece item you create a new ArmorItem, which extends Item, which extends IForgeItem. Then in the constructor of your ArmorItem you pass an armor material. What are you trying to do exactly? Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port
October 7, 20204 yr Author I would like the ArmorItem to have the property of isEnderMask to be true, and I don't see how I can do that.
October 7, 20204 yr Author 18 minutes ago, diesieben07 said: Override the method in your item class. I put the @Override method in my item class, but it did not work. I implemented it like this: package com.thatguydavid09.glasses.items; import com.thatguydavid09.glasses.Glasses; import net.minecraft.entity.monster.EndermanEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; public class SunglassItemBase extends Item { public SunglassItemBase() { super(new Item.Properties().group(Glasses.TAB)); } @Override public boolean isEnderMask(ItemStack stack, PlayerEntity player, EndermanEntity endermanEntity) { return true; } } and registered it like this: public static final RegistryObject<Item> SUNGLASS_LENS = ITEMS.register("sunglass_lens", SunglassItemBase::new); Did I do something wrong? Edited October 7, 20204 yr by ThatGuyDavid
October 7, 20204 yr If you want to create a wearable piece of armor you need to extend ArmorItem Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port
October 7, 20204 yr Author 4 minutes ago, Beethoven92 said: If you want to create a wearable piece of armor you need to extend ArmorItem That worked, thank you!
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.