Jump to content

Rivello

Members
  • Posts

    2
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Rivello's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. For those who might be interested, we came to a solution in this post on the minecraft forums: http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/modification-development/2212981-help-removing-baby-and-armored-zombies In short, "EntityJoinWorldEvent" happens BEFORE the spawn and before the function that set the age and armor of the zombies. For that reason we should remove the armor and set to adult on the "LivingSpawnEvent", which happens AFTER the zombie was already set up and spawned.
  2. Hi folks, I want to make a mod where there are only zombies, not babies neither armored. Only normal "naked" adult zombies. I managed to cancel the spawning of all other mobs, and once I even made all babies grow with setChild(false), but once I started trying cancelling the spawn of the armored ones, nothing else works. I'm completely new to Java and modding, but not to programming. Here is my code (yes, started from the example, lol): It currently just lets zombies spawn (OK) but the babies and armored keeps coming, even if I setCanceled instead of trying to correct them. public class ExampleMod { public static final String MODID = "examplemod"; public static final String VERSION = "1.0"; @EventHandler public void init(FMLInitializationEvent event) { MinecraftForge.EVENT_BUS.register(new SpawnHandler()); } } public class SpawnHandler { @SubscribeEvent public void onEntitySpawn(EntityJoinWorldEvent event) { if( event.entity instanceof EntityMob ) { if ( !(event.entity instanceof EntityZombie) ) { event.setCanceled(true); } else { EntityZombie Mr_zombie = (EntityZombie) event.entity; if ( Mr_zombie.isChild() ) { Mr_zombie.setChild(false); } ItemStack itemstack = Mr_zombie.getEquipmentInSlot(4); if (itemstack != null) { Mr_zombie.setCurrentItemOrArmor(4, (ItemStack)null); } } } } } Help!
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.