mojira.dev
MC-119549

Executing a teleport command on a player as an entity from the game loop function causes the server to freeze and not load chunks

The bug

It appears teleporting a player to unloaded chunks as an entity inside a function run as gameLoopFunction causes the server to hang.

Possibly related error message (17w48a)

21:58:22] [Server thread/FATAL]: Error executing task
java.util.concurrent.ExecutionException: java.lang.NegativeArraySizeException: nbits < 0: -1611584737
	at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:1.8.0_151]
	at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.8.0_151]
	at h.a(SourceFile:124) [17w48a.jar:?]
	at net.minecraft.server.MinecraftServer.w(SourceFile:632) [17w48a.jar:?]
	at net.minecraft.server.MinecraftServer.v(SourceFile:588) [17w48a.jar:?]
	at ckz.v(SourceFile:152) [17w48a.jar:?]
	at net.minecraft.server.MinecraftServer.run(SourceFile:493) [17w48a.jar:?]
	at java.lang.Thread.run(Unknown Source) [?:1.8.0_151]
Caused by: java.lang.NegativeArraySizeException: nbits < 0: -1611584737
	at java.util.BitSet.<init>(Unknown Source) ~[?:1.8.0_151]
	at blb.<init>(SourceFile:22) ~[17w48a.jar:?]
	at blb.<init>(SourceFile:17) ~[17w48a.jar:?]
	at aqg.a(SourceFile:1019) ~[17w48a.jar:?]
	at aqg.a(SourceFile:1124) ~[17w48a.jar:?]
	at aqg.a(SourceFile:1108) ~[17w48a.jar:?]
	at yr.a(SourceFile:636) ~[17w48a.jar:?]
	at qy.a(SourceFile:524) ~[17w48a.jar:?]
	at ku.a(SourceFile:126) ~[17w48a.jar:?]
	at ku$b.a(SourceFile:18) ~[17w48a.jar:?]
	at hc$1.run(SourceFile:13) ~[17w48a.jar:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_151]
	at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_151]
	at h.a(SourceFile:123) ~[17w48a.jar:?]
	... 5 more

How to reproduce

  1. Download the attached datapack

[media]
  1. and place it in the datapacks folder of your world

  2. Open the world and run the following commands

    /gamerule gameLoopFunction custom:teleport
    /summon armor_stand ~ ~ ~ {CustomName:"Test"}

Attachments

Comments 4

I can say that with command blocks the chunks still load. I don't know about functions though.

This needs to be tested by others to verify. I'll do so soon.

Change the pack_format to 4 from 1 and do /gamerule gameLoopFunction teleport as you don't have the teleport file in a folder call "custom" if you want it to be like how you have it make the files lad out like "data/custom/functions/custom/teleport"

Is this still an issue in the most recent versions (currently that is 1.13.2, or the latest snapshot 18w49a) of Minecraft? If so, please update the affected versions and help us keeping this ticket updated from time to time. If you are the owner/reporter of this ticket, you can modify the affected version(s) yourself.

Silly511

(Unassigned)

Confirmed

function, teleport

Minecraft 1.12, Minecraft 17w48a

Retrieved