Jump to content

[SOLVED] NullPointerException when giving BlockItem


HappyHippo77

Recommended Posts

So I'm following some tutorials, and I'm trying to use them is ways other than exactly what they're doing (which helps me learn faster), but I may have caused problems by doing that... So the first problem started when I had a block and an item for that block. I could /setblock the block just fine, no errors. But when I /give-d myself the item, it says "an internal error occurred when running this command" and immediately crashed. I didn't understand what was wrong, but after some messing around I managed to make it stop doing that... With the slight side effect that the game wont even load. It just throws a bunch of errors, and comes up with a screen saying "1 error occurred". I have no clue how to fix this (the error seems blatantly unconnected), so I decided to ask about it here. I am using 1.14.4.

This is my main file (Noodles)

package com.happyhippo77.noodles;

import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

// The value here should match an entry in the META-INF/mods.toml file
@Mod("noodles")
public class Noodles {
    public static final String MODID = "noodles";

    // Directly reference a log4j logger.
    public static final Logger LOGGER = LogManager.getLogger();

    public Noodles() {
        // Register the setup method for modloading
        FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup);

    }

    private void setup(final FMLCommonSetupEvent event) {

    }
}

 

This is the file for the block (NoodleOre) don't ask why the obsession with noodles, I don't know
 

package com.happyhippo77.noodles.blocks.properties;

import net.minecraft.block.Block;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;

public class NoodleOre extends Block {
    public NoodleOre() {
        super(Properties.create(Material.ROCK)
                .sound(SoundType.STONE)
                .hardnessAndResistance(2.0f)
        );
        setRegistryName("noodle_ore");
    }
}


Here's the file for the blocks (ModBlocks)
 

package com.happyhippo77.noodles.blocks;

import com.happyhippo77.noodles.Noodles;
import com.happyhippo77.noodles.blocks.properties.NoodleOre;
import net.minecraft.block.Block;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.registries.ObjectHolder;

@Mod.EventBusSubscriber(modid = Noodles.MODID, bus = Mod.EventBusSubscriber.Bus.MOD)
@ObjectHolder(Noodles.MODID)
public class ModBlocks {
        @SubscribeEvent
        public static void onBlocksRegistry(final RegistryEvent.Register<Block> event) {
            // register a new block here
            event.getRegistry().register(new NoodleOre());
            Noodles.LOGGER.info("Registered Blocks");
        }

    public static NoodleOre NOODLE_ORE = null;
}

 

And here's the file for the items (ModItems)
 

package com.happyhippo77.noodles.items;

import com.happyhippo77.noodles.Noodles;
import com.happyhippo77.noodles.blocks.ModBlocks;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;

@Mod.EventBusSubscriber(modid = Noodles.MODID, bus = Mod.EventBusSubscriber.Bus.MOD)
public class ModItems {

    @SubscribeEvent
    public static void onItemsRegistry(final RegistryEvent.Register<Item> event) {
        // register a new block here
        event.getRegistry().register(new BlockItem(ModBlocks.NOODLE_ORE, new Item.Properties()).setRegistryName(ModBlocks.NOODLE_ORE.getRegistryName()));
        Noodles.LOGGER.info("Registered Items");
    }
}


 

Overall the code is just kind of erratic, so there's probably some really idiotic mistake in there that I can't see. Nonetheless, I really can't figure it out, so any help is appreciated!

Oh yeah, and here's the console from around the time the errors start to where they end.
 

Spoiler

