PaperMC / PaperMC/Paper

Creating worlds causes the server to poll scheduled tick tasks and execute all of them

Open
#13,593 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: needs triage version: 1.21.11
Dominant language
Java
Stars
12.7k
Forks
3.5k
Avg merge
3d 13h
Merged PRs (30d)
11

Description

Expected behavior

I think that most developers (including me) expect that Server#createWorld just creates and loads the world, without executing any other tasks at that time.

Observed/Actual behavior

Server#createWorld calls MinecraftServer#prepareLevel, which keeps calling MinecraftServer#executeModerately while the world is being loaded. That last method polls and executes all scheduled tick tasks, causing for example players changing their position before the world is created.

Steps/models to reproduce

This is just an example, there are other things that it may affect (and I'm pretty sure it actually affects more than that):

  1. Add a PlayerMoveEvent listener, I think it's a good idea to print stacktrace when the event is called to actually understand this issue.
  2. Create a world using Server#createWorld after the server has been loaded, I think it's the best if you make it a command.
  3. Join the server and execute that command.
  4. Move at the time the world is being created.
  5. Note that the PlayerMoveEvent is called while the world is being created.
Plugin and Datapack List

I don't use any datapacks or plugins, except of my own, private minigame plugin for my MC network.

Paper version

[19:54:03 INFO]: Checking version, please wait...
[19:54:03 INFO]: This server is running Paper version 1.21.11-100-main@4873e3f (2026-01-29T11:02:49Z) (Implementing API version 1.21.11-R0.1-SNAPSHOT)
You are running the latest version
Previous version: 1.21.11-99-81b9122 (MC: 1.21.11)

Other

I think there is a reason Minecraft does that, but didn't get deep into that. This behaviour should at least be documented in javadoc of Server#createWorld, though it's still annoying to know that the server may execute other tasks while worlds are being created, I have no idea what's the best way to fix this issue.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing Server#createWorld into MinecraftServer#prepareLevel and MinecraftServer#executeModerately. Reproduce the issue with a PlayerMoveEvent listener while creating a world, then determine whether the intended fix is preventing unrelated scheduled tasks from running or documenting the behavior in Server#createWorld javadoc; done means the observed behavior is resolved or clearly documented.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.