Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

After upgrade from 1.21.1 to 1.21.3, when I do gradlew runData, I get really strange error that I cannot understand:

Caused by: java.lang.NullPointerException: Item id not set
		at java.base/java.util.Objects.requireNonNull(Objects.java:259)
		at TRANSFORMER/minecraft@1.21.3/net.minecraft.world.item.Item$Properties.effectiveDescriptionId(Item.java:461)
		at TRANSFORMER/minecraft@1.21.3/net.minecraft.world.item.Item.<init>(Item.java:111)
		at TRANSFORMER/uniqueweaponry@1.21.3-0.4.1/ba.minecraft.uniqueweaponry.common.item.grenade.base.BaseGrenadeItem.<init>(BaseGrenadeItem.java:22)
		at TRANSFORMER/uniqueweaponry@1.21.3-0.4.1/ba.minecraft.uniqueweaponry.common.item.grenade.FlashGrenadeItem.<init>(FlashGrenadeItem.java:9)
		at TRANSFORMER/uniqueweaponry@1.21.3-0.4.1/ba.minecraft.uniqueweaponry.common.item.GrenadeItems.lambda$0(GrenadeItems.java:22)
		at TRANSFORMER/forge@53.0.0/net.minecraftforge.registries.DeferredRegister$EventDispatcher.lambda$handleEvent$0(DeferredRegister.java:366)
		at TRANSFORMER/forge@53.0.0/net.minecraftforge.registries.RegisterEvent.register(RegisterEvent.java:59)
		at TRANSFORMER/forge@53.0.0/net.minecraftforge.registries.DeferredRegister$EventDispatcher.handleEvent(DeferredRegister.java:366)
		at TRANSFORMER/forge@53.0.0/net.minecraftforge.registries.__EventDispatcher_handleEvent_RegisterEvent.invoke(.dynamic)
		at SECURE-BOOTSTRAP/net.minecraftforge.eventbus/net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:48)
		at SECURE-BOOTSTRAP/net.minecraftforge.eventbus/net.minecraftforge.eventbus.EventBus.post(EventBus.java:304)
		at SECURE-BOOTSTRAP/net.minecraftforge.eventbus/net.minecraftforge.eventbus.EventBus.post(EventBus.java:290)

Have there been changes related on how items should be registered now?

Fabric explains it a bit here, Forge needs to provide a guide for 1.21.3 since the examples are Fabric specific: https://fabricmc.net/2024/10/14/1212.html

EDIT: This seems to work but I don't know if this is the proper way to do it. Truly an annoying change especially if you have lots of items and blocks:

Old:

public static final RegistryObject<Item> ITEM_EGG = ITEMS.register("egg", () -> new Item(new Item.Properties()));

New:

ITEM_EGG = ITEMS.register("egg", () -> new Item(new Item.Properties().useItemDescriptionPrefix().setId(ResourceKey.create(Registries.ITEM, ResourceLocation.parse("modid:egg")))));

Neo also has more on the topic: https://neoforged.net/news/21.2release/

Edited by xndir

The information from xndir worked for me. Alsp in my case, similar errors appear for fluid blocks in the new version, indicating that adjustments are also necessary. Without these changes, an error message stating “block id not set” will appear.

The following code example demonstrates how to correctly configure the fluid block:

public static final RegistryObject<LiquidBlock> EXAMPLE_FLUID_BLOCK =
    BlocksRegister.BLOCKS.register(
        "example_fluid_block",
        () ->
            new ExampleFluidBlock(
                EXAMPLE_FLUID,
                Block.Properties.ofFullCopy(Blocks.WATER)
                    .noCollission()
                    .strength(1000.0F)
                    .noOcclusion()
                    .setId(
                        ResourceKey.create(
                            ForgeRegistries.BLOCKS.getRegistryKey(),
                            ResourceLocation.parse(
                                String.format("%s:%s", ExampleMod.MOD_ID, "example_fluid_block")
                            )
                        )
                    )
            )
    );

 

Edited by CasAl
make the background clear

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.