#Item id is not set

6 messages · Page 1 of 1 (latest)

sudden scarab
#

Hello, I'm trying to create a mod on Minecraft, but as soon as I try to launch my game I get this error.

https://pastebin.com/1WYdzhe8

Could someone please help me?
Here's the code for my items class

package fr.silenthill99.anime_mod.init;

import fr.silenthill99.anime_mod.Main;
import net.minecraft.item.Item;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.util.Identifier;

public class ModItems {
    public static final Item TEST = createItem("test", new Item(new Item.Settings()));

    private static Item createItem(String name, Item item) {
        return Registry.register(Registries.ITEM, Identifier.of(Main.MOD_ID, name), item);
    }

    public static void registerItems() {
        Main.LOGGER.info("Register Items for " + Main.MOD_ID);
    }

}
lethal wave
#

I believe you're missing a translation key for your item in your Item.Settings

sage breach
#

In 1.21.4, you need to set the ID of the item in the Item.Settings.

lethal wave
#

Ah yeah getting it mixed up -- it makes the translation key from the registry key and that is just the point which is causing the crash.

sudden scarab
#

so I'm actually in 1.21.3. But in the meantime, I've finally found the solution