imacatlolol Posted February 22, 2020 Posted February 22, 2020 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... Quote I'm eager to learn and am prone to mistakes. Don't hesitate to tell me how I can improve.
Ugdhar Posted February 22, 2020 Posted February 22, 2020 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. 1 Quote
imacatlolol Posted February 22, 2020 Author Posted February 22, 2020 (edited) 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 February 22, 2020 by imacatlolol 1 Quote I'm eager to learn and am prone to mistakes. Don't hesitate to tell me how I can improve.
DragonITA Posted February 22, 2020 Posted February 22, 2020 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. Quote New in Modding? == Still learning!
Recommended Posts
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.