mod on fabric #3138
Unanswered
vdartsabvile
asked this question in
Mod Dev Support
mod on fabric
#3138
Replies: 1 comment
-
|
As of Minecraft 1.20, item groups use registry keys, meaning the event in Fabric API was changed accordingly. Registry keys for vanilla item groups are available in the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description
I'm trying to add an item, but an error pops up.
Error: C:\Users\Vanechka\Desktop\vdatmod-template-1.20\src\main\java\com\vdcompany\item\vdMODitems.java:17: error: incompatible types: ItemGroup cannot be converted to RegistryKey
ItemGroupEvents.modifyEntriesEvent(itemGroup).register(entries -> entries.add(returnitem));
^
Code: package com.vdcompany.item;
import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.util.Identifier;
import com.vdcompany.vdatmod;
public class vdMODitems {
public static final Item NEW_ITEM = registreItem("new_item", new Item(new FabricItemSettings()));
}
Beta Was this translation helpful? Give feedback.
All reactions