I wanna play minecraft without any hostile mobs but only friendly mobs spawn. but, you still get hungry. if i type /gamerule doMobSpawning false, then the friendly mobs will despawn too right? I need Answers for this if it is possible
2 Answers
With that gamerule they would not despawn, but no new ones would spawn. You could set up a command block to kill all hostile mobs as soon as they spawn, but that would drop their loot. You could also kill that loot, but that would make every string or water bottle that you drop in the ground vanish. So I suggest teleporting the mobs down into the void instead.
Put a repeating command block chain near to where you first spawned in the world (can be down in the bedrock) and put these commands in them:
/tp @e[type=elder_guardian] ~ -65 ~
/tp @e[type=wither_skeleton] ~ -65 ~
/tp @e[type=stray] ~ -65 ~
/tp @e[type=husk] ~ -65 ~
/tp @e[type=zombie_villager] ~ -65 ~
/tp @e[type=evocation_illager] ~ -65 ~
/tp @e[type=vindication_illager] ~ -65 ~
/tp @e[type=creeper] ~ -65 ~
/tp @e[type=skeleton] ~ -65 ~
/tp @e[type=spider] ~ -65 ~
/tp @e[type=zombie] ~ -65 ~
/tp @e[type=slime] ~ -65 ~
/tp @e[type=ghast] ~ -65 ~
/tp @e[type=zombie_pigman] ~ -65 ~
/tp @e[type=enderman] ~ -65 ~
/tp @e[type=cave_spider] ~ -65 ~
/tp @e[type=silverfish] ~ -65 ~
/tp @e[type=blaze] ~ -65 ~
/tp @e[type=magma_cube] ~ -65 ~
/tp @e[type=ender_dragon] ~ -65 ~
/tp @e[type=wither] ~ -65 ~
/tp @e[type=witch] ~ -65 ~
/tp @e[type=endermite] ~ -65 ~
/tp @e[type=guardian] ~ -65 ~
/tp @e[type=shulker] ~ -65 ~
/tp @e[type=drowned] ~ -65 ~
/tp @e[type=phantom] ~ -65 ~
/tp @e[type=pillager] ~ -65 ~
/tp @e[type=ravager] ~ -65 ~
If you prefer just one command for this, use this one:
/tp @e[type=!item,type=!xp_orb,type=!area_effect_cloud,type=!leash_knot,type=!painting,type=!item_frame,type=!armor_stand,type=!ender_crystal,type=!egg,type=!arrow,type=!snowball,type=!small_fireball,type=!ender_pearl,type=!eye_of_ender_signal,type=!potion,type=!xp_bottle,type=!fireworks_rocket,type=!spectral_arrow,type=!llama_spit,type=!tnt,type=!falling_block,type=!boat,type=!minecart,type=!chest_minecart,type=!furnace_minecart,type=!tnt_minecart,type=!hopper_minecart,type=!skeleton_horse,type=!donkey,type=!mule,type=!bat,type=!pig,type=!sheep,type=!cow,type=!chicken,type=!squid,type=!wolf,type=!mooshroom,type=!snowman,type=!ocelot,type=!villager_golem,type=!horse,type=!rabbit,type=!polar_bear,type=!llama,type=!parrot,type=!villager,type=!player,type=!lightning_bolt,type=!dolphin,type=!cod,type=!salmon,type=!tropical_fish,type=!pufferfish,type=!turtle,type=!cat,type=!fox,type=!panda,type=!trader_llama,type=!wandering_trader] 0 -65 0
But careful: This command is made in 1.14.0, any entity that gets added after that needs adjustments to the command or else it gets killed.
-
Teleporting flying monsters below bedrock should do just fine if you're playing in Survival with the exception of the ender dragon which can be killed with
/kill
. Commented Aug 12, 2017 at 21:31 -
1One could also use
/tp @e[type=!Player,type=!Pig,type=!Cow,...] ~ 0 ~
for more efficient results. You would also have to exclude entities like Items, XP orbs, and Arrows in this scenario. Commented Aug 12, 2017 at 21:36 -
Hm, one problem I haven't thought of: The dragon would instantly create a portal. But I think if you want an easier game, it would be ok to just have the portal back home from the End instantly unlocked. @GalenNare Correct. I'll edit my answer to also include this second option. Commented Aug 12, 2017 at 22:53
-
Oh wow, my solution doesn't even work. All entities are constantly teleported to 0 0 0, so they are never in the void. I'll fix that. Commented Aug 13, 2017 at 12:55
I've been able to do this using the Bad Mobs mod.
Installation
Make sure you've ran* the desired version of MC at least once. I've done this with 1.12.2.
Download Minecraft Forge for your version of Minecraft.
Run* Minecraft with the forge profile at least once.
Download Bad Mobs and put it inside the mods folder in your Minecraft directory.**
Run* Minecraft with the forge profile at least once.
Edit the file
badmobs.cfg
inside the config folder in your Minecraft directory** using a text editor and add the mobs you want to ban.
My list looks like this:
S:bannedMobs <
minecraft:blaze
minecraft:creeper
minecraft:drowned
minecraft:elder_guardian
minecraft:endermite
minecraft:evoker
minecraft:evoker_fangs
minecraft:ghast
minecraft:guardian
minecraft:husk
minecraft:magma_cube
minecraft:phantom
minecraft:shulker
minecraft:silverfish
minecraft:skeleton
minecraft:slime
minecraft:wither_skeleton
minecraft:stray
minecraft:spider
minecraft:vex
minecraft:vindicator
minecraft:witch
minecraft:zombie
minecraft:zombie_villager
minecraft:cave_spider
>
You might want to include some other mobs, such as endermen and polar bears. The ID's to add to the block list are the Entity ID you can find at the mob's Minecraft Wiki page, prefixed with minecraft:
.
* If you've reached the main menu, you're good.
** Your Minecraft directory is usually ~/.minecraft
on Mac/Linux or %APPDATA%\.minecraft
on Windows