I created a new world to test the spear,
but after i reloaded the world it said “Invalid player data”
Stacktrace:
net.minecraft.ReportedException: Loading entity NBT
at net.minecraft.world.entity.Entity.load(SourceFile:2336)
at java.base/java.util.Optional.ifPresent(Optional.java:178)
at net.minecraft.server.network.config.PrepareSpawnTask$Ready.spawn(SourceFile:197)
at net.minecraft.server.network.config.PrepareSpawnTask.spawnPlayer(SourceFile:92)
at net.minecraft.server.network.ServerConfigurationPacketListenerImpl.handleConfigurationFinished(SourceFile:181)
at net.minecraft.network.protocol.configuration.ServerboundFinishConfigurationPacket.handle(SourceFile:22)
at net.minecraft.network.protocol.configuration.ServerboundFinishConfigurationPacket.handle(SourceFile:8)
at net.minecraft.network.PacketProcessor$ListenerAndPacket.handle(SourceFile:55)
at net.minecraft.network.PacketProcessor.processQueuedPackets(SourceFile:38)
at net.minecraft.server.MinecraftServer.runServer(SourceFile:782)
at net.minecraft.server.MinecraftServer.lambda$spin$2(SourceFile:306)
at java.base/java.lang.Thread.run(Thread.java:1447)
Caused by: java.lang.NullPointerException: Cannot invoke "net.minecraft.server.network.ServerGamePacketListenerImpl.send(net.minecraft.network.protocol.Packet)" because "this.connection" is null
at net.minecraft.server.level.ServerPlayer.onEffectAdded(SourceFile:1747)
at net.minecraft.world.entity.LivingEntity.addEffect(SourceFile:1070)
at net.minecraft.world.entity.LivingEntity.readAdditionalSaveData(SourceFile:829)
at net.minecraft.world.entity.player.Player.readAdditionalSaveData(SourceFile:700)
at net.minecraft.server.level.ServerPlayer.readAdditionalSaveData(SourceFile:429)
at net.minecraft.world.entity.Entity.load(SourceFile:2327)
... 11 more
net.minecraft.server.level.ServerPlayer never sets this.connection
Duplicate of MC-302672.