Mojira Archive
MC-276625

Strider spawning freezes the server when the empty fluid is in the lava tag

A data pack that adds the minecraft:empty fluid to the #minecraft:lava fluid tag will cause the game to freeze when attempting to spawn a strider.

Steps to reproduce

1. Load a data pack with a #minecraft:lava fluid tag containing the minecraft:empty fluid. An example data pack is attached.
2. Visit the Nether: /execute in minecraft:the_nether run tp @s ~ 100 ~
3. Move around until in a location where striders would normally spawn.
4. Observe that the server is now frozen.

Code analysis (Yarn mappings)

A loop is controlled by a tag in the StriderEntity.canSpawn method, which allows out-of-world positions to satisfy the condition and infinitely move the position up:

public static boolean canSpawn(EntityType<StriderEntity> type, WorldAccess world, SpawnReason spawnReason, BlockPos pos, Random random) {
	BlockPos.Mutable mutablePos = pos.mutableCopy();

	do {
		mutablePos.move(Direction.UP);
	} while (world.getFluidState(mutablePos).isIn(FluidTags.LAVA));

	return world.getBlockState(mutablePos).isAir();
}

A suggested fix would be to add an additional condition for the world top Y position to this loop.

Unresolved

haykam

2024-09-12, 03:55 AM

2024-11-06, 09:59 AM

5

5

Community Consensus

Normal

Platform

Crash, Data Packs

24w37a, 24w40a

-