PaperMC / Paper

The most widely used, high performance Minecraft server that aims to fix gameplay and mechanics inconsistencies
https://papermc.io/
Other
9.99k stars 2.32k forks source link

Display entities are not always untracked when leaving the view distance #9574

Open 56738 opened 1 year ago

56738 commented 1 year ago

Expected behavior

Entity count in F3 should drop when leaving the view distance of text displays

Observed/Actual behavior

Entity count in F3 stays the same

Steps/models to reproduce

  1. Create a Paper server with a flat world and disable natural entity spawning (level-type=flat, spawn-...=false, generate-structures=false), also /op yourself
  2. Join the server, F3 should display E: .../1 (you are the only entity)
  3. /summon text_display, F3 should now show E: .../2
  4. /tp 100 -60 0, F3 still shows E: .../2
  5. /tp 10000 -60 0, F3 still shows E: .../2

Client render distance should be reasonably high (tested with 12 and 32).

Plugin and Datapack List

None

Paper version

Checking version, please wait... This server is running Paper version git-Paper-101 (MC: 1.20.1) (Implementing API version 1.20.1-R0.1-SNAPSHOT) (Git: 81619a6) You are running the latest version

Other

Malfrador commented 1 year ago

I would suspect something similar to https://github.com/PaperMC/Paper/issues/8451 going on. The client crash in that issue is caused by the entities having high velocity when untracked, but root cause might be the same: Ticking stopping before they reach the end of the tracking distance, and as a result they aren't untracked properly. Spigot sets the tracking distance for displays to the relatively high value of 128 by default which probably makes this more likely to occur compared to the low default tracking distances of other entities.

pop4959 commented 1 year ago

Can confirm that this happens, however unlike in your case I can perfectly reproduce this on the latest version of Spigot as well. Interestingly, following what Malfrador mentioned, if you reduce the tracking distance for displays down from 128 to something much smaller (for example, I tried 32) the entities are untracked properly.