-
Bug
-
Resolution: Unresolved
-
None
-
24w37a, 24w40a
-
None
-
Community Consensus
-
Crash, Data Packs
-
Normal
-
Platform
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.