While creating the mod https://modrinth.com/mod/no-peaceful-despawn I discovered a vanilla bug.
Slimes do not seem to account for not being in slime chunks when spawned in from monster spawner blocks.
Yarn mappings have this
ChunkPos chunkPos = new ChunkPos(pos);
boolean bl = ChunkRandom.getSlimeRandom(chunkPos.x, chunkPos.z, ((StructureWorldAccess)world).getSeed(), 987234911L).nextInt(10) == 0;
if (random.nextInt(10) == 0 && bl && pos.getY() < 40) {
return canMobSpawn(type, world, spawnReason, pos, random);
}
I went back to confirm this is a bug in vanilla by playing an unmodified version of minecraft and created a test environment in superflat.
How do reproduce the bug:
Create a creative superflat void world with cheats in any version of minecraft such as 1.21.8
Split the spawn platform in half using glass
Place monster spawners down equal distance to the player., one will have magma cubes, and one will have slimes.
Turn the difficulty to hard to increase mob spawns
Turn the time to midnight.
Notice half of the platform has many more magma cubes than slimes.
Environment
Java is version 21.0.5, using 64 (amd64) architecture, from Eclipse Adoptium.
AMD Ryzen 5 5600X 6-Core Processor
Advanced Micro Devices, Inc. [AMD/ATI] Navi 32 [Radeon RX 7700 XT / 7800 XT] (rev c8)
Kernel driver in use: amdgpu
Kernel: Linux 6.16.1-gentoo-wellswole-v15
OpenGL version string: 4.6 (Compatibility Profile) Mesa 25.1.8
OS: Gentoo Linux x86_64
Hi!
Could you upload a video showing this issue?
This ticket will automatically reopen when you reply.