[SPIGOT-8017] BlockPopulators causing ticking entity error / server crash Created: 11/Mar/25  Updated: 14/Mar/25  Resolved: 14/Mar/25

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Lucas Eastman Assignee: Unassigned
Resolution: Invalid Votes: 0
Labels: 1.21.4, bug, crash, entity, spigot
Environment:

Spigot specs:

  • Version 1.21.4

Frontier specs:

  • Using org.spigotmc.spigot-api version 1.21.4-RO.1-SNAPSHOT
  • Using Java 22

Attachments: File Frontier-1.0-SNAPSHOT.jar    
Version: 1.21.4
Plugin: Frontier
Guidelines Read: Yes

 Description   

When using a BlockPopulator that copies chunks from another world, my plugin causes a crash due to a ticking entity. I am not sure why this ticking entity issue is being caused by this functionality, but it persists nonetheless. A paste of the relevant code in the plugin and a crash report can be found below, and the plugin jar will be attached as well. The for loop on lines 43-46 of the code paste were added before this issue began.

When the server loads, everything is fine, but when I join the world whose BlockPopulators I am adding to and I start generating chunks by flying around, this issue occurs, seemingly from one of the newly generated chunks containing the ticking entity.

Crash report: https://paste.md-5.net/ujalefobex.bash

Relevant code: https://paste.md-5.net/ohagiyumib.cs



 Comments   
Comment by md_5 [ 14/Mar/25 ]
                            Material netherBlockType = netherWorld.getBlockAt( baseX + x, currentLevel, baseZ + z ).getType();

This is NOT safe code to run as it is not thread safe.

From the documentation of the populate method:

" * This method <b>must</b> be completely thread safe and able to handle

  • multiple concurrent callers."
Generated at Tue Apr 08 03:01:10 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.