Topic category: Help with Minecraft modding (Java Edition)
Since there's a known bug with custom dimensions that makes portals to spawn stacked to each other everytime you cross a portal I decided to change the access to the dimension using an Item and a procedure instead (that way I can avoid the world to be populated by stacked portals).
The procedure might teleport the player in the air but that's not a problem as I put some temporary buffs that will last while the player is transitioning between dimensions.
The only problem is that everytime the player does that in a local server (doesn't happen using the Run folder installation), the client of that player crashes. After relogin the teleport is successful but is not good to have a client-side crash each time you try to TP.
The crash log is the following:
---- Minecraft Crash Report ----
// Shall we play a game?
Time: 6/12/20 4:54 PM
Description: Unexpected error
java.lang.NullPointerException: Unexpected error
at net.mcreator.fantasymobs.procedures.UnderdarkTeleporterRightClickedInAirProcedure.executeProcedure(UnderdarkTeleporterRightClickedInAirProcedure.java:64) ~[?:?] {re:classloading}
at net.mcreator.fantasymobs.item.UnderdarkTeleporterItem$ItemCustom.func_77659_a(UnderdarkTeleporterItem.java:76) ~[?:?] {re:classloading}
at net.minecraft.item.ItemStack.func_77957_a(ItemStack.java:197) ~[?:?] {re:classloading}
at net.minecraft.client.multiplayer.PlayerController.func_187101_a(PlayerController.java:327) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
at net.minecraft.client.Minecraft.func_147121_ag(Minecraft.java:1304) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
at net.minecraft.client.Minecraft.func_184117_aA(Minecraft.java:1542) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
at net.minecraft.client.Minecraft.func_71407_l(Minecraft.java:1375) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
at net.minecraft.client.Minecraft.func_195542_b(Minecraft.java:904) [?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:553) [?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
at net.minecraft.client.main.Main.main(SourceFile:204) [?:?] {re:classloading}
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_51] {}
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_51] {}
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_51] {}
at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_51] {}
at net.minecraftforge.fml.loading.FMLClientLaunchProvider.lambda$launchService$0(FMLClientLaunchProvider.java:56) [forge-1.15.2-31.2.0.jar:31.2] {}
at net.minecraftforge.fml.loading.FMLClientLaunchProvider$$Lambda$410/1658785779.call(Unknown Source) [forge-1.15.2-31.2.0.jar:31.2] {}
at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-5.1.0.jar:?] {}
at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-5.1.0.jar:?] {}
at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-5.1.0.jar:?] {}
at cpw.mods.modlauncher.Launcher.run(Launcher.java:81) [modlauncher-5.1.0.jar:?] {}
at cpw.mods.modlauncher.Launcher.main(Launcher.java:65) [modlauncher-5.1.0.jar:?] {}
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- Head --
Thread: Render thread
Stacktrace:
at net.mcreator.fantasymobs.procedures.UnderdarkTeleporterRightClickedInAirProcedure.executeProcedure(UnderdarkTeleporterRightClickedInAirProcedure.java:64)
at net.mcreator.fantasymobs.item.UnderdarkTeleporterItem$ItemCustom.func_77659_a(UnderdarkTeleporterItem.java:76)
at net.minecraft.item.ItemStack.func_77957_a(ItemStack.java:197)
at net.minecraft.client.multiplayer.PlayerController.func_187101_a(PlayerController.java:327)
at net.minecraft.client.Minecraft.func_147121_ag(Minecraft.java:1304)
at net.minecraft.client.Minecraft.func_184117_aA(Minecraft.java:1542)
-- Affected level --
Details:
All players: 1 total; [ClientPlayerEntity['Saldrac'/176, l='MpServer', x=-47.96, y=70.49, z=-35.38]]
Chunk stats: Client Chunk Cache: 729, 441
Level dimension: DimensionType{minecraft:overworld}
Level name: MpServer
Level seed: 7087029254479450992
Level generator: ID 00 - default, ver 1. Features enabled: false
Level generator options: {}
Level spawn location: World: (-48,72,-46), Chunk: (at 0,4,2 in -3,-3; contains blocks -48,0,-48 to -33,255,-33), Region: (-1,-1; contains chunks -32,-32 to -1,-1, blocks -512,0,-512 to -1,255,-1)
Level time: 8460535 game time, 57849 day time
Known server brands:
Level was modded: false
Level storage version: 0x00000 - Unknown?
Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)
Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false
Server brand: forge
Server type: Non-integrated multiplayer server
Stacktrace:
at net.minecraft.client.world.ClientWorld.func_72914_a(ClientWorld.java:442)
at net.minecraft.client.Minecraft.func_71396_d(Minecraft.java:1763)
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:572)
at net.minecraft.client.main.Main.main(SourceFile:204)
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.minecraftforge.fml.loading.FMLClientLaunchProvider.lambda$launchService$0(FMLClientLaunchProvider.java:56)
at net.minecraftforge.fml.loading.FMLClientLaunchProvider$$Lambda$410/1658785779.call(Unknown Source)
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)
-- System Details --
Details:
Minecraft Version: 1.15.2
Minecraft Version ID: 1.15.2
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: 6476737904 bytes (6176 MB) / 8489271296 bytes (8096 MB) up to 8589934592 bytes (8192 MB)
CPUs: 6
JVM Flags: 9 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xss1M -Xmx8G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M
ModLauncher: 5.1.0+69+master.79f13f7
ModLauncher launch target: fmlclient
ModLauncher naming: srg
ModLauncher services:
/eventbus-2.2.0-service.jar eventbus PLUGINSERVICE
/forge-1.15.2-31.2.0.jar object_holder_definalize PLUGINSERVICE
/forge-1.15.2-31.2.0.jar runtime_enum_extender PLUGINSERVICE
/accesstransformers-2.1.1-shadowed.jar accesstransformer PLUGINSERVICE
/forge-1.15.2-31.2.0.jar capability_inject_definalize PLUGINSERVICE
/forge-1.15.2-31.2.0.jar runtimedistcleaner PLUGINSERVICE
/forge-1.15.2-31.2.0.jar fml TRANSFORMATIONSERVICE
FML: 31.2
Forge: net.minecraftforge:31.2.0
FML Language Providers:
javafml@31.2
minecraft@1
Mod List:
forge-1.15.2-31.2.0-client.jar Minecraft {minecraft@1.15.2 DONE}
worldedit-forge-mc1.15.2-7.1.0.jar WorldEdit {worldedit@7.1.0;48cc31c DONE}
noRecipeBook_v1.5.4formc1.15.2.jar No Recipe Book {norecipebook@1.5.4 DONE}
fantasy_mobs.1.0.3.jar fantasy_mobs {fantasy_mobs@1.0.2 DONE}
AppleSkin-mc1.15.2-forge-1.0.13.jar AppleSkin {appleskin@1.0.13 DONE}
jei-1.15.2-6.0.0.2.jar Just Enough Items {jei@6.0.0.2 DONE}
simplefarming-1.15.2-1.2.9.jar Simple Farming {simplefarming@1.15.2-1.2.9 DONE}
customquests-1.15.2-1.0.1.jar Custom Quests {customquests@1.15.2-1.0.1 DONE}
forge-1.15.2-31.2.0-universal.jar Forge {forge@31.2.0 DONE}
curios-FORGE-1.15.2-2.0.2.2.jar Curios API {curios@FORGE-1.15.2-2.0.2.2 DONE}
Botania-r1.15-384.jar Botania {botania@r1.15-384 DONE}
Patchouli-1.15.2-1.2-33.jar Patchouli {patchouli@1.15.2-1.2-33 DONE}
Xaeros_Minimap_20.11.0_Forge_1.15.2.jar Xaero's Minimap {xaerominimap@20.11.0 DONE}
XaerosWorldMap_1.5.7_Forge_1.15.2.jar Xaero's World Map {xaeroworldmap@1.5.7 DONE}
Launched Version: 1.15.2-forge-31.2.0
Backend library: LWJGL version 3.2.2 build 10
Backend API: GeForce RTX 2060 SUPER/PCIe/SSE2 GL version 4.6.0 NVIDIA 445.87, NVIDIA Corporation
GL Caps: Using framebuffer using OpenGL 3.0
Using VBOs: Yes
Is Modded: Definitely; Client brand changed to 'forge'
Type: Client (map_client.txt)
Resource Packs: mod_resources, vanilla
Current Language: English (US)
CPU: 6x Intel(R) Core(TM) i5-9600K CPU @ 3.70GHz
The procedure blueprint:
Here something similar happens but it was said that it was fixed: https://mcreator.net/comment/76112
Logs from the server I have running locally for test (Forge server 1.15.2, latest stable forge version):
I also tried to change the "Switch dimension of entity"for "Execute commands" with execute in fantasy_mobs:underdark run tp @p ^ ^ ^ and execute in minecraft:overworld run tp @p ^ ^ ^ but I'm getting the same error.
The thing is executing the same commands with a command block or with OP permissions in my local server doesn't generate any client crash.
I solved it by creating 2 structures with command blocks and TP commands. Then I linked the structure spawn to an item so players in survival can create the structures using that item in a block.