tal124 Posted March 16, 2021 Posted March 16, 2021 I thought that registering Entities would be similar to the other ways I have registered Items or Fluids, The tutorials I have seen to do this are both easier, and more difficult than the DeferredRegister's way in 1.16. I have created a Slime Entity called EntityChocolateSlime, but I am unsure as to how I should register it public class ModEntities{ public static final DeferredRegister<EntityType<?>> ENTITIES = DeferredRegister.create(ForgeRegistries.ENTITIES, chocolate.MODID); //Attaches the deferred register to the event bus public static void init() { ENTITIES.register(FMLJavaModLoadingContext.get().getModEventBus()); } public static final EntityType<?> CHOCOLATE_SLIME = ENTITIES.register("chocolate_slime", EntityType.Builder.<EntityChocolateSlime>create(EntityChocolateSlime::new, EntityClassification.MONSTER).size(2.04F, 2.04F).trackingRange(8)); } The error message I get is error: method register in class DeferredRegister<T> cannot be applied to given types; ENTITIES.register("chocolate_cube", EntityType.Builder.<EntityChocolateSlime>create(EntityChocolateSlime::new, ^ Why can it not be applied? Quote
tal124 Posted March 16, 2021 Author Posted March 16, 2021 (edited) 58 minutes ago, poopoodice said: The register method takes a supplier. I have registered the Entity but the game doesn't recognize it, however I can start it up, and I have created both the required renderer and model for my Entity called Chocolate_Slime However it gives me the error "MCP Entity class missing World constructor now" I have tried copying and pasting and changing the magma cubes to match my chocolate slime however it still gives me this error, I have since reverted it back to what I had originally. What am I missing? Edited March 16, 2021 by tal124 Quote
tal124 Posted March 16, 2021 Author Posted March 16, 2021 public class ModEntities{ public static final DeferredRegister<EntityType<?>> ENTITIES = DeferredRegister.create(ForgeRegistries.ENTITIES, chocolate.MODID); //Attaches the deferred register to the event bus public static void init() { ENTITIES.register(FMLJavaModLoadingContext.get().getModEventBus()); } public static final EntityType<EntityChocolateSlime> CHOCOLATE_SLIME = make(EntityNames.CHOCOLATE_SLIME, EntityChocolateSlime::new, EntityClassification.MONSTER, 2.04F, 2.04F); @SuppressWarnings("unchecked") private static <E extends Entity> EntityType<E> build(ResourceLocation id, EntityType.Builder<E> builder) { boolean cache = SharedConstants.useDatafixers; SharedConstants.useDatafixers = false; EntityType<E> ret = (EntityType<E>) builder.build(id.toString()).setRegistryName(id); SharedConstants.useDatafixers = cache; return ret; } private static <E extends Entity> EntityType<E> make(ResourceLocation id, EntityType.IFactory<E> factory, EntityClassification classification, float width, float height) { return build(id, makeBuilder(factory, classification).size(width, height)); } private static <E extends Entity> EntityType.Builder<E> makeBuilder(EntityType.IFactory<E> factory, EntityClassification classification) { return EntityType.Builder.create(factory, classification). size(0.6F, 1.8F). setTrackingRange(80). setUpdateInterval(3). setShouldReceiveVelocityUpdates(true); } } public class EntityChocolateSlime extends SlimeEntity { public EntityChocolateSlime(EntityType<? extends EntityChocolateSlime> type, World worldIn) { super((EntityType<? extends SlimeEntity>) ModEntities.CHOCOLATE_SLIME, worldIn); } public static AttributeModifierMap.MutableAttribute func_234294_m_() { return MonsterEntity.func_234295_eP_().createMutableAttribute(Attributes.MOVEMENT_SPEED, (double)0.2F); } public static boolean func_223367_b(EntityType<EntityChocolateSlime> p_223367_0_, IWorld p_223367_1_, SpawnReason p_223367_2_, BlockPos p_223367_3_, Random p_223367_4_) { return p_223367_1_.getDifficulty() != Difficulty.PEACEFUL; } public boolean isNotColliding(IWorldReader worldIn) { return worldIn.checkNoEntityCollision(this) && !worldIn.containsAnyLiquid(this.getBoundingBox()); } public EntityType<? extends EntityChocolateSlime> getType() { return (EntityType<? extends EntityChocolateSlime>)super.getType(); } protected void setSlimeSize(int size, boolean resetHealth) { super.setSlimeSize(size, resetHealth); this.getAttribute(Attributes.ARMOR).setBaseValue((double)(size * 3)); } protected int getJumpDelay() { return super.getJumpDelay() * 4; } protected void alterSquishAmount() { this.squishAmount *= 0.9F; } protected void jump() { Vector3d vector3d = this.getMotion(); this.setMotion(vector3d.x, (double)(this.getJumpUpwardsMotion() + (float)this.getSlimeSize() * 0.1F), vector3d.z); this.isAirBorne = true; net.minecraftforge.common.ForgeHooks.onLivingJump(this); } protected void handleFluidJump(ITag<Fluid> fluidTag) { if (fluidTag == FluidTags.LAVA) { Vector3d vector3d = this.getMotion(); this.setMotion(vector3d.x, (double)(0.22F + (float)this.getSlimeSize() * 0.05F), vector3d.z); this.isAirBorne = true; } else { super.handleFluidJump(fluidTag); } } protected boolean canDamagePlayer() { return this.isServerWorld(); } protected float func_225512_er_() { return super.func_225512_er_() + 2.0F; } protected SoundEvent getHurtSound(DamageSource damageSourceIn) { return this.isSmallSlime() ? SoundEvents.ENTITY_MAGMA_CUBE_HURT_SMALL : SoundEvents.ENTITY_MAGMA_CUBE_HURT; } protected SoundEvent getDeathSound() { return this.isSmallSlime() ? SoundEvents.ENTITY_MAGMA_CUBE_DEATH_SMALL : SoundEvents.ENTITY_MAGMA_CUBE_DEATH; } protected SoundEvent getSquishSound() { return this.isSmallSlime() ? SoundEvents.ENTITY_MAGMA_CUBE_SQUISH_SMALL : SoundEvents.ENTITY_MAGMA_CUBE_SQUISH; } protected SoundEvent getJumpSound() { return SoundEvents.ENTITY_MAGMA_CUBE_JUMP; } } Here is my Entity Code, And nothing is wrong with my spawnegg either, I changed it from my mod entity to a regular slime and it worked fine I'm just a little confused and looking at what other mod creators have done with 1.16 entities is a little bit hard since all of them are incredibly more proficient at modding than me. Quote
tal124 Posted March 16, 2021 Author Posted March 16, 2021 public chocolate() { ModFluids.init(); ModBlocks.init(); ModItems.init(); ModEntities.init(); MinecraftForge.EVENT_BUS.addListener(EventPriority.HIGH, OreGeneration::generateOres); MinecraftForge.EVENT_BUS.addListener(EventPriority.HIGH, FluidGeneration::generateFluids); // Register the setup method for modloading FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup); // Register the enqueueIMC method for modloading FMLJavaModLoadingContext.get().getModEventBus().addListener(this::enqueueIMC); // Register the processIMC method for modloading FMLJavaModLoadingContext.get().getModEventBus().addListener(this::processIMC); // Register the doClientStuff method for modloading FMLJavaModLoadingContext.get().getModEventBus().addListener(this::doClientStuff); // Register ourselves for server and other game events we are interested in MinecraftForge.EVENT_BUS.register(this); } Right here Quote
tal124 Posted March 16, 2021 Author Posted March 16, 2021 I am getting the MCP entity class missing world constructor for some reason and no matter what I do, I can't get it to go away, even straight ripping off the Magma slime entity won't get rid of it. Quote
tal124 Posted March 16, 2021 Author Posted March 16, 2021 The game runs fine, but the Entities just won't exist and no matter how much I look into other mods and adjust my code test it, and then reset it back to where I want it. Quote
tal124 Posted March 16, 2021 Author Posted March 16, 2021 I have all of my current code here https://github.com/Tyrannys/Chocolate, if that's what you mean? I'm relatively new to modding only started a couple weeks ago. Quote
tal124 Posted March 16, 2021 Author Posted March 16, 2021 (edited) 3 minutes ago, diesieben07 said: The code you posted does not even compile. After commenting out the data generator code that didn't compile, the game crashes with a null pointer exception in your registration code. I may have committed the wrong code as I just put it into github a couple of hours ago to organize the mod a bit, Try my test branch and see if that works better, I just committed to it what I currently have. Edited March 16, 2021 by tal124 Quote
tal124 Posted March 16, 2021 Author Posted March 16, 2021 Its not letting me commit for some reason, I'll fix it and then let you know when it commits Quote
tal124 Posted March 16, 2021 Author Posted March 16, 2021 I made a new commit and switched the other one to private https://github.com/Tyrannys/Chocolate-Mod, don't know why it wouldn't let me push a commit Quote
tal124 Posted March 16, 2021 Author Posted March 16, 2021 There were a lot of changes that I made when adding new blocks, apparently they didn't stick. I'll change it to where I had it. give me a few minutes Quote
tal124 Posted March 16, 2021 Author Posted March 16, 2021 Alright I made the changes and now the code should work just fine. I'm not sure why it reset it back to 2 hours ago. Quote
tal124 Posted March 16, 2021 Author Posted March 16, 2021 So what code should I use instead? I know you probably want me to figure this out on my own, but I've been looking at this code for almost a week now while working on other parts of the mod as well. Quote
tal124 Posted March 16, 2021 Author Posted March 16, 2021 public static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, chocolate.MODID); public static final RegistryObject<Block> CHOCOLATE_ORE = BLOCKS.register("chocolate_ore", () -> new Block(AbstractBlock.Properties.create(Material.ROCK).hardnessAndResistance(3.0F, 3.0F) .sound(SoundType.STONE).harvestLevel(1).harvestTool(ToolType.PICKAXE)) ); This is how I register them, public static final DeferredRegister<EntityType<?>> ENTITIES = DeferredRegister.create(ForgeRegistries.ENTITIES, chocolate.MODID); public static final EntityType<EntityChocolateSlime> CHOCOLATE_SLIME = ENTITIES.register("chocolate_slime", ()-> /*right here*/ ); Its simple with the blocks as you can define a new Block(properties), but new EntityType<> doesn't work the right way either, is there something im missing? Quote
tal124 Posted March 16, 2021 Author Posted March 16, 2021 Its telling me It has private access and I'm not sure how to get around that yet. Quote
tal124 Posted March 16, 2021 Author Posted March 16, 2021 4 minutes ago, diesieben07 said: You already created an EntityType in your previous code. Then I suppose im still a little confused, I've typed it out a few different ways and it always comes back with an error public static EntityType<EntityChocolateSlime> CHOCOLATE_SLIME = ENTITIES.register("chocolate_slime", ()-> new EntityType.Builder(EntityChocolateSlime::new, EntityClassification.MONSTER).size(2.04F,2.04F).trackingRange(8)); This is what I keep coming back to though, however EntityType.Builder errors out. Quote
tal124 Posted March 16, 2021 Author Posted March 16, 2021 public static final EntityType<EntityChocolateSlime> CHOCOLATE_SLIME = ENTITIES.register(EntityNames.CHOCOLATE_SLIME,()-> EntityChocolateSlime::new, EntityClassification.MONSTER, 2.04F, 2.04F); Like this? Quote
DietmarKracht Posted March 16, 2021 Posted March 16, 2021 I think what you are missing is the actual function to build your entity type. Just add .build() and it should be fine. Also dont use static initializers as @diesieben07 already said. Use RegistryObjects instead. 4 hours ago, tal124 said: Then I suppose im still a little confused, I've typed it out a few different ways and it always comes back with an error public static EntityType<EntityChocolateSlime> CHOCOLATE_SLIME = ENTITIES.register("chocolate_slime", ()-> new EntityType.Builder(EntityChocolateSlime::new, EntityClassification.MONSTER).size(2.04F,2.04F).trackingRange(8)); This is what I keep coming back to though, however EntityType.Builder errors out. Here is an example of how i register entity types: public static RegistryObject<EntityType<EntityItemUpgradable>> ENTITY_UPGRADABLE = ALL.register("upgradable_type", () -> EntityType.Builder.<EntityItemUpgradable>create(EntityItemUpgradable::new, EntityClassification.MISC) .build(new ResourceLocation(Main.MODID, "upgradable_type").toString())); Quote
tal124 Posted March 16, 2021 Author Posted March 16, 2021 (edited) 3 hours ago, DietmarKracht said: I think what you are missing is the actual function to build your entity type. Just add .build() and it should be fine. Also dont use static initializers as @diesieben07 already said. Use RegistryObjects instead. Here is an example of how i register entity types: public static RegistryObject<EntityType<EntityItemUpgradable>> ENTITY_UPGRADABLE = ALL.register("upgradable_type", () -> EntityType.Builder.<EntityItemUpgradable>create(EntityItemUpgradable::new, EntityClassification.MISC) .build(new ResourceLocation(Main.MODID, "upgradable_type").toString())); Thank you for the sample but now its simply saying my registry object isn't present, the code pushes out, but it says NullPointerException: Registry Object not present: chocolate:chocolate_slime Edited March 16, 2021 by tal124 Quote
DietmarKracht Posted March 16, 2021 Posted March 16, 2021 You need to paste your stacktrace when you get NPEs. The NPE might be due to calling the entity type before it was registered. Quote
tal124 Posted March 16, 2021 Author Posted March 16, 2021 ---- Minecraft Crash Report ---- // Shall we play a game? Time: 3/16/21 3:30 PM Description: Mod loading error has occurred java.lang.Exception: Mod Loading has failed at net.minecraftforge.fml.CrashReportExtender.dumpModLoadingCrashReport(CrashReportExtender.java:85) ~[forge-1.16.5-36.0.48_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading} at net.minecraftforge.fml.client.ClientModLoader.completeModLoading(ClientModLoader.java:188) ~[forge-1.16.5-36.0.48_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.lambda$null$1(Minecraft.java:513) ~[forge-1.16.5-36.0.48_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.util.Util.acceptOrElse(Util.java:323) ~[forge-1.16.5-36.0.48_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading} at net.minecraft.client.Minecraft.lambda$new$2(Minecraft.java:509) ~[forge-1.16.5-36.0.48_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.gui.ResourceLoadProgressGui.render(ResourceLoadProgressGui.java:113) ~[forge-1.16.5-36.0.48_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.renderer.GameRenderer.updateCameraAndRender(GameRenderer.java:493) ~[forge-1.16.5-36.0.48_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1002) ~[forge-1.16.5-36.0.48_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.run(Minecraft.java:612) ~[forge-1.16.5-36.0.48_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.main.Main.main(Main.java:184) ~[forge-1.16.5-36.0.48_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_282] {} at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_282] {} at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_282] {} at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_282] {} at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:52) ~[forge-1.16.5-36.0.48_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.0.9.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.0.9.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.0.9.jar:?] {} at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [modlauncher-8.0.9.jar:?] {} at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [modlauncher-8.0.9.jar:?] {} at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:105) [forge-1.16.5-36.0.48_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {} A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Thread: Render thread Stacktrace: at java.util.Objects.requireNonNull(Objects.java:290) ~[?:1.8.0_282] {} -- MOD chocolate -- Details: Caused by 0: java.lang.ExceptionInInitializerError at tyrannus.chocolate.setup.ModBlocks.register(ModBlocks.java:102) ~[?:?] {re:classloading} at tyrannus.chocolate.setup.ModBlocks.register(ModBlocks.java:95) ~[?:?] {re:classloading} at tyrannus.chocolate.setup.ModBlocks.<clinit>(ModBlocks.java:77) ~[?:?] {re:classloading} at tyrannus.chocolate.chocolate.<init>(chocolate.java:42) ~[?:?] {re:classloading} at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_282] {} at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_282] {} at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_282] {} at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_282] {} at java.lang.Class.newInstance(Class.java:442) ~[?:1.8.0_282] {} at net.minecraftforge.fml.javafmlmod.FMLModContainer.constructMod(FMLModContainer.java:81) ~[forge:36.0] {re:classloading} at net.minecraftforge.fml.ModContainer.lambda$buildTransitionHandler$4(ModContainer.java:120) ~[forge:?] {re:classloading} at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1640) ~[?:1.8.0_282] {} at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1632) ~[?:1.8.0_282] {} at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) ~[?:1.8.0_282] {} at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) ~[?:1.8.0_282] {} at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) ~[?:1.8.0_282] {} at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:175) ~[?:1.8.0_282] {} Mod File: main Failure message: Chocolate (chocolate) has failed to load correctly java.lang.ExceptionInInitializerError: null Mod Version: NONE Mod Issue URL: NOT PROVIDED Exception message: java.lang.NullPointerException: Registry Object not present: chocolate:chocolate_slime Stacktrace: at java.util.Objects.requireNonNull(Objects.java:290) ~[?:1.8.0_282] {} at net.minecraftforge.fml.RegistryObject.get(RegistryObject.java:120) ~[forge:?] {re:classloading} at tyrannus.chocolate.setup.ModItems.<clinit>(ModItems.java:106) ~[?:?] {re:classloading} at tyrannus.chocolate.setup.ModBlocks.register(ModBlocks.java:102) ~[?:?] {re:classloading} at tyrannus.chocolate.setup.ModBlocks.register(ModBlocks.java:95) ~[?:?] {re:classloading} at tyrannus.chocolate.setup.ModBlocks.<clinit>(ModBlocks.java:77) ~[?:?] {re:classloading} at tyrannus.chocolate.chocolate.<init>(chocolate.java:42) ~[?:?] {re:classloading} at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_282] {} at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_282] {} at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_282] {} at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_282] {} at java.lang.Class.newInstance(Class.java:442) ~[?:1.8.0_282] {} at net.minecraftforge.fml.javafmlmod.FMLModContainer.constructMod(FMLModContainer.java:81) ~[forge:36.0] {re:classloading} at net.minecraftforge.fml.ModContainer.lambda$buildTransitionHandler$4(ModContainer.java:120) ~[forge:?] {re:classloading} at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1640) ~[?:1.8.0_282] {} at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1632) ~[?:1.8.0_282] {} at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) ~[?:1.8.0_282] {} at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) ~[?:1.8.0_282] {} at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) ~[?:1.8.0_282] {} at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:175) ~[?:1.8.0_282] {} -- System Details -- Details: Minecraft Version: 1.16.5 Minecraft Version ID: 1.16.5 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_282, Amazon.com Inc. Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Amazon.com Inc. Memory: 1666800792 bytes (1589 MB) / 3224371200 bytes (3075 MB) up to 7618953216 bytes (7266 MB) CPUs: 24 JVM Flags: 1 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump ModLauncher: 8.0.9+86+master.3cf110c ModLauncher launch target: fmluserdevclient ModLauncher naming: mcp ModLauncher services: /mixin-0.8.2.jar mixin PLUGINSERVICE /eventbus-4.0.0.jar eventbus PLUGINSERVICE /forge-1.16.5-36.0.48_mapped_snapshot_20210309-1.16.5-launcher.jar object_holder_definalize PLUGINSERVICE /forge-1.16.5-36.0.48_mapped_snapshot_20210309-1.16.5-launcher.jar runtime_enum_extender PLUGINSERVICE /accesstransformers-3.0.1.jar accesstransformer PLUGINSERVICE /forge-1.16.5-36.0.48_mapped_snapshot_20210309-1.16.5-launcher.jar capability_inject_definalize PLUGINSERVICE /forge-1.16.5-36.0.48_mapped_snapshot_20210309-1.16.5-launcher.jar runtimedistcleaner PLUGINSERVICE /mixin-0.8.2.jar mixin TRANSFORMATIONSERVICE /forge-1.16.5-36.0.48_mapped_snapshot_20210309-1.16.5-launcher.jar fml TRANSFORMATIONSERVICE FML: 36.0 Forge: net.minecraftforge:36.0.48 FML Language Providers: javafml@36.0 minecraft@1 Mod List: client-extra.jar |Minecraft |minecraft |1.16.5 |CREATE_REG|a1:d4:5e:04:4f:d3:d6:e0:7b:37:97:cf:77:b0:de:ad:4a:47:ce:8c:96:49:5f:0a:cf:8c:ae:b2:6d:4b:8a:3f forge-1.16.5-36.0.48_mapped_snapshot_20210309-1.16|Forge |forge |36.0.48 |CREATE_REG|NOSIGNATURE main |Chocolate |chocolate |NONE |ERROR |NOSIGNATURE Crash Report UUID: 4fa0efb2-03a8-4530-857c-52cd156f3c41 Quote
DietmarKracht Posted March 16, 2021 Posted March 16, 2021 So the problem is inside your chocolate.java class you register the items including spawn eggs for the entities before the entities are registered. swap both inits and you should be good Quote
tal124 Posted March 16, 2021 Author Posted March 16, 2021 I swapped them and got this again ---- Minecraft Crash Report ---- // Shall we play a game? Time: 3/16/21 4:14 PM Description: Mod loading error has occurred java.lang.Exception: Mod Loading has failed at net.minecraftforge.fml.CrashReportExtender.dumpModLoadingCrashReport(CrashReportExtender.java:85) ~[forge-1.16.5-36.0.48_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading} at net.minecraftforge.fml.client.ClientModLoader.completeModLoading(ClientModLoader.java:188) ~[forge-1.16.5-36.0.48_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.lambda$null$1(Minecraft.java:513) ~[forge-1.16.5-36.0.48_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.util.Util.acceptOrElse(Util.java:323) ~[forge-1.16.5-36.0.48_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading} at net.minecraft.client.Minecraft.lambda$new$2(Minecraft.java:509) ~[forge-1.16.5-36.0.48_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.gui.ResourceLoadProgressGui.render(ResourceLoadProgressGui.java:113) ~[forge-1.16.5-36.0.48_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.renderer.GameRenderer.updateCameraAndRender(GameRenderer.java:493) ~[forge-1.16.5-36.0.48_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1002) ~[forge-1.16.5-36.0.48_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.run(Minecraft.java:612) ~[forge-1.16.5-36.0.48_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.main.Main.main(Main.java:184) ~[forge-1.16.5-36.0.48_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_282] {} at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_282] {} at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_282] {} at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_282] {} at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:52) ~[forge-1.16.5-36.0.48_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.0.9.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.0.9.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.0.9.jar:?] {} at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [modlauncher-8.0.9.jar:?] {} at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [modlauncher-8.0.9.jar:?] {} at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:105) [forge-1.16.5-36.0.48_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {} A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Thread: Render thread Stacktrace: at java.util.Objects.requireNonNull(Objects.java:290) ~[?:1.8.0_282] {} -- MOD chocolate -- Details: Caused by 0: java.lang.ExceptionInInitializerError at tyrannus.chocolate.setup.ModBlocks.register(ModBlocks.java:102) ~[?:?] {re:classloading} at tyrannus.chocolate.setup.ModBlocks.register(ModBlocks.java:95) ~[?:?] {re:classloading} at tyrannus.chocolate.setup.ModBlocks.<clinit>(ModBlocks.java:77) ~[?:?] {re:classloading} at tyrannus.chocolate.chocolate.<init>(chocolate.java:42) ~[?:?] {re:classloading} at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_282] {} at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_282] {} at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_282] {} at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_282] {} at java.lang.Class.newInstance(Class.java:442) ~[?:1.8.0_282] {} at net.minecraftforge.fml.javafmlmod.FMLModContainer.constructMod(FMLModContainer.java:81) ~[forge:36.0] {re:classloading} at net.minecraftforge.fml.ModContainer.lambda$buildTransitionHandler$4(ModContainer.java:120) ~[forge:?] {re:classloading} at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1640) ~[?:1.8.0_282] {} at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1632) ~[?:1.8.0_282] {} at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) ~[?:1.8.0_282] {} at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) ~[?:1.8.0_282] {} at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) ~[?:1.8.0_282] {} at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:175) ~[?:1.8.0_282] {} Mod File: main Failure message: Chocolate (chocolate) has failed to load correctly java.lang.ExceptionInInitializerError: null Mod Version: NONE Mod Issue URL: NOT PROVIDED Exception message: java.lang.NullPointerException: Registry Object not present: chocolate:chocolate_slime Stacktrace: at java.util.Objects.requireNonNull(Objects.java:290) ~[?:1.8.0_282] {} at net.minecraftforge.fml.RegistryObject.get(RegistryObject.java:120) ~[forge:?] {re:classloading} at tyrannus.chocolate.setup.ModItems.<clinit>(ModItems.java:106) ~[?:?] {re:classloading} at tyrannus.chocolate.setup.ModBlocks.register(ModBlocks.java:102) ~[?:?] {re:classloading} at tyrannus.chocolate.setup.ModBlocks.register(ModBlocks.java:95) ~[?:?] {re:classloading} at tyrannus.chocolate.setup.ModBlocks.<clinit>(ModBlocks.java:77) ~[?:?] {re:classloading} at tyrannus.chocolate.chocolate.<init>(chocolate.java:42) ~[?:?] {re:classloading} at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_282] {} at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_282] {} at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_282] {} at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_282] {} at java.lang.Class.newInstance(Class.java:442) ~[?:1.8.0_282] {} at net.minecraftforge.fml.javafmlmod.FMLModContainer.constructMod(FMLModContainer.java:81) ~[forge:36.0] {re:classloading} at net.minecraftforge.fml.ModContainer.lambda$buildTransitionHandler$4(ModContainer.java:120) ~[forge:?] {re:classloading} at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1640) ~[?:1.8.0_282] {} at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1632) ~[?:1.8.0_282] {} at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) ~[?:1.8.0_282] {} at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) ~[?:1.8.0_282] {} at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) ~[?:1.8.0_282] {} at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:175) ~[?:1.8.0_282] {} -- System Details -- Details: Minecraft Version: 1.16.5 Minecraft Version ID: 1.16.5 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_282, Amazon.com Inc. Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Amazon.com Inc. Memory: 2733412320 bytes (2606 MB) / 3161456640 bytes (3015 MB) up to 7618953216 bytes (7266 MB) CPUs: 24 JVM Flags: 1 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump ModLauncher: 8.0.9+86+master.3cf110c ModLauncher launch target: fmluserdevclient ModLauncher naming: mcp ModLauncher services: /mixin-0.8.2.jar mixin PLUGINSERVICE /eventbus-4.0.0.jar eventbus PLUGINSERVICE /forge-1.16.5-36.0.48_mapped_snapshot_20210309-1.16.5-launcher.jar object_holder_definalize PLUGINSERVICE /forge-1.16.5-36.0.48_mapped_snapshot_20210309-1.16.5-launcher.jar runtime_enum_extender PLUGINSERVICE /accesstransformers-3.0.1.jar accesstransformer PLUGINSERVICE /forge-1.16.5-36.0.48_mapped_snapshot_20210309-1.16.5-launcher.jar capability_inject_definalize PLUGINSERVICE /forge-1.16.5-36.0.48_mapped_snapshot_20210309-1.16.5-launcher.jar runtimedistcleaner PLUGINSERVICE /mixin-0.8.2.jar mixin TRANSFORMATIONSERVICE /forge-1.16.5-36.0.48_mapped_snapshot_20210309-1.16.5-launcher.jar fml TRANSFORMATIONSERVICE FML: 36.0 Forge: net.minecraftforge:36.0.48 FML Language Providers: javafml@36.0 minecraft@1 Mod List: client-extra.jar |Minecraft |minecraft |1.16.5 |CREATE_REG|a1:d4:5e:04:4f:d3:d6:e0:7b:37:97:cf:77:b0:de:ad:4a:47:ce:8c:96:49:5f:0a:cf:8c:ae:b2:6d:4b:8a:3f forge-1.16.5-36.0.48_mapped_snapshot_20210309-1.16|Forge |forge |36.0.48 |CREATE_REG|NOSIGNATURE main |Chocolate |chocolate |NONE |ERROR |NOSIGNATURE Crash Report UUID: dc6a8c1b-2ae6-49b9-b271-ed348743358a Quote
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.