[14:56:57] [Client thread/DEBUG] [ne.mi.fm.ModList/LOADING]: Dispatching synchronous event LifecycleEvent:LOAD_REGISTRIES
[14:56:57] [Client thread/DEBUG] [ne.mi.fm.ja.FMLModContainer/LOADING]: Firing event for modid noodles : RegistryEvent.Register<minecraft:block>
[14:56:57] [Client thread/INFO] [co.ha.no.Noodles/]: Registered Blocks
[14:56:57] [Client thread/DEBUG] [ne.mi.fm.ja.FMLModContainer/LOADING]: Fired event for modid noodles : RegistryEvent.Register<minecraft:block>
[14:56:57] [Client thread/DEBUG] [ne.mi.fm.ja.FMLModContainer/LOADING]: Firing event for modid forge : RegistryEvent.Register<minecraft:block>
[14:56:57] [Client thread/DEBUG] [ne.mi.fm.ja.FMLModContainer/LOADING]: Fired event for modid forge : RegistryEvent.Register<minecraft:block>
[14:56:57] [Client thread/DEBUG] [ne.mi.re.GameData/REGISTRIES]: Applying holder lookups: minecraft:block
[14:56:57] [Client thread/DEBUG] [ne.mi.re.GameData/REGISTRIES]: Holder lookups applied: minecraft:block
[14:56:57] [Client thread/DEBUG] [ne.mi.fm.ModList/LOADING]: Dispatching synchronous event LifecycleEvent:LOAD_REGISTRIES
[14:56:57] [Client thread/DEBUG] [ne.mi.fm.ja.FMLModContainer/LOADING]: Firing event for modid noodles : RegistryEvent.Register<minecraft:item>
[14:56:57] [Client thread/ERROR] [ne.mi.fm.ja.FMLModContainer/]: Exception caught during firing event: null
    Index: 2
    Listeners:
        0: NORMAL
        1: ASM: class com.happyhippo77.noodles.blocks.ModBlocks onBlocksRegistry(Lnet/minecraftforge/event/RegistryEvent$Register;)V
        2: ASM: class com.happyhippo77.noodles.items.ModItems onItemsRegistry(Lnet/minecraftforge/event/RegistryEvent$Register;)V
java.lang.NullPointerException
    at com.happyhippo77.noodles.items.ModItems.onItemsRegistry(ModItems.java:17)
    at net.minecraftforge.eventbus.ASMEventHandler_1_ModItems_onItemsRegistry_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(Consumer.java:65)
    at java.util.function.Consumer.lambda$andThen$0(Consumer.java:65)
    at net.minecraftforge.fml.ModContainer.transitionState(ModContainer.java:112)
    at net.minecraftforge.fml.ModList.lambda$dispatchSynchronousEvent$5(ModList.java:125)
    at java.util.ArrayList.forEach(ArrayList.java:1257)
    at net.minecraftforge.fml.ModList.dispatchSynchronousEvent(ModList.java:125)
    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:197)
    at net.minecraftforge.fml.ModLoader.lambda$gatherAndInitializeMods$24(ModLoader.java:189)
    at net.minecraftforge.registries.GameData.fireRegistryEvents(GameData.java:969)
    at net.minecraftforge.fml.ModLoader.gatherAndInitializeMods(ModLoader.java:189)
    at net.minecraftforge.fml.client.ClientModLoader.lambda$begin$2(ClientModLoader.java:97)
    at net.minecraftforge.fml.client.ClientModLoader.lambda$createRunnableWithCatch$5(ClientModLoader.java:113)
    at net.minecraftforge.fml.client.ClientModLoader.begin(ClientModLoader.java:97)
    at net.minecraft.client.Minecraft.init(Minecraft.java:457)
    at net.minecraft.client.Minecraft.run(Minecraft.java:365)
    at net.minecraft.client.main.Main.main(Main.java:128)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    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:102)

[14:56:57] [Client thread/ERROR] [ne.mi.fm.ja.FMLModContainer/LOADING]: Caught exception during event RegistryEvent.Register<minecraft:item> dispatch for modid noodles
java.lang.NullPointerException: null
    at com.happyhippo77.noodles.items.ModItems.onItemsRegistry(ModItems.java:17) ~[classes/:?] {re:classloading}
    at net.minecraftforge.eventbus.ASMEventHandler_1_ModItems_onItemsRegistry_Register.invoke(.dynamic) ~[?:?] {}
    at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:80) ~[eventbus-1.0.0-service.jar:?] {}
    at net.minecraftforge.eventbus.EventBus.post(EventBus.java:258) ~[eventbus-1.0.0-service.jar:?] {}
    at net.minecraftforge.fml.javafmlmod.FMLModContainer.fireEvent(FMLModContainer.java:106) ~[forge-1.14.4-28.2.0_mapped_snapshot_20190719-1.14.3-recomp.jar:28.2] {re:classloading}
    at java.util.function.Consumer.lambda$andThen$0(Consumer.java:65) ~[?:1.8.0_241] {}
    at java.util.function.Consumer.lambda$andThen$0(Consumer.java:65) ~[?:1.8.0_241] {}
    at net.minecraftforge.fml.ModContainer.transitionState(ModContainer.java:112) ~[forge-1.14.4-28.2.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading}
    at net.minecraftforge.fml.ModList.lambda$dispatchSynchronousEvent$5(ModList.java:125) ~[forge-1.14.4-28.2.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading}
    at java.util.ArrayList.forEach(ArrayList.java:1257) ~[?:1.8.0_241] {}
    at net.minecraftforge.fml.ModList.dispatchSynchronousEvent(ModList.java:125) ~[forge-1.14.4-28.2.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading}
    at net.minecraftforge.fml.ModList.lambda$static$1(ModList.java:96) ~[forge-1.14.4-28.2.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading}
    at net.minecraftforge.fml.LifecycleEventProvider.dispatch(LifecycleEventProvider.java:71) ~[forge-1.14.4-28.2.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading}
    at net.minecraftforge.fml.ModLoader.dispatchAndHandleError(ModLoader.java:197) ~[forge-1.14.4-28.2.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading}
    at net.minecraftforge.fml.ModLoader.lambda$gatherAndInitializeMods$24(ModLoader.java:189) ~[forge-1.14.4-28.2.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading}
    at net.minecraftforge.registries.GameData.fireRegistryEvents(GameData.java:969) ~[forge-1.14.4-28.2.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading}
    at net.minecraftforge.fml.ModLoader.gatherAndInitializeMods(ModLoader.java:189) ~[forge-1.14.4-28.2.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading}
    at net.minecraftforge.fml.client.ClientModLoader.lambda$begin$2(ClientModLoader.java:97) ~[forge-1.14.4-28.2.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraftforge.fml.client.ClientModLoader.lambda$createRunnableWithCatch$5(ClientModLoader.java:113) ~[forge-1.14.4-28.2.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraftforge.fml.client.ClientModLoader.begin(ClientModLoader.java:97) ~[forge-1.14.4-28.2.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraft.client.Minecraft.init(Minecraft.java:457) ~[forge-1.14.4-28.2.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.client.Minecraft.run(Minecraft.java:365) ~[forge-1.14.4-28.2.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.client.main.Main.main(Main.java:128) ~[forge-1.14.4-28.2.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_241] {}
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_241] {}
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_241] {}
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_241] {}
    at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:55) ~[forge-1.14.4-28.2.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {}
    at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-4.1.0.jar:?] {}
    at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-4.1.0.jar:?] {}
    at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-4.1.0.jar:?] {}
    at cpw.mods.modlauncher.Launcher.run(Launcher.java:81) [modlauncher-4.1.0.jar:?] {}
    at cpw.mods.modlauncher.Launcher.main(Launcher.java:65) [modlauncher-4.1.0.jar:?] {}
    at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:102) [forge-1.14.4-28.2.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {}
[14:56:57] [Client thread/DEBUG] [ne.mi.fm.ja.FMLModContainer/LOADING]: Firing event for modid forge : RegistryEvent.Register<minecraft:item>
[14:56:57] [Client thread/DEBUG] [ne.mi.fm.ja.FMLModContainer/LOADING]: Fired event for modid forge : RegistryEvent.Register<minecraft:item>
[14:56:57] [Client thread/FATAL] [ne.mi.fm.ModLoader/LOADING]: Failed to complete lifecycle event LOAD_REGISTRIES, 1 errors found
[14:56:57] [Client 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-1.0.0-service.jar:?] {}
    at net.minecraftforge.fml.client.ClientModLoader.lambda$createRunnableWithCatch$5(ClientModLoader.java:115) ~[forge-1.14.4-28.2.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraftforge.fml.client.ClientModLoader.begin(ClientModLoader.java:97) ~[forge-1.14.4-28.2.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraft.client.Minecraft.init(Minecraft.java:457) ~[forge-1.14.4-28.2.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.client.Minecraft.run(Minecraft.java:365) ~[forge-1.14.4-28.2.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.client.main.Main.main(Main.java:128) ~[forge-1.14.4-28.2.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_241] {}
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_241] {}
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_241] {}
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_241] {}
    at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:55) ~[forge-1.14.4-28.2.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {}
    at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-4.1.0.jar:?] {}
    at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-4.1.0.jar:?] {}
    at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-4.1.0.jar:?] {}
    at cpw.mods.modlauncher.Launcher.run(Launcher.java:81) [modlauncher-4.1.0.jar:?] {}
    at cpw.mods.modlauncher.Launcher.main(Launcher.java:65) [modlauncher-4.1.0.jar:?] {}
    at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:102) [forge-1.14.4-28.2.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {}
[14:56:57] [Client thread/DEBUG] [ne.mi.fm.cl.ClientModLoader/CORE]: Generating PackInfo named mod:forge for mod file C:\Users\Conner\.gradle\caches\forge_gradle\minecraft_user_repo\net\minecraftforge\forge\1.14.4-28.2.0_mapped_snapshot_20190719-1.14.3\forge-1.14.4-28.2.0_mapped_snapshot_20190719-1.14.3-recomp.jar
[14:56:57] [Client thread/DEBUG] [ne.mi.fm.cl.ClientModLoader/CORE]: Generating PackInfo named mod:noodles for mod file C:\Users\Conner\Desktop\Minecraft\Modding\Noodles\build\resources\main
[14:56:57] [Client thread/DEBUG] [ne.mi.fm.ForgeI18n/CORE]: Loading I18N data entries: 0
[14:57:00] [Client thread/INFO] [mojang/NarratorWindows]: Narrator library for x64 successfully loaded
[14:57:00] [Server-Worker-6/DEBUG] [ne.mi.fm.co.ConfigTracker/CONFIG]: Loading configs type CLIENT
[14:57:00] [Server-Worker-6/DEBUG] [ne.mi.fm.co.ConfigTracker/CONFIG]: Loading config file type CLIENT at forge-client.toml for forge
[14:57:00] [Server-Worker-6/DEBUG] [ne.mi.fm.co.ConfigFileTypeHandler/CONFIG]: Built TOML config for C:\Users\Conner\Desktop\Minecraft\Modding\Noodles\run\config\forge-client.toml
[14:57:00] [Server-Worker-6/DEBUG] [ne.mi.fm.co.ConfigFileTypeHandler/CONFIG]: Loaded TOML config file C:\Users\Conner\Desktop\Minecraft\Modding\Noodles\run\config\forge-client.toml
[14:57:00] [Server-Worker-6/DEBUG] [ne.mi.fm.co.ConfigFileTypeHandler/CONFIG]: Watching TOML config file C:\Users\Conner\Desktop\Minecraft\Modding\Noodles\run\config\forge-client.toml for changes
[14:57:00] [Server-Worker-6/DEBUG] [ne.mi.co.ForgeConfig/FORGEMOD]: Loaded forge config file forge-client.toml
[14:57:00] [Server-Worker-6/DEBUG] [ne.mi.fm.co.ConfigTracker/CONFIG]: Loading configs type COMMON
[14:57:00] [Server-Worker-6/ERROR] [ne.mi.fm.ModLoader/LOADING]: Skipping lifecycle event SETUP, 1 errors found.
[14:57:00] [Server-Worker-6/FATAL] [ne.mi.fm.ModLoader/LOADING]: Failed to complete lifecycle event SETUP, 1 errors found
[14:57:00] [Server-Worker-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-1.0.0-service.jar:?] {}
    at net.minecraftforge.fml.client.ClientModLoader.lambda$createRunnableWithCatch$5(ClientModLoader.java:115) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraftforge.fml.client.ClientModLoader.startModLoading(ClientModLoader.java:123) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraftforge.fml.client.ClientModLoader.lambda$onreload$3(ClientModLoader.java:105) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraftforge.fml.client.ClientModLoader.lambda$createRunnableWithCatch$5(ClientModLoader.java:113) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
    at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1640) [?:1.8.0_241] {}
    at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1632) [?:1.8.0_241] {}
    at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) [?:1.8.0_241] {}
    at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) [?:1.8.0_241] {}
    at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) [?:1.8.0_241] {}
    at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157) [?:1.8.0_241] {}
