Kemanorel Posted February 21, 2019 Share Posted February 21, 2019 Myself and the group I play with heavily dislike baby zombies so I decided to try to remove them. However, whenever I test it by spawning a bunch of zombies, I still get a few babies in there. This is the code being used. Spoiler package kemanorel.nomorebabyzombies.common; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.event.FMLInitializationEvent; @Mod (modid = CancelBabyZombies.MODID, name = CancelBabyZombies.NAME, version = CancelBabyZombies.VERSION) public class CancelBabyZombies { public static final String MODID = "nomorebabyzombies"; public static final String NAME = "No More Baby Zombies"; public static final String VERSION = "1.0"; @EventHandler public void init(FMLInitializationEvent event) { MinecraftForge.EVENT_BUS.register(new SpawnHandler()); } } Spoiler package kemanorel.nomorebabyzombies.common; import net.minecraft.entity.monster.EntityMob; import net.minecraft.entity.monster.EntityZombie; import net.minecraftforge.event.entity.living.LivingSpawnEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; public class SpawnHandler { @SubscribeEvent public void onEntitySpawn(LivingSpawnEvent event) { if (event.getEntity() instanceof EntityMob) if (event.getEntity() instanceof EntityZombie) { EntityZombie zombie = (EntityZombie)event.getEntity(); if (zombie.isChild()) zombie.setChild(false); } } } Quote Link to comment Share on other sites More sharing options...
quadraxis Posted February 21, 2019 Share Posted February 21, 2019 Forge already provides a config option: # Chance that a zombie (or subclass) is a baby. Allows changing the zombie spawning mechanic. D:zombieBabyChance=0.05 Quote Link to comment Share on other sites More sharing options...
Kemanorel Posted February 21, 2019 Author Share Posted February 21, 2019 Huh, well, now I know why there aren't mods around for it. Thanks for letting me know. Quote Link to comment Share on other sites More sharing options...
agggg Posted May 20, 2022 Share Posted May 20, 2022 On 2/22/2019 at 2:42 AM, quadraxis said: Forge already provides a config option: # Chance that a zombie (or subclass) is a baby. Allows changing the zombie spawning mechanic. D:zombieBabyChance=0.05 hello, i'm planning to play offline survival game without baby zombie in 1.16.5. i can't find mods nor any settings available to disable these baby zombies from spawning. Quote Link to comment Share on other sites More sharing options...
MFMods Posted May 20, 2022 Share Posted May 20, 2022 (edited) in serverconfig directory under your world save directory, find forge-server.toml set the chance to 0. those damn things shouldn't exist. Edited May 20, 2022 by MFMods Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.