Minecraft crash if i open a gui

Started by DeymonsD on

Topic category: Help with Minecraft modding (Java Edition)

Joined Dec 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Minecraft crash if i open a gui

Hello, 

I made a menu with mc creator, solo everything is fine, but on a server his crash moment and I do not understand how the problem solved

Rapport of crash :

---- Minecraft Crash Report ----
// I let you down. Sorry :(

Time: 15/04/19 02:17
Description: Unexpected error

java.lang.NullPointerException: Unexpected error
    at mod.mcreator.mcreator_f4Press$KeyHandlerClass.onKeyInput(mcreator_f4Press.java:82)
    at cpw.mods.fml.common.eventhandler.ASMEventHandler_6_KeyHandlerClass_onKeyInput_KeyInputEvent.invoke(.dynamic)
    at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:54)
    at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:140)
    at cpw.mods.fml.common.FMLCommonHandler.fireKeyInput(FMLCommonHandler.java:540)
    at net.minecraft.client.Minecraft.func_71407_l(Minecraft.java:1873)
    at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:973)
    at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:898)
    at net.minecraft.client.main.Main.main(SourceFile:148)
    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:497)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Stacktrace:
    at mod.mcreator.mcreator_f4Press$KeyHandlerClass.onKeyInput(mcreator_f4Press.java:82)
    at cpw.mods.fml.common.eventhandler.ASMEventHandler_6_KeyHandlerClass_onKeyInput_KeyInputEvent.invoke(.dynamic)
    at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:54)
    at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:140)
    at cpw.mods.fml.common.FMLCommonHandler.fireKeyInput(FMLCommonHandler.java:540)

-- Affected level --
Details:
    Level name: MpServer
    All players: 1 total; [EntityClientPlayerMP['Deymons'/387, l='MpServer', x=225,07, y=68,62, z=263,84]]
    Chunk stats: MultiplayerChunkCache: 337, 337
    Level seed: 0
    Level generator: ID 00 - default, ver 1. Features enabled: false
    Level generator options: 
    Level spawn location: World: (217,64,250), Chunk: (at 9,4,10 in 13,15; contains blocks 208,0,240 to 223,255,255), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)
    Level time: 27322 game time, 27322 day time
    Level dimension: 0
    Level storage version: 0x00000 - Unknown?
    Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)
    Level game mode: Game mode: survival (ID 0). Hardcore: false. Cheats: false
    Forced entities: 43 total; [EntityWolf['Wolf'/128, l='MpServer', x=281,00, y=68,00, z=316,97], EntityCreeper['Creeper'/321, l='MpServer', x=269,50, y=29,00, z=280,50], EntitySkeleton['Skeleton'/643, l='MpServer', x=265,50, y=29,00, z=290,50], EntityZombie['Zombie'/326, l='MpServer', x=270,28, y=29,00, z=277,94], EntityWolf['Wolf'/70, l='MpServer', x=165,31, y=68,00, z=321,44], EntityWolf['Wolf'/71, l='MpServer', x=161,50, y=65,00, z=320,50], EntityCreeper['Creeper'/850, l='MpServer', x=208,50, y=55,00, z=307,50], EntityCreeper['Creeper'/851, l='MpServer', x=209,50, y=55,00, z=310,50], EntityZombie['Zombie'/854, l='MpServer', x=169,50, y=18,00, z=237,50], EntitySkeleton['Skeleton'/856, l='MpServer', x=162,84, y=17,46, z=237,50], EntityWolf['Wolf'/89, l='MpServer', x=197,97, y=65,00, z=268,50], EntityZombie['Zombie'/281, l='MpServer', x=265,41, y=17,00, z=209,88], EntityWolf['Wolf'/90, l='MpServer', x=196,03, y=64,00, z=273,69], EntitySkeleton['Skeleton'/538, l='MpServer', x=262,50, y=51,00, z=213,50], EntityWolf['Wolf'/92, l='MpServer', x=195,50, y=65,00, z=285,69], EntityZombie['Zombie'/95, l='MpServer', x=221,50, y=55,00, z=303,50], EntitySkeleton['Skeleton'/96, l='MpServer', x=219,50, y=53,00, z=313,50], EntityCreeper['Creeper'/738, l='MpServer', x=270,50, y=33,00, z=210,50], EntityZombie['Zombie'/739, l='MpServer', x=270,50, y=33,00, z=209,50], EntityHorse['Horse'/100, l='MpServer', x=236,63, y=64,00, z=219,16], EntityHorse['Horse'/101, l='MpServer', x=235,78, y=63,00, z=227,63], EntityHorse['Horse'/102, l='MpServer', x=237,84, y=63,00, z=228,81], EntityWolf['Wolf'/103, l='MpServer', x=239,50, y=74,00, z=278,91], EntityCreeper['Creeper'/487, l='MpServer', x=161,50, y=29,00, z=215,50], EntityWolf['Wolf'/104, l='MpServer', x=239,31, y=77,00, z=286,38], EntityWolf['Wolf'/106, l='MpServer', x=233,25, y=76,00, z=285,56], EntityZombie['Zombie'/746, l='MpServer', x=277,50, y=34,00, z=204,50], EntityCreeper['Creeper'/747, l='MpServer', x=221,50, y=56,00, z=320,50], EntitySkeleton['Skeleton'/365, l='MpServer', x=225,50, y=55,00, z=314,50], EntitySkeleton['Skeleton'/366, l='MpServer', x=228,09, y=55,00, z=318,63], EntityZombie['Zombie'/558, l='MpServer', x=195,50, y=17,00, z=279,50], EntityZombie['Zombie'/559, l='MpServer', x=195,56, y=17,00, z=281,13], EntitySkeleton['Skeleton'/368, l='MpServer', x=183,50, y=58,00, z=318,91], EntityClientPlayerMP['Deymons'/387, l='MpServer', x=225,07, y=68,62, z=263,84], EntitySkeleton['Skeleton'/311, l='MpServer', x=263,50, y=73,00, z=310,50], EntityZombie['Zombie'/119, l='MpServer', x=260,50, y=21,00, z=219,50], EntityPig['Pig'/120, l='MpServer', x=260,97, y=79,00, z=284,94], EntityPig['Pig'/121, l='MpServer', x=273,78, y=70,00, z=289,28], EntityPig['Pig'/122, l='MpServer', x=269,50, y=71,00, z=288,50], EntityWolf['Wolf'/125, l='MpServer', x=287,75, y=77,00, z=247,38], EntityCreeper['Creeper'/190, l='MpServer', x=199,93, y=64,00, z=284,28], EntityPig['Pig'/126, l='MpServer', x=275,50, y=70,00, z=290,50], EntityWolf['Wolf'/127, l='MpServer', x=282,72, y=68,00, z=316,34]]
    Retry entities: 0 total; []
    Server brand: cauldron,craftbukkit,mcpc,fml,forge
    Server type: Non-integrated multiplayer server
