ItemGroup categories seem to not exist #2739
-
I've been trying to work on a random mod, and I've gotten to the point of attempting to make an item. Following a tutorial that seems to match up with the fabric wiki, I've tried adding in the line of code to make a new item and put it under an item category, in this case I am trying to put it in This code for this file is shown below, but for whatever reason the part the defines the item category, in this case the word package v0ru5.tactical.tadpoles;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class TacticalTadpoles implements ModInitializer {
// This logger is used to write text to the console and the log file.
// It is considered best practice to use your mod id as the logger's name.
// That way, it's clear which mod wrote info, warnings, and errors.
public static final Logger LOGGER = LoggerFactory.getLogger("modid");
public static final Item TADPOLE_LAUNCHER = new Item(new FabricItemSettings().group(ItemGroup.COMBAT));
@Override
public void onInitialize() {
// This code runs as soon as Minecraft is in a mod-load-ready state.
// However, some things (like resources) may still be uninitialized.
// Proceed with mild caution.
LOGGER.info("Hello Fabric world!");
}
} I don't know what is causing this error, and why it just isn't working at all, as the game fails to load up with this error. I'm using Visual Studio Code for this, and it also doesn't show any autocomplete categories after That's about it, any help would be much appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
The wiki tutorial is written for 1.19.2. 1.19.3 overhauled how item groups work, so you no longer specify it in the item settings. The vanilla item group instances also moved to a new class, To add items to a vanilla item group in 1.19.3, you can use ItemGroupEvents.modifyEntriesEvent(ItemGroups.COMBAT).register(entries -> {
entries.add(TADPOLE_LAUNCHER);
}); |
Beta Was this translation helpful? Give feedback.
The wiki tutorial is written for 1.19.2. 1.19.3 overhauled how item groups work, so you no longer specify it in the item settings. The vanilla item group instances also moved to a new class,
ItemGroups
.To add items to a vanilla item group in 1.19.3, you can use
ItemGroupEvents.modifyEntriesEvent
. For example: