PaperMC / PaperMC/Paper

Reading a BlockState from a LimitedRegion in a BlockTransformer of the AsyncStructureGenerateEvent causes a server crash

Open
#13,004 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Expected behavior

When accessing blocks in a LimitedRegion provided in world generation can cause the server to try load a chunk (most likely the same chunk in this case) locking both the common worker that is generating the chunk which provided the LimitedRegion as well as the Server Thread which is currently waiting for the common worker.

Observed/Actual behavior

Accessing blocks in a LimitedRegion in world generation to not cause a thread dead lock

Steps/models to reproduce
  1. Install a plugin which uses the AsyncStructureGenerateEvent and accesses blocks within the event
  2. Generate loads of chunks (possibly using a plugin like Chunky)
  3. Have it happen sometime
Plugin and Datapack List

JustLootIt
Chunky

Paper version

This server is running Paper version 1.21.8-40-main@f866a5f (2025-08-19T16:05:02Z) (Implementing API version 1.21.8-R0.1-SNAPSHOT)

Other

I was told to open this issue on discord.

This is related to https://github.com/Lauriichan/JustLootIt/issues/32 (log from the issue: https://mclo.gs/IRe1VVp)

If JustLootIt is used to reproduce it the code related to this issue can be found here:
https://github.com/Lauriichan/JustLootIt/blob/master/justlootit-core/src/main/java/me/lauriichan/spigot/justlootit/listener/StructureListener.java#L112
https://github.com/Lauriichan/JustLootIt/blob/master/justlootit-core/src/main/java/me/lauriichan/spigot/justlootit/util/BlockUtil.java#L151

I will add further information once I got more

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 with AsyncStructureGenerateEvent and the linked JustLootIt entry points, StructureListener.java and BlockUtil.java, to reproduce block access through LimitedRegion during world generation. Use Chunky to generate many chunks and check whether the server and generation worker deadlock. Done means accessing blocks in the event no longer causes the server crash or deadlock.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.