Paper
Paper copied to clipboard
EntityAddToWorldEvent behaves differently after ChunkSystem rewrite
Expected behavior
Everything should be behaving the same as before the patch.
Observed/Actual behavior
Mainly I came across three things, which are probably all related to each other:
- Entities can't be removed during the event anymore. That used to work just fine. Calling entity.remove() will lead to the following error: https://pastebin.com/raw/HBWfmAyH
- The content of item frames can't be updated during the event, which leads to a similar error: https://pastebin.com/raw/53GUDLay
- The third thing I'm currently unable to reproduce on a clean test server, so it's probably not relevant, but I have the suspicion that the event is called at a different point of time during startup, because on our production server we were able to process entities added in the spawn chunks (even without "load: STARTUP" plugin.yml setting, due to other plugin depends), which stopped working after the update.
Steps/models to reproduce
Listen to the EntityAddToWorldEvent and removing the entity, or modifying the content of an item frame.
Plugin and Datapack List
Just a single test plugin.
Paper version
This server is running Paper version git-Paper-177 (MC: 1.19.2) (Implementing API version 1.19.2-R0.1-SNAPSHOT) (Git: 1bbd273) You are running the latest version
Other
These are probably all things that can be fixed by scheduling the removal or content update a few ticks later, but I still expected the event to behave as before the update.