Java Code Examples for net.minecraft.entity.passive.EntityVillager#setProfession()

The following examples show how to use net.minecraft.entity.passive.EntityVillager#setProfession() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: EntityZombieVillager.java    From Et-Futurum with The Unlicense 6 votes vote down vote up
@Override
protected void convertToVillager() {
	EntityVillager villager = new EntityVillager(worldObj);
	villager.copyLocationAndAnglesFrom(this);
	villager.onSpawnWithEgg((IEntityLivingData) null);
	villager.setLookingForHome();
	villager.setProfession(getType());

	if (isChild())
		villager.setGrowingAge(-24000);

	worldObj.removeEntity(this);
	worldObj.spawnEntityInWorld(villager);
	villager.addPotionEffect(new PotionEffect(Potion.confusion.id, 200, 0));
	worldObj.playAuxSFXAtEntity(null, 1017, (int) posX, (int) posY, (int) posZ, 0);
}
 
Example 2
Source File: IntegratorPressureChamber.java    From PneumaticCraft with GNU General Public License v3.0 5 votes vote down vote up
private void handleVillagers(int x, int y, List<IWidget> locatedTextures){
    locatedTextures.add(new LocatedEntity(EntityVillager.class, x + 70, y + 95, 2F));

    LocatedEntity locatedEntity = new LocatedEntity(EntityVillager.class, x + 215, y + 125, 2F);
    EntityVillager villager = (EntityVillager)locatedEntity.entity;
    villager.setProfession(Config.villagerMechanicID);
    locatedTextures.add(locatedEntity);
}