[SPIGOT-7937] Enabling minecart_improvements and spawning a minecart causes a hang Created: 30/Oct/24  Updated: 25/Dec/24  Resolved: 02/Nov/24

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

Type: Bug Priority: Major
Reporter: Hex_27 Assignee: Unassigned
Resolution: Fixed Votes: 1
Labels: None

Attachments: File WorldgenTutorialPlugin.jar    
Version: This server is running CraftBukkit version 4361-Spigot-5eb8a94-6029040 (MC: 1.21.3) (Implementing API version 1.21.3-R0.1-SNAPSHOT)
Guidelines Read: Yes

 Description   

"initial-enabled-packs=minecart_improvements,update_1_21,vanilla" was set in server.properties to enable the minecart speed gamerule.

However, spawning a minecart via limitedregion seems to cause the server to hang. 

Attached is a world generator plugin that will spawn a flat world with one minecart at random positions in every chunk (spawned via limitedregion).

This is the code that spawns the minecart

	@Override
	public void populate(WorldInfo worldInfo, Random random, int chunkX, int chunkZ, LimitedRegion limitedRegion) {

		int rawRandomX = chunkX*16 + random.nextInt(16);
		int rawRandomZ = chunkZ*16 + random.nextInt(16);
		
		int y = getHighestGrassBlock(worldInfo, limitedRegion, rawRandomX, rawRandomZ);
		if(y <= worldInfo.getMinHeight()) return;
		
        limitedRegion.spawnEntity(
                new Location(Bukkit.getWorld(worldInfo.getName()), rawRandomX + 0.5f, y + 1.5f, rawRandomZ + 0.5f),
                EntityType.MINECART
        );
	}

 

 


Generated at Sat Dec 13 11:54:16 UTC 2025 using Jira 10.3.13#10030013-sha1:56dd970ae30ebfeda3a697d25be1f6388b68a422.