mojira.dev
MC-257007

Players are sometimes considered OnGround while completely midair after a teleport

I was trying to use the OnGround check to see if all players have reached the ground, some conditions teleport them back up into the air (before they come close the ground). I noticed that sometimes I get stray triggers and I found that OnGround sometimes is 1 after a teleport while the player was never near ground.

In fact teleporting relatively (which I did for testing) does not cancel velocity so it shouldn't be related to velocity I think.

I reproduced this in a superflat with one repeating command block (at -60):

execute as @a[dx=20,dz=20,y=-55,dy=1000,nbt={OnGround:1b}] run say ground

Then I just keep spamming teleport commands in chat (with 50 blocks you gotta spam fast or you just hit the ground due to terminal velocity), with the selector above you gotta stand in x+ and z+ from the command block

/tp ~ ~50 ~

And then (somewhat rarely) this happens:

[13:54:16] [CHAT] Teleported 2called_chaos to 10.815072, -10.000000, 22.672274
[13:54:17] [CHAT] Teleported 2called_chaos to 10.815072, 35.155522, 22.672274
[13:54:17] [CHAT] Teleported 2called_chaos to 10.815072, 72.683930, 22.672274
[13:54:18] [CHAT] Teleported 2called_chaos to 10.815072, 107.878898, 22.672274
...
[13:54:29] [CHAT] Teleported 2called_chaos to 10.815072, 89.161479, 22.672274
[13:54:29] [CHAT] Teleported 2called_chaos to 10.815072, 92.370716, 22.672274
[13:54:30] [CHAT] Teleported 2called_chaos to 10.815072, 91.620543, 22.672274
[13:54:30] [CHAT] Teleported 2called_chaos to 10.815072, 98.639744, 22.672274
[13:54:32] [CHAT] Teleported 2called_chaos to 10.815072, 54.774634, 22.672274
[13:54:32] [CHAT] [2called_chaos] ground
[13:54:33] [CHAT] Teleported 2called_chaos to 10.815072, 38.234721, 22.672274
[13:54:33] [CHAT] Teleported 2called_chaos to 10.815072, 41.247289, 22.672274
[13:54:34] [CHAT] Teleported 2called_chaos to 10.815072, 44.248530, 22.672274
[13:54:34] [CHAT] Teleported 2called_chaos to 10.815072, 47.240883, 22.672274
...
[13:54:41] [CHAT] Teleported 2called_chaos to 10.815072, 164.230891, 22.672274
[13:54:42] [CHAT] Teleported 2called_chaos to 10.815072, 175.032237, 22.672274
[13:54:42] [CHAT] Teleported 2called_chaos to 10.815072, 181.913427, 22.672274
[13:54:43] [CHAT] Teleported 2called_chaos to 10.815072, 177.034594, 22.672274
[13:54:43] [CHAT] Teleported 2called_chaos to 10.815072, 183.915295, 22.672274
[13:54:43] [CHAT] [2called_chaos] ground
[13:54:44] [CHAT] Teleported 2called_chaos to 10.815072, 167.276099, 22.672274
[13:54:45] [CHAT] Teleported 2called_chaos to 10.815072, 158.476596, 22.672274
[13:54:46] [CHAT] Teleported 2called_chaos to 10.815072, 161.436887, 22.672274
[13:54:46] [CHAT] Teleported 2called_chaos to 10.815072, 160.477121, 22.672274
[13:54:46] [CHAT] [2called_chaos] ground
[13:54:48] [CHAT] Teleported 2called_chaos to 10.815072, 100.717423, 22.672274
[13:54:48] [CHAT] Teleported 2called_chaos to 10.815072, 103.677492, 22.672274
[13:54:49] [CHAT] Teleported 2called_chaos to 10.815072, 110.557534, 22.672274
[13:54:49] [CHAT] Teleported 2called_chaos to 10.815072, 117.437559, 22.672274
[13:54:51] [CHAT] Teleported 2called_chaos to 10.815072, 65.517571, 22.672274
[13:54:51] [CHAT] Teleported 2called_chaos to 10.815072, 72.397560, 22.672274
[13:54:52] [CHAT] Teleported 2called_chaos to 10.815072, 79.277544, 22.672274
[13:54:52] [CHAT] Teleported 2called_chaos to 10.815072, 86.157522, 22.672274
[13:54:53] [CHAT] Teleported 2called_chaos to 10.815072, 89.117494, 22.672274
[13:54:53] [CHAT] [2called_chaos] ground
[13:54:54] [CHAT] Teleported 2called_chaos to 10.815072, 92.077462, 22.672274
[13:54:55] [CHAT] Teleported 2called_chaos to 10.815072, 44.077387, 22.672274
[13:54:55] [CHAT] Teleported 2called_chaos to 10.815072, 50.957351, 22.672274
[13:54:56] [CHAT] Teleported 2called_chaos to 10.815072, 42.157300, 22.672274
[13:54:56] [CHAT] [2called_chaos] ground

Linked issues

Comments 2

Does this issue still occur in 1.19.4?

Thank you for your report!
We're tracking this issue in MC-108209, so this ticket is being resolved and linked as a duplicate.

If you would like to add a vote and any extra information to the main ticket it would be appreciated.

If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki
-- I am a bot. This action was performed automatically! The ticket was resolved by one of our moderators, and I left this message to give more information to you.

Sven

(Unassigned)

Unconfirmed

(Unassigned)

1.19.2

Retrieved