kickPlayer does not take effect immediately
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 12.7k
- Forks
- 3.5k
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 11
Description
Expected behavior
java
@Override
public void onDisable()
{
for (World world : Bukkit.getWorlds())
{
for (Player player : world.getPlayers())
{
player.kickPlayer("Server closed");
}
Bukkit.unloadWorld(world, false); //return true
}
}
Observed/Actual behavior
java
@Override
public void onDisable()
{
for (World world : Bukkit.getWorlds())
{
for (Player player : world.getPlayers())
{
player.kickPlayer("Server closed");
}
Bukkit.unloadWorld(world, false); //return false
}
}
Steps/models to reproduce
void
Plugin and Datapack List
void
Paper version
This server is running Paper version 26.2-84-main@26e81c4 (2026-07-26T18:11:33Z) (Implementing API version 26.2.build.84-stable)
You are 3 version(s) behind
Other
After kickPlayer is called, the player is not immediately removed from the player list within the same tick. As a result, the world cannot be directly unloaded within that same tick in the plugin. The player list update occurs at the end of the server tick, which is after Bukkit.unloadWorld is executed
Contributor guide
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 Bukkit's kickPlayer and Bukkit.unloadWorld calls through the server tick lifecycle described in the report, focusing on when the player list is updated. Reproduce the same-tick shutdown sequence and verify that kicking players allows the world unload to succeed immediately without waiting for the end of the tick.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend-api-design
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100