OrangeVillager61 Posted July 25, 2016 Posted July 25, 2016 When my custom villager dies it turns into a regular zombie instead of turning into a zombie villager. My custom villager class. package orangeVillager61.MoDrops.villager; import net.minecraft.entity.passive.EntityVillager; import net.minecraft.entity.passive.EntityVillager.EmeraldForItems; import net.minecraft.entity.passive.EntityVillager.ListItemForEmeralds; import net.minecraft.entity.passive.EntityVillager.PriceInfo; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.event.entity.EntityEvent; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.registry.VillagerRegistry; import net.minecraftforge.fml.common.registry.VillagerRegistry.VillagerCareer; import net.minecraftforge.fml.common.registry.VillagerRegistry.VillagerProfession; import orangeVillager61.MoDrops.Config; import orangeVillager61.MoDrops.items.MoDropsItems; public class BioMaker{ public static final boolean enableSaltTrader = Config.enableCustomVillagers; public static ItemStack Charcoal = new ItemStack (Items.COAL, 1, 1); protected static final VillagerRegistry.VillagerProfession PROFESSION = new VillagerRegistry.VillagerProfession("md:BioMaker", "minecraft:textures/entity/villager/villager.png", "md:textures/entity/zombie_bioMaker.png"); protected static final VillagerRegistry.VillagerCareer CAREER = new VillagerRegistry.VillagerCareer(PROFESSION, "md:BioMaker").addTrade(3, new ListItemForEmeralds(MoDropsItems.adaptive_egg, new PriceInfo(26, 33))).addTrade(1, new EmeraldForItems(Items.GOLD_INGOT, new PriceInfo(8, 9))).addTrade(1, new ListItemForEmeralds(MoDropsItems.biomatter, new PriceInfo(1, 1))).addTrade(2, new ListItemForEmeralds(MoDropsItems.compressed_biomatter, new PriceInfo(8, 10))) .addTrade(2, new ListItemForEmeralds(Charcoal, new PriceInfo(1, 3))); public static void onInit(FMLInitializationEvent event){ VillagerRegistry.instance().register(PROFESSION); } } Quote
Xawolf Posted August 19, 2016 Posted August 19, 2016 Well, you should add the code: public void onDeath(DamageSource par1DamageSource) { if (!this.worldObj.isRemote) { EntityZombie entityzombie = new EntityZombie(this.worldObj); entityzombie.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); this.worldObj.spawnEntityInWorld(entityzombie); this.setDead(); } } Haven't tried it myself, but this should work. If it doesn't look into zombie meta data. Quote
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.