PacketSwapBlock#onMessage modifies the world asychronously
See original GitHub issueThe packet handler PacketSwapBlock#onMessage is modifying the world directly from the handler method. Since this method is called from a Netty thread, the world is being modified asynchronously, causing problems with both Vanilla and other mods.
I recommend running this handler on the main thread, using MinecraftServer#addScheduledTask
Issue Analytics
- State:
- Created 7 years ago
- Reactions:6
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Modifying a world asynchronously - Forums - Bukkit.org
So I have made a minigame and its all working successfully, however it has to randomly generate blocks around a about 100x100 area...
Read more >Other than modifying blocks, what can't be done ... - SpigotMC
I am well aware that blocks cannot be modified async, but is there anything else I should know about? I don't want to...
Read more >Asynchronous programming in C# | Microsoft Learn
An overview of the C# language support for asynchronous programming using async, await, Task, and Task.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

If you’re modifying the world in any way, you should be doing that from the main server thread. Also if iterating collections the server uses, or making any calls that might trigger loading any entities/tileentities.
Put the entire handling section, not just the spot @Aaron1011 highlighted, into a main thread handler. You have several calls in there that could result in unpleasant or unexpected behavior.