[14:57:02] [Server-Worker-2/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: noodles:blockstates/noodle_ore.json: java.io.FileNotFoundException: noodles:blockstates/noodle_ore.json
[14:57:02] [Server-Worker-2/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'noodles:blockstates/noodle_ore.json' missing model for variant: 'noodles:noodle_ore#'
[14:57:03] [Server-Worker-2/ERROR] [ne.mi.fm.ModLoader/LOADING]: Skipping lifecycle event ENQUEUE_IMC, 1 errors found.
[14:57:03] [Server-Worker-2/FATAL] [ne.mi.fm.ModLoader/LOADING]: Failed to complete lifecycle event ENQUEUE_IMC, 1 errors found
[14:57:03] [Server-Worker-2/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-1.0.0-service.jar:?] {}
    at net.minecraftforge.fml.client.ClientModLoader.lambda$createRunnableWithCatch$5(ClientModLoader.java:115) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraftforge.fml.client.ClientModLoader.finishModLoading(ClientModLoader.java:136) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraftforge.fml.client.ClientModLoader.lambda$onreload$4(ClientModLoader.java:107) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
    at java.util.concurrent.CompletableFuture.uniRun(CompletableFuture.java:719) [?:1.8.0_241] {}
    at java.util.concurrent.CompletableFuture$UniRun.tryFire(CompletableFuture.java:701) [?:1.8.0_241] {}
    at java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:457) [?:1.8.0_241] {}
    at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) [?:1.8.0_241] {}
    at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) [?:1.8.0_241] {}
    at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) [?:1.8.0_241] {}
    at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157) [?:1.8.0_241] {}

 

