Mobs spawn between 24 and 128 blocks (spherically) of you. The spawn wiki page has a very good image showing the ranges of how far mobs will spawn and despawn.
If you're standing in the middle of a 40 square desert, a good third of that is not spawnable due to your presence.
Also be aware of the spawning caps.
Hypixel SkyBlock how to get Ender Pearls for Minion
Apparently there's a limit of 70-80 hostile mobs (many of which may be underground.
Try this: before night, go up into the sky to at least ~100 blocks above your desert. This should despawn the underground.
As night falls, go back down to an altitude of ~20-25 blocks. This should keep the influence of your presence to a minimum on the ground level.
If you see more than 50 enemies, either kill or despawn them to stay below cap.
answered Jun 20 '12 at 18:34
21.3k77 gold badges6464 silver badges118118 bronze badges