[SPIGOT-6572] Chunk.getEntities() is missing some mobs Created: 17/Jun/21 Updated: 17/Jun/21 Resolved: 17/Jun/21 |
|
| Status: | Resolved |
| Project: | Spigot |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Nathan Wolf | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | 1.17 | ||
| Environment: |
Mac OS openjdk 16.0.1 Zulu16.30+19-CA (build 16.0.1+9) |
||
| Issue Links: |
|
||||||||
| Version: | 3147-Spigot-9472b09-d7ef1e9 (MC: 1.17) (Implementing API version 1.17-R0.1-SNAPSHOT) | ||||||||
| Guidelines Read: | Yes | ||||||||
| Description |
|
I am checking Chunk.getEntities() inside the ChunkLoadEvent and not seeing any entities ever show up, even as I fly around seeing persistent mobs respawning. I have also tried a 1-tick delayed task to check for entities and it is still empty. In the 1-tick delayed task I do see Players show up in the list, so it's not always completely empty. I also think I am seeing mobs spawned by my own plugin show up, though not again on chunk unload/load if I am setting Entity.setPersist (even though they do respawn). I will keep investigating and try to come up with a good test plugin, I'm not really sure yet what is going on but thought I'd submit the issue in case it rings any bells. Thank you all for your hard work on this update, I imagine it must've been a larger effort than usual! |
| Comments |
| Comment by md_5 [ 17/Jun/21 ] |
|
Not at this point, I'd leave comments for suggestions on the PR as there is more discussion there |
| Comment by Nathan Wolf [ 17/Jun/21 ] |
|
Oh darn, sorry, I did search! Well thank you. Is there any event I could listen to for when the entities do finally load? The PR in the linked issue sounds potentially problematic to me but I did not look too closely. |
| Comment by md_5 [ 17/Jun/21 ] |
|
It's a known issue, see the duplicate. Entity loading is async in 1.17 |
| Comment by Nathan Wolf [ 17/Jun/21 ] |
|
I've made a test plugin here, I will be using it to narrow in on this problem: https://github.com/NathanWolf/Bukkit-Unit-Tests/releases/tag/SPIGOT-6572-1 It currently just monitors chunk load events and prints entities found in them (perhaps this is meant to be empty again like it used to be?) It also prints currently-loaded entities from chunks, so that much is working. I'd like to add some delayed tasks to try to gauge when entities do show up, I think it may not always be right on the next tick but currently I am unsure. I may also add a CreatureSpawnEvent handler, the issue I have with my main plugin is that entities persisted in chunks are not showing up on ChunkLoad nor do they seem to fire a spawn event, they just ... appear. |