Jump to content

Recommended Posts

Posted (edited)

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 by ThatGuyDavid
Posted

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

Posted (edited)
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 by ThatGuyDavid

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.