Minecraft Bedrock Edition players can edit their world settings under “Game” and uncheck the box next to “Mob Spawning.” Java Edition players can type “/gamerule doMobSpawning false” into the chat bar ...
When you first spawn in Minecraft, several mobs spawn around you. However, when you leave an area and return to it, you will notice that some new mobs spawn, while some older ones disappear.