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

Hello, this is the first time I've created a mod for Minecraft and my mod is for an entity that plays in your world.
I've survived several tutorials and documentation, but I still can't do what I want to do. Can you tell me why I'm getting this error?

Everything looks good. no ?

spacer.png

spacer.png

Forge for 1.21.4 changelist : https://gist.github.com/ChampionAsh5357/d895a7b1a34341e19c80870720f9880f

Repos Github for my mod : https://github.com/Maxime66410/TheFakePlayer

Last Log : https://gist.github.com/Maxime66410/246f983f2d791469ae87a77825527da9

 

Caused by: java.lang.NullPointerException: Registry Object not present: thefakeplayer:fake_player_entity
	at TRANSFORMER/[email protected]/net.minecraftforge.registries.RegistryObject.get(RegistryObject.java:193) ~[forge-1.21.4-54.1.3_mapped_official_1.21.4-recomp.jar%231!/:?]
	at TRANSFORMER/[email protected]/org.furranystudio.thefakeplayer.Events.ClientModEvents.entityAttributes(ClientModEvents.java:27) ~[main/:?]
	at TRANSFORMER/[email protected]/org.furranystudio.thefakeplayer.Events.__ClientModEvents_entityAttributes_EntityAttributeCreationEvent.invoke(.dynamic) ~[main/:?]
	at SECURE-BOOTSTRAP/net.minecraftforge.eventbus/net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:46) ~[eventbus-6.2.27.jar:?]
	at SECURE-BOOTSTRAP/net.minecraftforge.eventbus/net.minecraftforge.eventbus.EventBus.post(EventBus.java:302) ~[eventbus-6.2.27.jar:?]
	at SECURE-BOOTSTRAP/net.minecraftforge.eventbus/net.minecraftforge.eventbus.EventBus.post(EventBus.java:288) ~[eventbus-6.2.27.jar:?]
	at LAYER PLUGIN/[email protected]/net.minecraftforge.fml.javafmlmod.FMLModContainer.acceptEvent(FMLModContainer.java:184) ~[javafmllanguage-1.21.4-54.1.3.jar:54.1.3]

 

 

SOLUTION : 

ModEntities.ENTITIES.register(modEventBus); -> public Thefakeplayer(FMLJavaModLoadingContext context)

https://docs.minecraftforge.net/en/1.21.x/concepts/registries/

https://github.com/MinecraftForge/MinecraftForge/blob/1.21.x/src/main/java/net/minecraftforge/registries/DeferredRegister.java

 

Edited by Maxime66410

  • Maxime66410 changed the title to [Solved][Forge 1.21.4] Registry Object not present

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.