Edited by HappyHippo77
Link to comment
Share on other sites

ModBlocks::NOODLE_ORE is always null. You've never give it a value.

Edited by DavidM

Some tips:

Spoiler

Modder Support:

Spoiler

1. Do not follow tutorials on YouTube, especially TechnoVision (previously called Loremaster) and HarryTalks, due to their promotion of bad practice and usage of outdated code.

2. Always post your code.

3. Never copy and paste code. You won't learn anything from doing that.

4. 

Quote

Programming via Eclipse's hotfixes will get you nowhere

5. Learn to use your IDE, especially the debugger.

6.

Quote

The "picture that's worth 1000 words" only works if there's an obvious problem or a freehand red circle around it.

Support & Bug Reports:

Spoiler

1. Read the EAQ before asking for help. Remember to provide the appropriate log(s).

2. Versions below 1.11 are no longer supported due to their age. Update to a modern version of Minecraft to receive support.

 

 

Link to comment
Share on other sites

From the looks, nothing that you're doing in your block's constructor should be there, also why are you registering your block to receive events?

This is my Forum Signature, I am currently attempting to transform it into a small guide for fixing easier issues using spoiler blocks to keep things tidy.

 

As the most common issue I feel I should put this outside the main bulk:

The only official source for Forge is https://files.minecraftforge.net, and the only site I trust for getting mods is CurseForge.

If you use any site other than these, please take a look at the StopModReposts project and install their browser extension, I would also advise running a virus scan.

 

For players asking for assistance with Forge please expand the spoiler below and read the appropriate section(s) in its/their entirety.

Spoiler

Logs (Most issues require logs to diagnose):

Spoiler

Please post logs using one of the following sites (Thank you Lumber Wizard for the list):

https://gist.github.com/100MB Requires member (Free)

https://pastebin.com/: 512KB as guest, 10MB as Pro ($$$)

https://hastebin.com/: 400KB

Do NOT use sites like Mediafire, Dropbox, OneDrive, Google Drive, or a site that has a countdown before offering downloads.

 

What to provide:

...for Crashes and Runtime issues:

Minecraft 1.14.4 and newer:

Post debug.log

Older versions:

Please update...

 

...for Installer Issues:

Post your installer log, found in the same place you ran the installer

This log will be called either installer.log or named the same as the installer but with .log on the end

Note for Windows users:

Windows hides file extensions by default so the installer may appear without the .jar extension then when the .log is added the log will appear with the .jar extension

 

Where to get it:

Mojang Launcher: When using the Mojang launcher debug.log is found in .minecraft\logs.

 

Curse/Overwolf: If you are using the Curse Launcher, their configurations break Forge's log settings, fortunately there is an easier workaround than I originally thought, this works even with Curse's installation of the Minecraft launcher as long as it is not launched THROUGH Twitch:

