Which command?
/ gamerule doMobSpawning false
/ gamerule doMobSpawning
Have already tried it, animals disappear net.
But no more new ones spawn. So that the old ones disappear
/ kill @e [type =! Player]
(Attention, in older versions you have to capitalize the P of Player!)
So first:
/ gamerule doMobSpawning false
After that:
(Version 1.10. * Or higher)
/ kill @e [type =! Player]
(Version 1.9. * Or lower)
/ kill @e
(All die, including you…)
The kill commands often have to be spammed.
/ gamerule doMobSpawning false
You can also type / kill @e [type =! Player] in the older versions.
Are you the type named LeandergamesYT in Minecraft?
Put your game on Peacefull. Then no more monsters spawn.
I think it's easier than a command.
Edit: If you also want to exhibit animals, you will find the command in the other answers. My mistake.
Why? I have a new name: xLixon
I know you in real life
Really?
Who are you? Write a PM / WhatsApp