Stacktrace:
    at net.minecraft.client.multiplayer.WorldClient.func_72914_a(WorldClient.java:373)
    at net.minecraft.client.Minecraft.func_71396_d(Minecraft.java:2444)
    at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:927)
    at net.minecraft.client.main.Main.main(SourceFile:148)
    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:497)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

-- System Details --
Details:
    Minecraft Version: 1.7.10
    Operating System: Windows 10 (amd64) version 10.0
    Java Version: 1.8.0_51, Oracle Corporation
    Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    Memory: 431624656 bytes (411 MB) / 738197504 bytes (704 MB) up to 2147483648 bytes (2048 MB)
    JVM Flags: 8 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx2G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M
    AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
    IntCache: cache: 0, tcache: 0, allocated: 13, tallocated: 95
    FML: MCP v9.05 FML v7.10.99.99 Minecraft Forge 10.13.4.1614 4 mods loaded, 4 mods active
    States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
    UCHIJAAAAAA    mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) 
    UCHIJAAAAAA    FML{7.10.99.99} [Forge Mod Loader] (forge-1.7.10-10.13.4.1614-1.7.10.jar) 
    UCHIJAAAAAA    Forge{10.13.4.1614} [Minecraft Forge] (forge-1.7.10-10.13.4.1614-1.7.10.jar) 
    UCHIJAAAAAA    jobsmod{1.0.0} [jobsmod] (jobsmod.zip) 
    GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.6.0 NVIDIA 398.82' Renderer: 'GeForce GTX 960/PCIe/SSE2'
    Launched Version: 1.7.10-Forge10.13.4.1614-1.7.10
    LWJGL: 2.9.1
    OpenGL: GeForce GTX 960/PCIe/SSE2 GL version 4.6.0 NVIDIA 398.82, NVIDIA Corporation
    GL Caps: Using GL 1.3 multitexturing.
Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.
Anisotropic filtering is supported and maximum anisotropy is 16.
Shaders are available because OpenGL 2.1 is supported.

    Is Modded: Definitely; Client brand changed to 'fml,forge'
    Type: Client (map_client.txt)
    Resource Packs: []
    Current Language: English (US)
    Profiler Position: N/A (disabled)
    Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
    Anisotropic Filtering: Off (1)

 

Can someone help me? thank you in advance ^^ 

Cordialy Deymons

Joined Jan 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
i am running MCreator 1.8.1 …
Thu, 10/10/2019 - 19:17

i am running MCreator 1.8.1 (for minecraft 1.12.2) and am experiencing the same issue.
the keybind function is hitting a NullPointerException when trying to fetch the World instance.

this error only occurs in multiplayer if someone other than the host tries to use the keybind.
 

I found a way of fetching the World instance without using the MinecraftServer instance (the way the code does it normally) and this allows the GUI to appear but i cannot be interacted with in any way.

By the generated code it fetches it like this:

EntityPlayer entitySP = net.minecraft.client.Minecraft.getMinecraft().player;
MinecraftServer server = net.minecraftforge.fml.common.FMLCommonHandler.instance().getMinecraftServerInstance();
World world = server.getWorld(entitySP.dimension);

My modified version at the moment is this:

EntityPlayer entitySP = net.minecraft.client.Minecraft.getMinecraft().player;
MinecraftServer server = net.minecraftforge.fml.common.FMLCommonHandler.instance().getMinecraftServerInstance();
World world = null;
if (server == null) {
	world = net.minecraftforge.fml.client.FMLClientHandler.instance().getWorldClient();
} else {
	world = server.getWorld(entitySP.dimension);
}

as I mentioned before, this prevents the crashing and allows opening of the GUI but only the host can interact with the GUI.

any suggestions as to what I can do to fix this issue?