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.

[Solved] [1.14.4] Using RegistryObjects with EntityTypes, but still making spawn eggs?

Featured Replies

Posted

I'm aware that you have to initialize EntityTypes before spawn eggs in order for them to link up, then register the EntityTypes in their event. I like to do this with RegistryObjects to keep things consistent across my mod, but I know they're not designed for this use. There's no way to set the value inside of a RegistryObject without registering it first, which makes sense of course, so I'm sure trying to work around that would just be a hacky solution at best.

 

Is there any way of still using RegistryObjects, and also having the spawn eggs point to the correct EntityType reference even if changes by the ObjectHolderRegistry? Maybe I could create dummy EntityTypes that get changed after registration, using custom spawn eggs?

 

This probably isn't worth all the effort...

I'm eager to learn and am prone to mistakes. Don't hesitate to tell me how I can improve.

I haven't tried this using RegistryObject yet, but I believe Cadiboo has a custom spawn egg that takes a Supplier in the constructor in his example mod on github. https://github.com/Cadiboo/Example-Mod/blob/1.15.2/src/main/java/io/github/cadiboo/examplemod/item/ModdedSpawnEggItem.java

 

I haven't messed with it myself, so your mileage may vary, but seems like a good place to start until something proper is done about the spawn egg mess. :)

  • Author
2 hours ago, Ugdhar said:

I haven't tried this using RegistryObject yet, but I believe Cadiboo has a custom spawn egg that takes a Supplier in the constructor in his example mod on github. https://github.com/Cadiboo/Example-Mod/blob/1.15.2/src/main/java/io/github/cadiboo/examplemod/item/ModdedSpawnEggItem.java

 

I haven't messed with it myself, so your mileage may vary, but seems like a good place to start until something proper is done about the spawn egg mess. :)

I suppose that's an ideal workaround, thanks for letting me know (and thanks @Cadiboo), I'll try something somewhat similar.

Edited by imacatlolol

I'm eager to learn and am prone to mistakes. Don't hesitate to tell me how I can improve.

  • imacatlolol changed the title to [Solved] [1.14.4] Using RegistryObjects with EntityTypes, but still making spawn eggs?

Yes, in my mod i have made a Unicorn, but for making this i looked Cadiboo‘s Github. Dont know if this can work for the 1.14.4, but i hope for you that yes. You need to make a own Spawnegg.

New in Modding? == Still learning!

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.