Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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);
        

    }
}

  • 4 weeks later...

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.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.