Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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

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

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

  • 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.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.