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.
It's kind of a convoluted process unlike what was evidently available in 1.18.1. They really made a breaking change according to what Kaupenjoe demonstrated in a 1.18.1 tutorial.
I created something similar to what Kaupenjoe has here.
package com.badkraft.foundations.tags;
import com.badkraft.foundations.Foundations;
import net.minecraft.core.Registry;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.BlockTags;
import net.minecraft.tags.ItemTags;
import net.minecraft.tags.TagKey;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.block.Block;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.tags.ITag;
public class ModTags {
public static class Items {
public static final TagKey<Item> FLINT_TOOL_MATERIALS = bind("flint_tool_materials");
public static final ITag<Item> STONE_ITEMS = createTag("stone");
public static final ITag<Item> MASONRY_ITEMS = createTag("masonry");
private static ITag<Item> createTag(String name) {
return ForgeRegistries.ITEMS.tags().getTag(tag(name));
}
private static TagKey<Item> tag(String name) {
return ItemTags.create(new ResourceLocation(Foundations.MOD_ID, name));
}
private static TagKey<Item> forgeTag(String name) {
return ItemTags.create(new ResourceLocation("forge", name));
}
}
private static TagKey<Item> bind(String name) {
return TagKey.create(Registry.ITEM_REGISTRY, new ResourceLocation(name));
}
}
Recommended Posts
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.