Region ticker disables before plugins, disallowing plugin cleanups in the world
Nobody has claimed this yet.
- Dominant language
- Shell
- Stars
- 4.4k
- Forks
- 623
- PR merge metrics
- No merged PRs in 30d
Description
Expected behavior
N/A
Observed/Actual behavior
The region ticker disables before plugins, preventing any further ticks while shutting down.
For some plugins, who spawn entities or block modifications in the world, normally they can run cleanups in onDisable(). However, because synchronous tasks on disable cannot be done due to the lack of main thread, they have to pend this task to RegionScheduler. Which is disabled at the time onDisable() occurs.
This means some plugins cannot run their cleanup, such as removing entities, reverting block changes, etc.
Steps/models to reproduce
- Set a block in the world with a task
- Set a task to revert that block change in
onDisable() - Stop the server
- The block will not be reverted
Plugin and Datapack List
BetterScoreboard, packetevents, PlaceholderAPI, ProjectKorra, ViaBackwards, ViaVersion
Folia version
1.21.4-DEV-master@8af1aef (2025-04-11T00:37:47Z) (Implementing API version 1.21.4-R0.1-SNAPSHOT)
Other
No response
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the shutdown ordering for the region ticker, RegionScheduler, and plugin onDisable() lifecycle described in the issue. Reproduce the block-change cleanup scenario, then verify that plugin cleanup work can still be scheduled during shutdown and that the reverted block or removed entities are processed before the server stops.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100