while i cant see your whole code, this works for me:
package com.example.examplemod;
*imports
@Mod("examplemod")
public class ExampleMod
{
public static Tag<Item> coppertag = new ItemTags.Wrapper(new ResourceLocation("forge", "ingots/copper"));
public ExampleMod() {
}
@Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD)
public static class RegistryEvents {
@SubscribeEvent
public static void onItemRegistry(final RegistryEvent.Register<Item> blockRegistryEvent) {
blockRegistryEvent.getRegistry().register(new Item(new Item.Properties().group(ItemGroup.BREWING)).setRegistryName("examplemod:copper"));
blockRegistryEvent.getRegistry().register(new SwordItem(new Tier(),4,1,new Item.Properties().group(ItemGroup.BREWING)).setRegistryName("examplemod:coppersword"));
}
}
public static class Tier implements IItemTier{
@Override
public int getMaxUses() {
return 100;
}
@Override
public float getEfficiency() {
return 4;
}
@Override
public float getAttackDamage() {
return 2;
}
@Override
public int getHarvestLevel() {
return 1;
}
@Override
public int getEnchantability() {
return 50;
}
@Override
public Ingredient getRepairMaterial() {
return Ingredient.fromTag(coppertag);
}
public Tier() {
}
}
}
but i think the problem is that you need
public static final Tag<Item> COPPER_INGOT = new ItemTags.Wrapper(new ResourceLocation("forge", "ingots/copper"));
not
public static final Tag<Item> COPPER_INGOT = ItemTags.getCollection().getOrCreate(new ResourceLocation("forge", "ingots/copper"));
otherwise your copper.json is in a wrong directory