I don't know how o solve this but i keep getting Caused by: java.lang.NullPointerException: Item id not set
here is my code:
import io.github.beez131github.grow_gc.Grow_Gc;
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroups;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.util.Identifier;
public class ModItems {
public static final Item ROOTED_GOLDEN_CARROT = registerItem("rooted_golden_carrot", new Item(new Item.Settings()
.registryKey(RegistryKey.of(RegistryKeys.ITEM, Identifier.of(Grow_Gc.MOD_ID, "rooted_golden_carrot")))));
private static Item registerItem(String name, Item item) {
return Registry.register(Registries.ITEM, Identifier.of(Grow_Gc.MOD_ID, name), item);
}
public static void registerModItems() {
Grow_Gc.LOGGER.info("Registering Mod Items for " + Grow_Gc.MOD_ID);
}
}