java.lang.IllegalStateException: Entity has invalid position
Rocket-89p13 opened this issue ยท 7 comments
Describe the Bug
I sent a train to the nether and my game crashed and every time I start the world it instantly crashes
Reproduction Steps
- send train to nether
- loose days of game play
- hope someone knows how to fix
Expected Result
game insta crashes
Screenshots and Videos
No response
Crash Report or Log
---- Minecraft Crash Report ----
// I bet Cylons wouldn't have this problem.
Time: 2023-06-01 22:56:56
Description: Loading entity NBT
java.lang.IllegalStateException: Entity has invalid position
at net.minecraft.world.entity.Entity.m_20258_(Entity.java:1622) ~[client-1.19.2-20220805.130853-srg.jar%23161!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:create.mixins.json:ContraptionDriverInteractMixin,pl:mixin:APP:create.mixins.json:EntityMixin,pl:mixin:APP:create.mixins.json:client.EntityContraptionInteractionMixin,pl:mixin:A}
at net.minecraft.world.entity.EntityType.m_185988_(EntityType.java:476) ~[client-1.19.2-20220805.130853-srg.jar%23161!/:?] {re:mixin,re:classloading,pl:mixin:APP:flywheel.mixins.json:EntityTypeMixin,pl:mixin:A}
at net.minecraft.Util.m_137521_(Util.java:436) ~[client-1.19.2-20220805.130853-srg.jar%23161!/:?] {re:classloading}
at net.minecraft.world.entity.EntityType.m_20642_(EntityType.java:473) ~[client-1.19.2-20220805.130853-srg.jar%23161!/:?] {re:mixin,re:classloading,pl:mixin:APP:flywheel.mixins.json:EntityTypeMixin,pl:mixin:A}
at com.simibubi.create.content.trains.entity.Carriage$DimensionalCarriageEntity.createEntity(Carriage.java:794) ~[create-1.19.2-0.5.1.a.jar%23158!/:0.5.1.a] {re:classloading}
at com.simibubi.create.content.trains.entity.Carriage.manageEntities(Carriage.java:274) ~[create-1.19.2-0.5.1.a.jar%23158!/:0.5.1.a] {re:classloading}
at com.simibubi.create.content.trains.entity.Train.lambda$tick$2(Train.java:265) ~[create-1.19.2-0.5.1.a.jar%23158!/:0.5.1.a] {re:classloading}
at java.util.ArrayList.forEach(ArrayList.java:1511) ~[?:?] {re:mixin}
at com.simibubi.create.content.trains.entity.Train.tick(Train.java:265) ~[create-1.19.2-0.5.1.a.jar%23158!/:0.5.1.a] {re:classloading}
at com.simibubi.create.content.trains.GlobalRailwayManager.tickTrains(GlobalRailwayManager.java:227) ~[create-1.19.2-0.5.1.a.jar%23158!/:0.5.1.a] {re:classloading}
at com.simibubi.create.content.trains.GlobalRailwayManager.tick(GlobalRailwayManager.java:201) ~[create-1.19.2-0.5.1.a.jar%23158!/:0.5.1.a] {re:classloading}
at com.simibubi.create.foundation.events.CommonEvents.onServerWorldTick(CommonEvents.java:100) ~[create-1.19.2-0.5.1.a.jar%23158!/:0.5.1.a] {re:classloading}
at com.simibubi.create.foundation.events.CommonEvents_onServerWorldTick_LevelTickEvent.invoke(.dynamic) ~[create-1.19.2-0.5.1.a.jar%23158!/:0.5.1.a] {re:classloading,pl:eventbus:B}
at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:73) ~[eventbus-6.0.3.jar%2385!/:?] {}
at net.minecraftforge.eventbus.EventBus.post(EventBus.java:315) ~[eventbus-6.0.3.jar%2385!/:?] {}
at net.minecraftforge.eventbus.EventBus.post(EventBus.java:296) ~[eventbus-6.0.3.jar%2385!/:?] {}
at net.minecraftforge.event.ForgeEventFactory.onPostLevelTick(ForgeEventFactory.java:820) ~[forge-1.19.2-43.2.3-universal.jar%23166!/:?] {re:classloading}
at net.minecraft.server.MinecraftServer.m_5703(MinecraftServer.java:872) ~[client-1.19.2-20220805.130853-srg.jar%23161!/:?] {re:classloading,pl:accesstransformer:B}
at net.minecraft.server.MinecraftServer.m_5705(MinecraftServer.java:806) ~[client-1.19.2-20220805.130853-srg.jar%23161!/:?] {re:classloading,pl:accesstransformer:B}
at net.minecraft.client.server.IntegratedServer.m_5705_(IntegratedServer.java:84) ~[client-1.19.2-20220805.130853-srg.jar%23161!/:?] {re:classloading,pl:runtimedistcleaner:A}
at net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:654) ~[client-1.19.2-20220805.130853-srg.jar%23161!/:?] {re:classloading,pl:accesstransformer:B}
at net.minecraft.server.MinecraftServer.m_206580_(MinecraftServer.java:244) ~[client-1.19.2-20220805.130853-srg.jar%23161!/:?] {re:classloading,pl:accesstransformer:B}
at java.lang.Thread.run(Thread.java:833) [?:?] {}
A detailed walkthrough of the error, its code path and all known details is as follows:
-- Head --
Thread: Server thread
Stacktrace:
at net.minecraft.world.entity.Entity.m_20258_(Entity.java:1622) ~[client-1.19.2-20220805.130853-srg.jar%23161!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:create.mixins.json:ContraptionDriverInteractMixin,pl:mixin:APP:create.mixins.json:EntityMixin,pl:mixin:APP:create.mixins.json:client.EntityContraptionInteractionMixin,pl:mixin:A}
-- Entity being loaded --
Details:
Entity Type: create:carriage_contraption (com.simibubi.create.content.trains.entity.CarriageContraptionEntity)
Entity ID: 225
Entity Name: Carriage Contraption
Entity's Exact location: NaN, NaN, NaN
Entity's Block location: World: (0,0,0), Section: (at 0,0,0 in 0,0,0; chunk contains blocks 0,-64,0 to 15,319,15), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,-64,0 to 511,319,511)
Entity's Momentum: 0.00, 0.00, 0.00
Entity's Passengers: []
Entity's Vehicle: null
Stacktrace:
at net.minecraft.world.entity.Entity.m_20258_(Entity.java:1622) ~[client-1.19.2-20220805.130853-srg.jar%23161!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:create.mixins.json:ContraptionDriverInteractMixin,pl:mixin:APP:create.mixins.json:EntityMixin,pl:mixin:APP:create.mixins.json:client.EntityContraptionInteractionMixin,pl:mixin:A}
at net.minecraft.world.entity.EntityType.m_185988_(EntityType.java:476) ~[client-1.19.2-20220805.130853-srg.jar%23161!/:?] {re:mixin,re:classloading,pl:mixin:APP:flywheel.mixins.json:EntityTypeMixin,pl:mixin:A}
at net.minecraft.Util.m_137521_(Util.java:436) ~[client-1.19.2-20220805.130853-srg.jar%23161!/:?] {re:classloading}
at net.minecraft.world.entity.EntityType.m_20642_(EntityType.java:473) ~[client-1.19.2-20220805.130853-srg.jar%23161!/:?] {re:mixin,re:classloading,pl:mixin:APP:flywheel.mixins.json:EntityTypeMixin,pl:mixin:A}
at com.simibubi.create.content.trains.entity.Carriage$DimensionalCarriageEntity.createEntity(Carriage.java:794) ~[create-1.19.2-0.5.1.a.jar%23158!/:0.5.1.a] {re:classloading}
at com.simibubi.create.content.trains.entity.Carriage.manageEntities(Carriage.java:274) ~[create-1.19.2-0.5.1.a.jar%23158!/:0.5.1.a] {re:classloading}
at com.simibubi.create.content.trains.entity.Train.lambda$tick$2(Train.java:265) ~[create-1.19.2-0.5.1.a.jar%23158!/:0.5.1.a] {re:classloading}
at java.util.ArrayList.forEach(ArrayList.java:1511) ~[?:?] {re:mixin}
at com.simibubi.create.content.trains.entity.Train.tick(Train.java:265) ~[create-1.19.2-0.5.1.a.jar%23158!/:0.5.1.a] {re:classloading}
at com.simibubi.create.content.trains.GlobalRailwayManager.tickTrains(GlobalRailwayManager.java:227) ~[create-1.19.2-0.5.1.a.jar%23158!/:0.5.1.a] {re:classloading}
at com.simibubi.create.content.trains.GlobalRailwayManager.tick(GlobalRailwayManager.java:201) ~[create-1.19.2-0.5.1.a.jar%23158!/:0.5.1.a] {re:classloading}
at com.simibubi.create.foundation.events.CommonEvents.onServerWorldTick(CommonEvents.java:100) ~[create-1.19.2-0.5.1.a.jar%23158!/:0.5.1.a] {re:classloading}
at com.simibubi.create.foundation.events.CommonEvents_onServerWorldTick_LevelTickEvent.invoke(.dynamic) ~[create-1.19.2-0.5.1.a.jar%23158!/:0.5.1.a] {re:classloading,pl:eventbus:B}
at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:73) ~[eventbus-6.0.3.jar%2385!/:?] {}
at net.minecraftforge.eventbus.EventBus.post(EventBus.java:315) ~[eventbus-6.0.3.jar%2385!/:?] {}
at net.minecraftforge.eventbus.EventBus.post(EventBus.java:296) ~[eventbus-6.0.3.jar%2385!/:?] {}
at net.minecraftforge.event.ForgeEventFactory.onPostLevelTick(ForgeEventFactory.java:820) ~[forge-1.19.2-43.2.3-universal.jar%23166!/:?] {re:classloading}
at net.minecraft.server.MinecraftServer.m_5703(MinecraftServer.java:872) ~[client-1.19.2-20220805.130853-srg.jar%23161!/:?] {re:classloading,pl:accesstransformer:B}
at net.minecraft.server.MinecraftServer.m_5705(MinecraftServer.java:806) ~[client-1.19.2-20220805.130853-srg.jar%23161!/:?] {re:classloading,pl:accesstransformer:B}
at net.minecraft.client.server.IntegratedServer.m_5705_(IntegratedServer.java:84) ~[client-1.19.2-20220805.130853-srg.jar%23161!/:?] {re:classloading,pl:runtimedistcleaner:A}
at net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:654) ~[client-1.19.2-20220805.130853-srg.jar%23161!/:?] {re:classloading,pl:accesstransformer:B}
at net.minecraft.server.MinecraftServer.m_206580_(MinecraftServer.java:244) ~[client-1.19.2-20220805.130853-srg.jar%23161!/:?] {re:classloading,pl:accesstransformer:B}
at java.lang.Thread.run(Thread.java:833) [?:?] {}
Operating System
Windows 10
Mod Version
0.5.1a
Minecraft Version
1.19.2
Forge Version
43.2.3
Other Mods
No response
Additional Context
No response
Hello I'm having the same crash in 1.18.
I could solve the crash by running the /create trains command and then delete it. That does involve you loading the world with another account, or loading the world on a server and using crashutilities mod to send yourself to spawn while offline (assuming your train isn't chunkloaded otherwise it's going to crash right away) If you need some more help to fix your world I can help you.
Having exactly the same problem with almost exact same error message. Killing the train didnt solve it and i had to rollback to a backup. I also couldnt just delete the nether to rollback just it since trains are stored is some separate file.
How to repair a train with corrupt entity location
The crash is caused by the train carriage entity having invalid values set for its position and rotation co-ordinates.
You can fix this by editing the saved NBT file for the train and setting these values manually.
- Stop the server or exit the game
- Find the
<world>/data/data/create_tracks.nbt
file and open it with an NBT Editor, e.g. NBTExplorer - Go to the
data
>Trains
list node - For each train entry, go to the
Carriages
list node - For each carriage go to the
Entity
>Pos
node, if the values are set toNaN
then you need to fix this carriage - For the same carriage, find the
EntityPositioning
>PositionAnchor
. This will contain the train's co-ordinates - Go back to the
Entity
>Pos
and set the values to match - Also, in the entity find the
Pitch
andYaw
values, set these to0
The train should get re-aligned with the track automatically.
I have the same issue but PositionAnchor is also 3 NaN values. How can i correct it ?
Edit: im on 1.20.1 with create 0.5.1d
I have the same issue but PositionAnchor is also 3 NaN values. How can i correct it ?
I haven't tried this but you could try setting them all to 0
. Make appropriate backups before trying this.
I think this might work as the location data in this file is likely derived from the actual entity location and so will get corrected on the next tick.
Invalid NaN positioning here so at some point u might be diving by 0 at the point a train goes through a nether portal. A temporary fix could just be to check for a NaN value for the position before grabbing the carriage from it's associated NBT and then declaring the carriage as invalid instead of having an unfortunate crash.