You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to the blog post Fabric for Minecraft 1.21.2, this can be resolved by manually setting registry keys. Here's the example in the blog post:
Identifierid = Identifier.of("mymod", "test_item");
RegistryKey<Item> key = RegistryKey.of(RegistryKeys.ITEM, id);
Item.Settingssettings = newItem.Settings()
// If your item is based on a block
.useBlockPrefixedTranslationKey()
.registryKey(key);
Registry.register(Registries.ITEM, key, newItem(settings));
The text was updated successfully, but these errors were encountered:
valentinegb
changed the title
Creating Your First Item: 'NullPointerException: Item id not set
Creating Your First Item: "NullPointerException: Item id not set" in Minecraft 1.21.2
Nov 19, 2024
valentinegb
changed the title
Creating Your First Item: "NullPointerException: Item id not set" in Minecraft 1.21.2
Creating Your First Item: "NullPointerException: Item id not set" in Minecraft 1.21.2 and onward
Nov 19, 2024
Following the Creating Your First Item guide as it is now, results in the following error:
According to the blog post Fabric for Minecraft 1.21.2, this can be resolved by manually setting registry keys. Here's the example in the blog post:
The text was updated successfully, but these errors were encountered: