Hello I am making a Datapack and need to change the mob spawn algorithm? What I really need is to make any mob that never will spawn in a specific biome to be able to spawn.
An example: slimes they spawn in any slime chunk below Y40 and in swamps with the moon as the spawn factor. Ok I want to also spawn in Desert biome also using the moon factor. This is add slime spawns to all desert biomes. Or an other example I want to add lamas, cows, pigs, etc any other mob to a desert.
I say desert as is one of the most restricted biomes but it may be also an example if I want to Skeletons, zombies, etc to spawn in the end for example and not just Enderman. Or maybe reduce/increase the light level so creepers can only spawn if light levels are 3 or less (not 7 as is now).
I don't know much about commands but you can use commands to replace existing mobs (check for the mob, then remove it and spawn the desired mob at its location, adding a tag to it that tells it not to check again). For example, I found this video with a quick search (albeit for an older version, so commands may need to be changed):
I didn't find anything regarding reading the moon phase directly but if you have access to the current time you can convert it to a moon phase (a new moon is 0-23999 with each subsequent phase adding 24000 to these numbers, repeating after 8 days or 192000 ticks).