The slime.json spawn rules that was created to fix MCPE-153502 has multiple mistakes that break parity with Java Edition:
For spawns in slime chunks:
It allows slimes to spawn at Y = 40 and Y = 41.
It does not allow slime chunk spawns in swamps.
For spawns near sea level/surface in swamps:
It allows slimes to spawn at Y = 70 and Y = 71.
It allows slimes to spawn in all light levels.
Steps to reproduce
Open
. It contains a slime chunk cleared out down to slime spawn range from X 16 to 31 and Z -17 to -32 and a lever that toggles the top floor of the chunk between Y 38 and Y 40. All existing slimes are send to the void whenever you toggle the floors.
Observe the chunk for a minute or two, toggle the floors, and observe for another minute or two.
Open
. It contains a swamp-only world with several platforms between Y 49 and Y 70 and a slime chunk platform at X 16 to 31 and Z -17 to -32. A repeating command block constantly kills all non-slime mobs. The command block with a lever at Y 76 can be used to send all slimes to the void.
Observe each of the platforms for a few minutes at midnight and at noon, clearing slimes when they build up.
Expected results
Java parity:
In slime chunks, slimes spawn no higher than in Y 39 (on Y 38).
In swamps, slimes spawn in the slime chunk below Y 40.
In swamps, slimes spawn no higher than in Y 69 (on Y 68).
In swamps, slimes spawn in Y 51 to 69 only where the light level is 0 to 7.
Observed results
In slime chunks, slimes spawn as high as in Y 41 (on Y 40).
In swamps, slimes do not spawn in the slime chunk below Y 40.
In swamps, slimes spawn as high as in Y 71 (on Y 70).
In swamps, slimes spawn in Y 51 to 71 at all light levels.
The mistakes regarding Y-level reflect misunderstanding of the data-driven
minecraft:height_filter
component. This component sets the range for blocks that the mob can spawn on top of, as I explained in my comments on MCPE-150191.The mistake allowing slimes to spawn in all light levels near the swamp surface would seem to be due to the special light level requirement for slime swamp spawns being removed from the hard-coded slime spawn rules but not re-added to the data-driven rules. (Note: Java parity would be that this light filter does not adjust for weather.)
The disallowing of slime chunk spawns is strange:
Using the 1.19.10.20 Preview vanillla spawn rules, slimes do not spawn in slime chunks below Y 40 because swamps are explicitly disallowed from the the Y -64 to Y 40 rule set.
If I remove the part of the biome filter that excludes swamps from the Y -64 to Y 40 rule set and add the light requirement to the rule set for swamp spawning, then slimes spawn correctly in slime chunks in swamps where the light level is > 7.
However, using the same spawn rules, slimes spawn below Y 40 in all chunks in swamps where the light level is < 8.
These results suggest that the
height_filter
from the first set of spawn rules is being added to the second set of spawn rules, or conversely that thebrightness_filter
from the second set is being added to the first. This is not how I would expect the spawn rules to work; I would expect each set of rules to be checked separately.The spawn rules file I used is
[media]. It gives the expected result in 1.18.31. That makes me think that too many hard-coded slime spawn rules were removed in 1.19.10.20.