mojira.dev
MC-228739

End Crystal BeamTarget overflows on servers when pointing above Y: ~2000

When setting the BeamTarget of a end crystal to above around Y:2000 on a server, the target overflows and instead points towards around Y:-2000.

I have tested this on singleplayer and multiplayer, and it does not affect singleplayer (other than for the unrelated issue in MC-217030

Command to replicate: 

/summon minecraft:end_crystal ~ ~ ~ {BeamTarget:{X:0,Y:2060,Z:0}}

The NBT data also seems to suggest that it should be pointing towards Y:2060.

/data get entity @e[type=minecraft:end_crystal,limit=1,sort=nearest]

Comments 1

This is caused by the way the position is encoded when transmitted over the network, see net.minecraft.core.BlockPos.of(long) (Mojang name 1.17.1-pre1). X- and Z-coordinate are encoded with 26 bits each to allow covering the complete -30,000,000 to 30,000,000 range; therefore for the Y-coordinate there are only 12 bits left, thus it can only encode values from -2048 to 2047.

There might be more situations where this could be an issue, though all of these likely will never occur without using commands.

I have marked this report as Confirmed nonetheless, but I assume the developers might resolve this as Won't Fix.

Ilm 9001

(Unassigned)

Confirmed

Networking

multiplayer, server

1.17, 1.17.1 Pre-release 1

Retrieved