0
\$\begingroup\$

The error in question is [Inferred type 'I' for type parameter 'I' is not within its bound; should extend 'net.minecraft.item.Item']

on the following snippet of code

// Armor Items
public static final RegistryObject<ArmorItem> RINGMAIL_HELMET = ITEMS.register("ringmail_helmet",
        new ArmorItem(DnDCraftArmorMaterial.RINGMAIL, EquipmentSlotType.HEAD, new Item.Properties().group(DnDCraft.TAB)));

I have tried many things like what I do here

public static final RegistryObject<Item> RING = ITEMS.register("ring", ItemBase::new);

by putting the ItemBase::new snippet in the last paramter. I've also tried seeing what IntelliJ suggests is best in-context action but none of those approaches seemed to fix the issue.

I'm not super familiar with Java or Minecraft modding so this may just be something simple that I am missing but any help or recommendations would be nice. Thanks!

Also this is the ItemBase class, in case that helps.

package com.fire.dndcraft.items;

import com.fire.dndcraft.DnDCraft;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;

public class ItemBase extends Item {
    public ItemBase() {
        super(new Item.Properties().group(DnDCraft.TAB));
    }
}
\$\endgroup\$
  • \$\begingroup\$ I have the same problem have you figured this out yet? \$\endgroup\$ – user144365 Oct 16 at 16:39
1
\$\begingroup\$

I had the same problem, try adding () -> after the comma that's after the ringmail_helmet but don't add another comma

public static final RegistryObject<ArmorItem> RINGMAIL_HELMET = ITEMS.register("ringmail_helmet", () ->
        new ArmorItem(DnDCraftArmorMaterial.RINGMAIL, EquipmentSlotType.HEAD, new Item.Properties().group(DnDCraft.TAB)));
| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.