Posted August 3, 20223 yr i get this error, what do i do Caused by: java.lang.ClassCastException: class net.minecraftforge.registries.RegistryObject cannot be cast to class net.JustEmSee_Burd.the_majestic.spell.Spell (net.minecraftforge.registries.RegistryObject is in module [email protected] of loader 'TRANSFORMER' @9aa2002; net.JustEmSee_Burd.the_majestic.spell.Spell is in module [email protected] of loader 'TRANSFORMER' @9aa2002)
August 3, 20223 yr See RegistryObject.get() Boilerplate: If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one. If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install Large files should be posted to a file sharing site like https://gist.github.com You should also read the support forum sticky post.
August 3, 20223 yr Author ok that was fixed and now i am running into this java.lang.NullPointerException: Registry Object not present: majestic:fire_ball
August 3, 20223 yr Author this is the part resposible for the error, by not calling this i dont get the error private static <T extends Spell>RegistryObject<SpellItem> registerSpellItem(String name, RegistryObject<T> spell, CreativeModeTab tab) { return ModItems.ITEMS.register(name+"_scroll", () -> new SpellItem(spell.get(), new SpellItem.Properties().tab(tab))); }
August 3, 20223 yr See: https://forums.minecraftforge.net/topic/114475-1182-registry-object-not-present/#comment-507782 Basically you can't directly reference other registered objects at registration time from blocks and items. They are created/registered *after* the blocks and items. You need to change your SpellItem to use a Supplier<Spell> and defer the get() to when you need the Spell at runtime. Boilerplate: If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one. If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install Large files should be posted to a file sharing site like https://gist.github.com You should also read the support forum sticky post.
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.