Spoiler
  1. Make sure you have the correct version of Forge installed (some packs are heavily dependent on one specific build of Forge)
  2. Make a launcher profile targeting this version of Forge.
  3. Set the launcher profile's GameDir property to the pack's instance folder (not the instances folder, the folder that has the pack's name on it).
  4. Now launch the pack through that profile and follow the "Mojang Launcher" instructions above.

Video:

Spoiler

 

 

 

or alternately, 

 

Fallback ("No logs are generated"):

If you don't see logs generated in the usual place, provide the launcher_log.txt from .minecraft

 

Server Not Starting:

Spoiler

If your server does not start or a command window appears and immediately goes away, run the jar manually and provide the output.

 

Reporting Illegal/Inappropriate Adfocus Ads:

Spoiler

Get a screenshot of the URL bar or copy/paste the whole URL into a thread on the General Discussion board with a description of the Ad.

Lex will need the Ad ID contained in that URL to report it to Adfocus' support team.

 

Posting your mod as a GitHub Repo:

Spoiler

When you have an issue with your mod the most helpful thing you can do when asking for help is to provide your code to those helping you. The most convenient way to do this is via GitHub or another source control hub.

When setting up a GitHub Repo it might seem easy to just upload everything, however this method has the potential for mistakes that could lead to trouble later on, it is recommended to use a Git client or to get comfortable with the Git command line. The following instructions will use the Git Command Line and as such they assume you already have it installed and that you have created a repository.

 

  1. Open a command prompt (CMD, Powershell, Terminal, etc).
  2. Navigate to the folder you extracted Forge’s MDK to (the one that had all the licenses in).
  3. Run the following commands:
    1. git init
    2. git remote add origin [Your Repository's URL]
      • In the case of GitHub it should look like: https://GitHub.com/[Your Username]/[Repo Name].git
    3. git fetch
    4. git checkout --track origin/master
    5. git stage *
    6. git commit -m "[Your commit message]"
    7. git push
  4. Navigate to GitHub and you should now see most of the files.
    • note that it is intentional that some are not synced with GitHub and this is done with the (hidden) .gitignore file that Forge’s MDK has provided (hence the strictness on which folder git init is run from)
  5. Now you can share your GitHub link with those who you are asking for help.

[Workaround line, please ignore]

 

Link to comment
Share on other sites

19 hours ago, DaemonUmbra said:

From the looks, nothing that you're doing in your block's constructor should be there, also why are you registering your block to receive events?

I'm not entirely sure what this means, nor how I should fix it. What is a constructor, and what is a receive event, and what should I be doing instead?

Link to comment
Share on other sites

50 minutes ago, Ugdhar said:

Not what you want to hear, but you honestly should probably be learning basic Java/OOP. Not knowing what a constructor is is a bad thing.

I already have a basic understanding of how Java functions. I can get around alright in a Java environment. I guess I just never heard "constructor" before.

One problem that I may have is that I can't learn Java well with anything except Forge. I only learn well when I'm doing something I find interesting, and the boring, drawling, here's-this-now-go-use-it tutorials you usually find never teach me anything I'll remember. I'll end up learning Forge faster if I just learn to use Forge than if I spend forever scurrying around trying to find the smallest shred of a good resource for Java.

  • Like 1
Link to comment
Share on other sites

- NoodleOre (Block) needs a registry name (noodle_ore)

- The public static field NOODLE_ORE (ModBlocks class) will always be null because afaik ObjectHolder pupulates only PSF fields, not PS (so make it final)

 

Not sure about the 2nd point though, check the ObjectHolder class, I think its explained in there

 

EDIT: NVM just seen that you set the registry name inside the constructor.

Edited by CAS_ual_TY
Link to comment
Share on other sites

12 hours ago, HappyHippo77 said:

I already have a basic understanding of how Java functions. I can get around alright in a Java environment. I guess I just never heard "constructor" before.

One problem that I may have is that I can't learn Java well with anything except Forge. I only learn well when I'm doing something I find interesting, and the boring, drawling, here's-this-now-go-use-it tutorials you usually find never teach me anything I'll remember. I'll end up learning Forge faster if I just learn to use Forge than if I spend forever scurrying around trying to find the smallest shred of a good resource for Java.

Forge has a very good API/ Docs for Minecraft 1.14.x - 1.15.x. You simply need to see on the Docs and: https://mcforge.readthedocs.io/en/latest/concepts/registries/#injecting-registry-values-into-fields

New in Modding? == Still learning!

Link to comment
Share on other sites

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.