Jump to content

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


imacatlolol

Recommended Posts

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.

Link to comment
Share on other sites

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. :)

  • Thanks 1
Link to comment
Share on other sites

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
  • Like 1

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

Link to comment
Share on other sites

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

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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