Jump to content

Recommended Posts

Posted

So I had an error when i was trying to add a block to the game, Here is the error message:

[m[36m[10:06:34] [Render thread/DEBUG] [ne.mi.re.ObjectHolderRegistry/REGISTRIES]: Processing ObjectHolder annotations
[m[36m[10:06:34] [Render thread/DEBUG] [ne.mi.re.ObjectHolderRegistry/REGISTRIES]: Found 2951 ObjectHolder annotations
[m[36m[10:06:34] [Render thread/DEBUG] [ne.mi.fm.ModList/LOADING]: Dispatching synchronous event LifecycleEvent:LOAD_REGISTRIES
[m[36m[10:06:34] [Render thread/DEBUG] [ne.mi.fm.ja.FMLModContainer/LOADING]: Firing event for modid forge : RegistryEvent.Register<minecraft:block>
[m[36m[10:06:34] [Render thread/DEBUG] [ne.mi.fm.ja.FMLModContainer/LOADING]: Fired event for modid forge : RegistryEvent.Register<minecraft:block>
[m[36m[10:06:34] [Render thread/DEBUG] [ne.mi.fm.ja.FMLModContainer/LOADING]: Firing event for modid tutorialmod : RegistryEvent.Register<minecraft:block>
[m[36m[10:06:34] [Render thread/DEBUG] [ne.mi.fm.ja.FMLModContainer/LOADING]: Fired event for modid tutorialmod : RegistryEvent.Register<minecraft:block>
[m[36m[10:06:34] [Render thread/DEBUG] [ne.mi.re.GameData/REGISTRIES]: Applying holder lookups: minecraft:block
[m[36m[10:06:34] [Render thread/DEBUG] [ne.mi.re.GameData/REGISTRIES]: Holder lookups applied: minecraft:block
[m[36m[10:06:34] [Render thread/DEBUG] [ne.mi.fm.ModList/LOADING]: Dispatching synchronous event LifecycleEvent:LOAD_REGISTRIES
[m[36m[10:06:34] [Render thread/DEBUG] [ne.mi.fm.ja.FMLModContainer/LOADING]: Firing event for modid forge : RegistryEvent.Register<minecraft:item>
[m[36m[10:06:34] [Render thread/DEBUG] [ne.mi.fm.ja.FMLModContainer/LOADING]: Fired event for modid forge : RegistryEvent.Register<minecraft:item>
[m[36m[10:06:34] [Render thread/DEBUG] [ne.mi.fm.ja.FMLModContainer/LOADING]: Firing event for modid tutorialmod : RegistryEvent.Register<minecraft:item>
[m[1;31m[10:06:34] [Render thread/ERROR] [ne.mi.fm.ja.FMLModContainer/]: Exception caught during firing event: Can't use a null-name for the registry, object air.
    Index: 2
    Listeners:
        0: NORMAL
        1: ASM: class com.MrGreenyboy.TutorialMod.init.BlockInit registerBlock(Lnet/minecraftforge/event/RegistryEvent$Register;)V
        2: ASM: class com.MrGreenyboy.TutorialMod.init.BlockInit registerBlockItems(Lnet/minecraftforge/event/RegistryEvent$Register;)V
        3: ASM: class com.MrGreenyboy.TutorialMod.init.ItemInit registerItems(Lnet/minecraftforge/event/RegistryEvent$Register;)V
java.lang.NullPointerException: Can't use a null-name for the registry, object air.
    at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:864)
    at net.minecraftforge.registries.ForgeRegistry.add(ForgeRegistry.java:314)
    at net.minecraftforge.registries.ForgeRegistry.add(ForgeRegistry.java:308)
    at net.minecraftforge.registries.ForgeRegistry.register(ForgeRegistry.java:133)
    at com.MrGreenyboy.TutorialMod.init.BlockInit.registerBlockItems(BlockInit.java:27)
    at net.minecraftforge.eventbus.ASMEventHandler_15_BlockInit_registerBlockItems_Register.invoke(.dynamic)
    at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:80)
    at net.minecraftforge.eventbus.EventBus.post(EventBus.java:258)
    at net.minecraftforge.fml.javafmlmod.FMLModContainer.fireEvent(FMLModContainer.java:106)
    at java.util.function.Consumer.lambda$andThen$0(Unknown Source)
    at java.util.function.Consumer.lambda$andThen$0(Unknown Source)
    at net.minecraftforge.fml.ModContainer.transitionState(ModContainer.java:112)
    at net.minecraftforge.fml.ModList.lambda$dispatchSynchronousEvent$5(ModList.java:126)
    at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source)
    at java.util.stream.ReferencePipeline$Head.forEach(Unknown Source)
    at net.minecraftforge.fml.ModList.dispatchSynchronousEvent(ModList.java:126)
    at net.minecraftforge.fml.ModList.lambda$static$1(ModList.java:96)
    at net.minecraftforge.fml.LifecycleEventProvider.dispatch(LifecycleEventProvider.java:71)
    at net.minecraftforge.fml.ModLoader.dispatchAndHandleError(ModLoader.java:214)
    at net.minecraftforge.fml.ModLoader.lambda$gatherAndInitializeMods$25(ModLoader.java:206)
    at net.minecraftforge.registries.GameData.fireRegistryEvents(GameData.java:868)
    at net.minecraftforge.fml.ModLoader.gatherAndInitializeMods(ModLoader.java:206)
    at net.minecraftforge.fml.client.ClientModLoader.lambda$begin$2(ClientModLoader.java:93)
    at net.minecraftforge.fml.client.ClientModLoader.lambda$createRunnableWithCatch$5(ClientModLoader.java:109)
    at net.minecraftforge.fml.client.ClientModLoader.begin(ClientModLoader.java:93)
    at net.minecraft.client.Minecraft.<init>(Minecraft.java:425)
    at net.minecraft.client.main.Main.main(Main.java:149)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:55)
    at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37)
    at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54)
    at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72)
    at cpw.mods.modlauncher.Launcher.run(Launcher.java:81)
    at cpw.mods.modlauncher.Launcher.main(Launcher.java:65)
    at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:105)

[m[1;31m[10:06:34] [Render thread/ERROR] [ne.mi.fm.ja.FMLModContainer/LOADING]: Caught exception during event RegistryEvent.Register<minecraft:item> dispatch for modid tutorialmod
java.lang.NullPointerException: Can't use a null-name for the registry, object air.
    at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:864) ~[guava-21.0.jar:?] {}
    at net.minecraftforge.registries.ForgeRegistry.add(ForgeRegistry.java:314) ~[forge-1.16.1-32.0.75_mapped_snapshot_20200514-1.16.jar:?] {re:classloading}
    at net.minecraftforge.registries.ForgeRegistry.add(ForgeRegistry.java:308) ~[forge-1.16.1-32.0.75_mapped_snapshot_20200514-1.16.jar:?] {re:classloading}
    at net.minecraftforge.registries.ForgeRegistry.register(ForgeRegistry.java:133) ~[forge-1.16.1-32.0.75_mapped_snapshot_20200514-1.16.jar:?] {re:classloading}
    at com.MrGreenyboy.TutorialMod.init.BlockInit.registerBlockItems(BlockInit.java:27) ~[main/:?] {re:classloading,pl:object_holder_definalize:A}
    at net.minecraftforge.eventbus.ASMEventHandler_15_BlockInit_registerBlockItems_Register.invoke(.dynamic) ~[?:?] {}
    at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:80) ~[eventbus-2.2.0-service.jar:?] {}
    at net.minecraftforge.eventbus.EventBus.post(EventBus.java:258) ~[eventbus-2.2.0-service.jar:?] {}
    at net.minecraftforge.fml.javafmlmod.FMLModContainer.fireEvent(FMLModContainer.java:106) ~[forge-1.16.1-32.0.75_mapped_snapshot_20200514-1.16.jar:32.0] {re:classloading}
    at java.util.function.Consumer.lambda$andThen$0(Unknown Source) ~[?:1.8.0_251] {}
    at java.util.function.Consumer.lambda$andThen$0(Unknown Source) ~[?:1.8.0_251] {}
    at net.minecraftforge.fml.ModContainer.transitionState(ModContainer.java:112) ~[forge-1.16.1-32.0.75_mapped_snapshot_20200514-1.16.jar:?] {re:classloading}
    at net.minecraftforge.fml.ModList.lambda$dispatchSynchronousEvent$5(ModList.java:126) ~[forge-1.16.1-32.0.75_mapped_snapshot_20200514-1.16.jar:?] {re:classloading}
    at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source) ~[?:1.8.0_251] {}
    at java.util.stream.ReferencePipeline$Head.forEach(Unknown Source) ~[?:1.8.0_251] {}
    at net.minecraftforge.fml.ModList.dispatchSynchronousEvent(ModList.java:126) ~[forge-1.16.1-32.0.75_mapped_snapshot_20200514-1.16.jar:?] {re:classloading}
    at net.minecraftforge.fml.ModList.lambda$static$1(ModList.java:96) ~[forge-1.16.1-32.0.75_mapped_snapshot_20200514-1.16.jar:?] {re:classloading}
    at net.minecraftforge.fml.LifecycleEventProvider.dispatch(LifecycleEventProvider.java:71) ~[forge-1.16.1-32.0.75_mapped_snapshot_20200514-1.16.jar:?] {re:classloading}
    at net.minecraftforge.fml.ModLoader.dispatchAndHandleError(ModLoader.java:214) ~[forge-1.16.1-32.0.75_mapped_snapshot_20200514-1.16.jar:?] {re:classloading}
    at net.minecraftforge.fml.ModLoader.lambda$gatherAndInitializeMods$25(ModLoader.java:206) ~[forge-1.16.1-32.0.75_mapped_snapshot_20200514-1.16.jar:?] {re:classloading}
    at net.minecraftforge.registries.GameData.fireRegistryEvents(GameData.java:868) ~[forge-1.16.1-32.0.75_mapped_snapshot_20200514-1.16.jar:?] {re:classloading}
    at net.minecraftforge.fml.ModLoader.gatherAndInitializeMods(ModLoader.java:206) ~[forge-1.16.1-32.0.75_mapped_snapshot_20200514-1.16.jar:?] {re:classloading}
    at net.minecraftforge.fml.client.ClientModLoader.lambda$begin$2(ClientModLoader.java:93) ~[forge-1.16.1-32.0.75_mapped_snapshot_20200514-1.16.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraftforge.fml.client.ClientModLoader.lambda$createRunnableWithCatch$5(ClientModLoader.java:109) ~[forge-1.16.1-32.0.75_mapped_snapshot_20200514-1.16.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraftforge.fml.client.ClientModLoader.begin(ClientModLoader.java:93) ~[forge-1.16.1-32.0.75_mapped_snapshot_20200514-1.16.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraft.client.Minecraft.<init>(Minecraft.java:425) ~[forge-1.16.1-32.0.75_mapped_snapshot_20200514-1.16.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.client.main.Main.main(Main.java:149) ~[forge-1.16.1-32.0.75_mapped_snapshot_20200514-1.16.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_251] {}
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_251] {}
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_251] {}
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_251] {}
    at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:55) ~[forge-1.16.1-32.0.75_mapped_snapshot_20200514-1.16.jar:?] {}
    at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-5.1.2.jar:?] {}
    at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-5.1.2.jar:?] {}
    at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-5.1.2.jar:?] {}
    at cpw.mods.modlauncher.Launcher.run(Launcher.java:81) [modlauncher-5.1.2.jar:?] {}
    at cpw.mods.modlauncher.Launcher.main(Launcher.java:65) [modlauncher-5.1.2.jar:?] {}
    at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:105) [forge-1.16.1-32.0.75_mapped_snapshot_20200514-1.16.jar:?] {}
[m[1;31m[10:06:34] [Render thread/FATAL] [ne.mi.fm.ModLoader/LOADING]: Failed to complete lifecycle event LOAD_REGISTRIES, 1 errors found
[m[1;31m[10:06:34] [Render thread/FATAL] [ne.mi.ev.EventBus/EVENTBUS]: EventBus 0 shutting down - future events will not be posted.
java.lang.Exception: stacktrace
    at net.minecraftforge.eventbus.EventBus.shutdown(EventBus.java:278) ~[eventbus-2.2.0-service.jar:?] {}
    at net.minecraftforge.fml.client.ClientModLoader.lambda$createRunnableWithCatch$5(ClientModLoader.java:111) ~[forge-1.16.1-32.0.75_mapped_snapshot_20200514-1.16.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraftforge.fml.client.ClientModLoader.begin(ClientModLoader.java:93) ~[forge-1.16.1-32.0.75_mapped_snapshot_20200514-1.16.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraft.client.Minecraft.<init>(Minecraft.java:425) ~[forge-1.16.1-32.0.75_mapped_snapshot_20200514-1.16.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.client.main.Main.main(Main.java:149) ~[forge-1.16.1-32.0.75_mapped_snapshot_20200514-1.16.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_251] {}
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_251] {}
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_251] {}
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_251] {}
    at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:55) ~[forge-1.16.1-32.0.75_mapped_snapshot_20200514-1.16.jar:?] {}
    at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-5.1.2.jar:?] {}
    at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-5.1.2.jar:?] {}
    at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-5.1.2.jar:?] {}
    at cpw.mods.modlauncher.Launcher.run(Launcher.java:81) [modlauncher-5.1.2.jar:?] {}
    at cpw.mods.modlauncher.Launcher.main(Launcher.java:65) [modlauncher-5.1.2.jar:?] {}
    at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:105) [forge-1.16.1-32.0.75_mapped_snapshot_20200514-1.16.jar:?] {}
[m[36m[10:06:35] [Render thread/DEBUG] [ne.mi.fm.cl.ClientModLoader/CORE]: Generating PackInfo named mod:forge for mod file C:\Users\dangr\.gradle\caches\forge_gradle\minecraft_user_repo\net\minecraftforge\forge\1.16.1-32.0.75_mapped_snapshot_20200514-1.16\forge-1.16.1-32.0.75_mapped_snapshot_20200514-1.16.jar
[m[36m[10:06:35] [Render thread/DEBUG] [ne.mi.fm.cl.ClientModLoader/CORE]: Generating PackInfo named mod:tutorialmod for mod file C:\Users\dangr\Documents\Youtube\mods\TutorialMod1.16.1(2)\bin\main
[m[32m[10:06:38] [Render thread/INFO] [mojang/NarratorWindows]: Narrator library for x64 successfully loaded
[m[32m[10:06:38] [Render thread/INFO] [minecraft/SimpleReloadableResourceManager]: Reloading ResourceManager: Default, Mod Resources
[m[36m[10:06:38] [Worker-Main-4/DEBUG] [ne.mi.fm.co.ConfigTracker/CONFIG]: Loading configs type CLIENT
[m[36m[10:06:38] [Worker-Main-4/DEBUG] [ne.mi.fm.co.ConfigFileTypeHandler/CONFIG]: Built TOML config for C:\Users\dangr\Documents\Youtube\mods\TutorialMod1.16.1(2)\run\config\forge-client.toml
[m[36m[10:06:38] [Worker-Main-4/DEBUG] [ne.mi.fm.co.ConfigFileTypeHandler/CONFIG]: Loaded TOML config file C:\Users\dangr\Documents\Youtube\mods\TutorialMod1.16.1(2)\run\config\forge-client.toml
[m[36m[10:06:38] [Worker-Main-4/DEBUG] [ne.mi.fm.co.ConfigFileTypeHandler/CONFIG]: Watching TOML config file C:\Users\dangr\Documents\Youtube\mods\TutorialMod1.16.1(2)\run\config\forge-client.toml for changes
[m[36m[10:06:38] [Worker-Main-4/DEBUG] [ne.mi.co.ForgeConfig/FORGEMOD]: Loaded forge config file forge-client.toml
[m[36m[10:06:38] [Worker-Main-4/DEBUG] [ne.mi.fm.co.ConfigTracker/CONFIG]: Loading configs type COMMON
[m[1;31m[10:06:38] [Worker-Main-4/ERROR] [ne.mi.fm.ModLoader/LOADING]: Skipping lifecycle event SETUP, 1 errors found.
[m[1;31m[10:06:38] [Worker-Main-4/FATAL] [ne.mi.fm.ModLoader/LOADING]: Failed to complete lifecycle event SETUP, 1 errors found
[m[1;31m[10:06:38] [Worker-Main-4/FATAL] [ne.mi.ev.EventBus/EVENTBUS]: EventBus 0 shutting down - future events will not be posted.
java.lang.Exception: stacktrace
    at net.minecraftforge.eventbus.EventBus.shutdown(EventBus.java:278) ~[eventbus-2.2.0-service.jar:?] {}
    at net.minecraftforge.fml.client.ClientModLoader.lambda$createRunnableWithCatch$5(ClientModLoader.java:111) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraftforge.fml.client.ClientModLoader.startModLoading(ClientModLoader.java:119) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraftforge.fml.client.ClientModLoader.lambda$onreload$3(ClientModLoader.java:101) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraftforge.fml.client.ClientModLoader.lambda$createRunnableWithCatch$5(ClientModLoader.java:109) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
    at java.util.concurrent.CompletableFuture$AsyncRun.run(Unknown Source) [?:1.8.0_251] {}
    at java.util.concurrent.CompletableFuture$AsyncRun.exec(Unknown Source) [?:1.8.0_251] {}
    at java.util.concurrent.ForkJoinTask.doExec(Unknown Source) [?:1.8.0_251] {}
    at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(Unknown Source) [?:1.8.0_251] {}
    at java.util.concurrent.ForkJoinPool.runWorker(Unknown Source) [?:1.8.0_251] {}
    at java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source) [?:1.8.0_251] {}
[m[33m[10:06:43] [Worker-Main-6/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'tutorialmod:blockstates/example_block.json' missing model for variant: 'tutorialmod:example_block#'
[m[33m[10:06:43] [Worker-Main-6/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'tutorialmod:blockstates/example_block.json' in resourcepack: 'Mod Resources': java.io.EOFException: End of input at line 4 column 2 path $.variants.
[m[1;31m[10:06:46] [Worker-Main-6/ERROR] [ne.mi.fm.ModLoader/LOADING]: Skipping lifecycle event ENQUEUE_IMC, 1 errors found.
[m[1;31m[10:06:46] [Worker-Main-6/FATAL] [ne.mi.fm.ModLoader/LOADING]: Failed to complete lifecycle event ENQUEUE_IMC, 1 errors found
[m[1;31m[10:06:46] [Worker-Main-6/FATAL] [ne.mi.ev.EventBus/EVENTBUS]: EventBus 0 shutting down - future events will not be posted.
java.lang.Exception: stacktrace
    at net.minecraftforge.eventbus.EventBus.shutdown(EventBus.java:278) ~[eventbus-2.2.0-service.jar:?] {}
    at net.minecraftforge.fml.client.ClientModLoader.lambda$createRunnableWithCatch$5(ClientModLoader.java:111) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraftforge.fml.client.ClientModLoader.finishModLoading(ClientModLoader.java:133) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraftforge.fml.client.ClientModLoader.lambda$onreload$4(ClientModLoader.java:103) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
    at java.util.concurrent.CompletableFuture.uniRun(Unknown Source) [?:1.8.0_251] {}
    at java.util.concurrent.CompletableFuture$UniRun.tryFire(Unknown Source) [?:1.8.0_251] {}
    at java.util.concurrent.CompletableFuture$Completion.exec(Unknown Source) [?:1.8.0_251] {}
    at java.util.concurrent.ForkJoinTask.doExec(Unknown Source) [?:1.8.0_251] {}
    at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(Unknown Source) [?:1.8.0_251] {}
    at java.util.concurrent.ForkJoinPool.runWorker(Unknown Source) [?:1.8.0_251] {}
    at java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source) [?:1.8.0_251] {}
[m[36m[10:06:47] [Render thread/DEBUG] [ne.mi.fm.ForgeI18n/CORE]: Loading I18N data entries: 5136
[m[32m[10:06:47] [Render thread/INFO] [minecraft/SoundSystem]: OpenAL initialized.
[m[32m[10:06:47] [Render thread/INFO] [minecraft/SoundEngine]: Sound engine started
[m[32m[10:06:47] [Render thread/INFO] [minecraft/AtlasTexture]: Created: 1024x512x4 minecraft:textures/atlas/blocks.png-atlas
[m[32m[10:06:47] [Render thread/INFO] [minecraft/AtlasTexture]: Created: 256x128x4 minecraft:textures/atlas/signs.png-atlas
[m[32m[10:06:47] [Render thread/INFO] [minecraft/AtlasTexture]: Created: 512x512x4 minecraft:textures/atlas/banner_patterns.png-atlas
[m[32m[10:06:47] [Render thread/INFO] [minecraft/AtlasTexture]: Created: 512x512x4 minecraft:textures/atlas/shield_patterns.png-atlas
[m[32m[10:06:47] [Render thread/INFO] [minecraft/AtlasTexture]: Created: 256x256x4 minecraft:textures/atlas/chest.png-atlas
[m[32m[10:06:48] [Render thread/INFO] [minecraft/AtlasTexture]: Created: 512x256x4 minecraft:textures/atlas/beds.png-atlas
[m[32m[10:06:48] [Render thread/INFO] [minecraft/AtlasTexture]: Created: 512x256x4 minecraft:textures/atlas/shulker_boxes.png-atlas
[m[32m[10:06:48] [Render thread/INFO] [minecraft/AtlasTexture]: Created: 256x256x0 minecraft:textures/atlas/particles.png-atlas
[m[32m[10:06:48] [Render thread/INFO] [minecraft/AtlasTexture]: Created: 256x256x0 minecraft:textures/atlas/paintings.png-atlas
[m[32m[10:06:48] [Render thread/INFO] [minecraft/AtlasTexture]: Created: 128x128x0 minecraft:textures/atlas/mob_effects.png-atlas
[m

Posted
4 minutes ago, diesieben07 said:

Show your code.

package com.MrGreenyboy.TutorialMod.init;

import net.minecraft.block.Block;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus;
import net.minecraftforge.registries.ObjectHolder;

@Mod.EventBusSubscriber(modid = "tutorialmod", bus = Bus.MOD)
@ObjectHolder("tutorialmod")
public class BlockInit {
    public static final Block example_block = null;
    
    @SubscribeEvent
    public static void registerBlock(final RegistryEvent.Register<Block> event) {
        event.getRegistry().register(new Block(Block.Properties.create(Material.IRON).sound(SoundType.SLIME)).setRegistryName("tutorialmod", "example_block"));
    }
    
    @SubscribeEvent
    public static void registerBlockItems(final RegistryEvent.Register<Item> event) {
        event.getRegistry().register(new BlockItem(example_block, new Item.Properties().maxStackSize(32).group(ItemGroup.BUILDING_BLOCKS)));
    }
}

 

Posted
4 minutes ago, diesieben07 said:

You did not set the registry name for your BlockItem.

I did this but setRegistryName is underlined in red, here is code:

 

package com.MrGreenyboy.TutorialMod.init;

import net.minecraft.block.Block;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus;
import net.minecraftforge.registries.ObjectHolder;

@Mod.EventBusSubscriber(modid = "tutorialmod", bus = Bus.MOD)
@ObjectHolder("tutorialmod")
public class BlockInit {
    public static final Block example_block = null;
    
    @SubscribeEvent
    public static void registerBlock(final RegistryEvent.Register<Block> event) {
        event.getRegistry().register(new Block(Block.Properties.create(Material.IRON).sound(SoundType.SLIME)).setRegistryName("tutorialmod", "example_block"));
    }
    
    @SubscribeEvent
    public static void registerBlockItems(final RegistryEvent.Register<Item> event) {
        event.getRegistry().register(new BlockItem(example_block, new Item.Properties().maxStackSize(32).group(ItemGroup.BUILDING_BLOCKS).setRegistryName("example_block")));
    }
}

 

Posted
3 minutes ago, MrGreenyboy said:

I did this but setRegistryName is underlined in red, here is code:

 

package com.MrGreenyboy.TutorialMod.init;

import net.minecraft.block.Block;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus;
import net.minecraftforge.registries.ObjectHolder;

@Mod.EventBusSubscriber(modid = "tutorialmod", bus = Bus.MOD)
@ObjectHolder("tutorialmod")
public class BlockInit {
    public static final Block example_block = null;
    
    @SubscribeEvent
    public static void registerBlock(final RegistryEvent.Register<Block> event) {
        event.getRegistry().register(new Block(Block.Properties.create(Material.IRON).sound(SoundType.SLIME)).setRegistryName("tutorialmod", "example_block"));
    }
    
    @SubscribeEvent
    public static void registerBlockItems(final RegistryEvent.Register<Item> event) {
        event.getRegistry().register(new BlockItem(example_block, new Item.Properties().maxStackSize(32).group(ItemGroup.BUILDING_BLOCKS).setRegistryName("example_block")));
    }
}

 

I moved setRegistryName and it doesn't appear to have errors i am going to try and run the game now

 

Posted
6 minutes ago, MrGreenyboy said:

I moved setRegistryName and it doesn't appear to have errors i am going to try and run the game now

 

Now when i enter the game it doesn't have a block model when i place it downspacer.png

Posted (edited)
9 minutes ago, MrGreenyboy said:

Now when i enter the game it doesn't have a block model when i place it down

Show your block's blockstate and model jsons file please. Anyway if you are using 1.16.1 registering things with DeferredRegister is (in my opinion) far simpler than using registry events, and probably less prone to errors like the one you encountered.

Edited by Beethoven92

Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port

Posted
2 minutes ago, Beethoven92 said:

Show your block's blockstate and model jsons file please

Here is the blockstates file:

{
    "variants":{
        "":{ "model": "tutorialmod:block/example_block"
}

 

Here is the models blocks file:

{
    "parent": "block/cube_all",
    "textures": {
        "all": "tutorialmod:blocks/example_block"
    }
}

 

Posted
2 minutes ago, poopoodice said:

one for the "variants" as well, consider download a json validator in your ide

Ok I will go and do that. Also I added the second bracket to the blockstate json and i still didn't see any texture. I found an error message but then the console pushed it so far back i can't see it

Posted
Just now, Beethoven92 said:

Post again your blockstate json

 

{
    "variants":{
        "":{ "model": "tutorialmod:block/example_block" }
}

 

also should it be blockstates or blockstate

Posted (edited)

It is still missing a closing bracket, you see? You are now closing the "" block correctly, but still the "variants" block misses its closing bracket. Suggestion, just count your brackets, there should never be an odd number of them.

 

Also the package name needs to be blockstates

Edited by Beethoven92

Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port

Posted

Here is an error i found

 

[m[32m[11:19:33] [Forge Version Check/INFO] [ne.mi.fm.VersionChecker/]: [forge] Found status: BETA_OUTDATED Current: 32.0.75 Target: 32.0.97
[m[32m[11:19:33] [Forge Version Check/INFO] [ne.mi.fm.VersionChecker/]: [tutorialmod] Starting version check at http://myurl.me/
[m[33m[11:19:33] [Forge Version Check/WARN] [ne.mi.fm.VersionChecker/]: Failed to process update information
java.io.IOException: Server returned HTTP response code: 400 for URL: http://myurl.me/
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_251] {}
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_251] {}
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_251] {}
    at java.lang.reflect.Constructor.newInstance(Unknown Source) ~[?:1.8.0_251] {}
    at sun.net.www.protocol.http.HttpURLConnection$10.run(Unknown Source) ~[?:1.8.0_251] {}
    at sun.net.www.protocol.http.HttpURLConnection$10.run(Unknown Source) ~[?:1.8.0_251] {}
    at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_251] {}
    at sun.net.www.protocol.http.HttpURLConnection.getChainedException(Unknown Source) ~[?:1.8.0_251] {}
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source) ~[?:1.8.0_251] {}
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source) ~[?:1.8.0_251] {}
    at net.minecraftforge.fml.VersionChecker$1.openUrlStream(VersionChecker.java:189) ~[?:?] {re:classloading}
    at net.minecraftforge.fml.VersionChecker$1.process(VersionChecker.java:206) ~[?:?] {re:classloading}
    at java.lang.Iterable.forEach(Unknown Source) [?:1.8.0_251] {}
    at net.minecraftforge.fml.VersionChecker$1.run(VersionChecker.java:157) [?:?] {re:classloading}
Caused by: java.io.IOException: Server returned HTTP response code: 400 for URL: http://myurl.me/
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source) ~[?:1.8.0_251] {}
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source) ~[?:1.8.0_251] {}
    at java.net.HttpURLConnection.getResponseCode(Unknown Source) ~[?:1.8.0_251] {}
    at net.minecr

Posted (edited)
7 minutes ago, Beethoven92 said:

It is still missing a closing bracket, you see? You are now closing the "" block correctly, but still the "variants" block misses its closing bracket. Suggestion, just count your brackets, there should never be an odd number of them.

 

Also the package name needs to be blockstates

I edited the blockstates json and put this:

{
  "variants": {
    "": {
      "model": "tutorialmod:block/example_block"
    }
  }
}

Edited by MrGreenyboy
Posted
2 minutes ago, MrGreenyboy said:

I edited the blockstates json and put this:

{
  "variants": {
    "": {
      "model": "tutorialmod:block/example_block"
    }
  }
}

It Works I now have a block model thanks for all who helped with the load_registries error and for all who helped with the texture error

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Version 1.19 - Forge 41.0.63 I want to create a wolf entity that I can ride, so far it seems to be working, but the problem is that when I get on the wolf, I can’t control it. I then discovered that the issue is that the server doesn’t detect that I’m riding the wolf, so I’m struggling with synchronization. However, it seems to not be working properly. As I understand it, the server receives the packet but doesn’t register it correctly. I’m a bit new to Java, and I’ll try to provide all the relevant code and prints *The comments and prints are translated by chatgpt since they were originally in Spanish* Thank you very much in advance No player is mounted, or the passenger is not a player. No player is mounted, or the passenger is not a player. No player is mounted, or the passenger is not a player. No player is mounted, or the passenger is not a player. No player is mounted, or the passenger is not a player. MountableWolfEntity package com.vals.valscraft.entity; import com.vals.valscraft.network.MountSyncPacket; import com.vals.valscraft.network.NetworkHandler; import net.minecraft.client.Minecraft; import net.minecraft.network.syncher.EntityDataAccessor; import net.minecraft.network.syncher.EntityDataSerializers; import net.minecraft.network.syncher.SynchedEntityData; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.Mob; import net.minecraft.world.entity.ai.attributes.AttributeSupplier; import net.minecraft.world.entity.ai.attributes.Attributes; import net.minecraft.world.entity.animal.Wolf; import net.minecraft.world.entity.player.Player; import net.minecraft.world.entity.Entity; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.level.Level; import net.minecraft.world.phys.Vec3; import net.minecraftforge.event.TickEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.network.PacketDistributor; public class MountableWolfEntity extends Wolf { private boolean hasSaddle; private static final EntityDataAccessor<Byte> DATA_ID_FLAGS = SynchedEntityData.defineId(MountableWolfEntity.class, EntityDataSerializers.BYTE); public MountableWolfEntity(EntityType<? extends Wolf> type, Level level) { super(type, level); this.hasSaddle = false; } @Override protected void defineSynchedData() { super.defineSynchedData(); this.entityData.define(DATA_ID_FLAGS, (byte)0); } public static AttributeSupplier.Builder createAttributes() { return Wolf.createAttributes() .add(Attributes.MAX_HEALTH, 20.0) .add(Attributes.MOVEMENT_SPEED, 0.3); } @Override public InteractionResult mobInteract(Player player, InteractionHand hand) { ItemStack itemstack = player.getItemInHand(hand); if (itemstack.getItem() == Items.SADDLE && !this.hasSaddle()) { if (!player.isCreative()) { itemstack.shrink(1); } this.setSaddle(true); return InteractionResult.SUCCESS; } else if (!level.isClientSide && this.hasSaddle()) { player.startRiding(this); MountSyncPacket packet = new MountSyncPacket(true); // 'true' means the player is mounted NetworkHandler.CHANNEL.sendToServer(packet); // Ensure the server handles the packet return InteractionResult.SUCCESS; } return InteractionResult.PASS; } @Override public void travel(Vec3 travelVector) { if (this.isVehicle() && this.getControllingPassenger() instanceof Player) { System.out.println("The wolf has a passenger."); System.out.println("The passenger is a player."); Player player = (Player) this.getControllingPassenger(); // Ensure the player is the controller this.setYRot(player.getYRot()); this.yRotO = this.getYRot(); this.setXRot(player.getXRot() * 0.5F); this.setRot(this.getYRot(), this.getXRot()); this.yBodyRot = this.getYRot(); this.yHeadRot = this.yBodyRot; float forward = player.zza; float strafe = player.xxa; if (forward <= 0.0F) { forward *= 0.25F; } this.flyingSpeed = this.getSpeed() * 0.1F; this.setSpeed((float) this.getAttributeValue(Attributes.MOVEMENT_SPEED) * 1.5F); this.setDeltaMovement(new Vec3(strafe, travelVector.y, forward).scale(this.getSpeed())); this.calculateEntityAnimation(this, false); } else { // The wolf does not have a passenger or the passenger is not a player System.out.println("No player is mounted, or the passenger is not a player."); super.travel(travelVector); } } public boolean hasSaddle() { return this.hasSaddle; } public void setSaddle(boolean hasSaddle) { this.hasSaddle = hasSaddle; } @Override protected void dropEquipment() { super.dropEquipment(); if (this.hasSaddle()) { this.spawnAtLocation(Items.SADDLE); this.setSaddle(false); } } @SubscribeEvent public static void onServerTick(TickEvent.ServerTickEvent event) { if (event.phase == TickEvent.Phase.START) { MinecraftServer server = net.minecraftforge.server.ServerLifecycleHooks.getCurrentServer(); if (server != null) { for (ServerPlayer player : server.getPlayerList().getPlayers()) { if (player.isPassenger() && player.getVehicle() instanceof MountableWolfEntity) { MountableWolfEntity wolf = (MountableWolfEntity) player.getVehicle(); System.out.println("Tick: " + player.getName().getString() + " is correctly mounted on " + wolf); } } } } } private boolean lastMountedState = false; @Override public void tick() { super.tick(); if (!this.level.isClientSide) { // Only on the server boolean isMounted = this.isVehicle() && this.getControllingPassenger() instanceof Player; // Only print if the state changed if (isMounted != lastMountedState) { if (isMounted) { Player player = (Player) this.getControllingPassenger(); // Verify the passenger is a player System.out.println("Server: Player " + player.getName().getString() + " is now mounted."); } else { System.out.println("Server: The wolf no longer has a passenger."); } lastMountedState = isMounted; } } } @Override public void addPassenger(Entity passenger) { super.addPassenger(passenger); if (passenger instanceof Player) { Player player = (Player) passenger; if (!this.level.isClientSide && player instanceof ServerPlayer) { // Send the packet to the server to indicate the player is mounted NetworkHandler.CHANNEL.send(PacketDistributor.PLAYER.with(() -> (ServerPlayer) player), new MountSyncPacket(true)); } } } @Override public void removePassenger(Entity passenger) { super.removePassenger(passenger); if (passenger instanceof Player) { Player player = (Player) passenger; if (!this.level.isClientSide && player instanceof ServerPlayer) { // Send the packet to the server to indicate the player is no longer mounted NetworkHandler.CHANNEL.send(PacketDistributor.PLAYER.with(() -> (ServerPlayer) player), new MountSyncPacket(false)); } } } @Override public boolean isControlledByLocalInstance() { Entity entity = this.getControllingPassenger(); return entity instanceof Player; } @Override public void positionRider(Entity passenger) { if (this.hasPassenger(passenger)) { double xOffset = Math.cos(Math.toRadians(this.getYRot() + 90)) * 0.4; double zOffset = Math.sin(Math.toRadians(this.getYRot() + 90)) * 0.4; passenger.setPos(this.getX() + xOffset, this.getY() + this.getPassengersRidingOffset() + passenger.getMyRidingOffset(), this.getZ() + zOffset); } } } MountSyncPacket package com.vals.valscraft.network; import com.vals.valscraft.entity.MountableWolfEntity; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.player.Player; import net.minecraftforge.network.NetworkEvent; import java.util.function.Supplier; public class MountSyncPacket { private final boolean isMounted; public MountSyncPacket(boolean isMounted) { this.isMounted = isMounted; } public void encode(FriendlyByteBuf buffer) { buffer.writeBoolean(isMounted); } public static MountSyncPacket decode(FriendlyByteBuf buffer) { return new MountSyncPacket(buffer.readBoolean()); } public void handle(NetworkEvent.Context context) { context.enqueueWork(() -> { ServerPlayer player = context.getSender(); // Get the player from the context if (player != null) { // Verifies if the player has dismounted if (!isMounted) { Entity vehicle = player.getVehicle(); if (vehicle instanceof MountableWolfEntity wolf) { // Logic to remove the player as a passenger wolf.removePassenger(player); System.out.println("Server: Player " + player.getName().getString() + " is no longer mounted."); } } } }); context.setPacketHandled(true); // Marks the packet as handled } } networkHandler package com.vals.valscraft.network; import com.vals.valscraft.valscraft; import net.minecraft.resources.ResourceLocation; import net.minecraftforge.network.NetworkRegistry; import net.minecraftforge.network.simple.SimpleChannel; import net.minecraftforge.network.NetworkEvent; import java.util.function.Supplier; public class NetworkHandler { private static final String PROTOCOL_VERSION = "1"; public static final SimpleChannel CHANNEL = NetworkRegistry.newSimpleChannel( new ResourceLocation(valscraft.MODID, "main"), () -> PROTOCOL_VERSION, PROTOCOL_VERSION::equals, PROTOCOL_VERSION::equals ); public static void init() { int packetId = 0; // Register the mount synchronization packet CHANNEL.registerMessage( packetId++, MountSyncPacket.class, MountSyncPacket::encode, MountSyncPacket::decode, (msg, context) -> msg.handle(context.get()) // Get the context with context.get() ); } }  
    • Do you use features of inventory profiles next (ipnext) or is there a change without it?
    • Remove rubidium - you are already using embeddium, which is a fork of rubidium
  • Topics

×
×
  • Create New...

Important Information

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