當前位置: 首頁>>代碼示例>>Java>>正文


Java EntityVillager.setLookingForHome方法代碼示例

本文整理匯總了Java中net.minecraft.entity.passive.EntityVillager.setLookingForHome方法的典型用法代碼示例。如果您正苦於以下問題:Java EntityVillager.setLookingForHome方法的具體用法?Java EntityVillager.setLookingForHome怎麽用?Java EntityVillager.setLookingForHome使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraft.entity.passive.EntityVillager的用法示例。


在下文中一共展示了EntityVillager.setLookingForHome方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: convertToVillager

import net.minecraft.entity.passive.EntityVillager; //導入方法依賴的package包/類
/**
 * Convert this zombie into a villager.
 */
protected void convertToVillager()
{
    EntityVillager entityvillager = new EntityVillager(this.worldObj);
    entityvillager.copyLocationAndAnglesFrom(this);
    entityvillager.onInitialSpawn(this.worldObj.getDifficultyForLocation(new BlockPos(entityvillager)), (IEntityLivingData)null);
    entityvillager.setLookingForHome();

    if (this.isChild())
    {
        entityvillager.setGrowingAge(-24000);
    }

    this.worldObj.removeEntity(this);
    entityvillager.setNoAI(this.isAIDisabled());

    if (this.hasCustomName())
    {
        entityvillager.setCustomNameTag(this.getCustomNameTag());
        entityvillager.setAlwaysRenderNameTag(this.getAlwaysRenderNameTag());
    }

    this.worldObj.spawnEntityInWorld(entityvillager);
    entityvillager.addPotionEffect(new PotionEffect(Potion.confusion.id, 200, 0));
    this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1017, new BlockPos((int)this.posX, (int)this.posY, (int)this.posZ), 0);
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:29,代碼來源:EntityZombie.java

示例2: convertToVillager

import net.minecraft.entity.passive.EntityVillager; //導入方法依賴的package包/類
@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);
}
 
開發者ID:jm-organization,項目名稱:connor41-etfuturum2,代碼行數:17,代碼來源:EntityZombieVillager.java

示例3: func_190738_dp

import net.minecraft.entity.passive.EntityVillager; //導入方法依賴的package包/類
protected void func_190738_dp()
{
    EntityVillager entityvillager = new EntityVillager(this.world);
    entityvillager.copyLocationAndAnglesFrom(this);
    entityvillager.setProfession(this.func_190736_dl());
    entityvillager.func_190672_a(this.world.getDifficultyForLocation(new BlockPos(entityvillager)), (IEntityLivingData)null, false);
    entityvillager.setLookingForHome();

    if (this.isChild())
    {
        entityvillager.setGrowingAge(-24000);
    }

    this.world.removeEntity(this);
    entityvillager.setNoAI(this.isAIDisabled());

    if (this.hasCustomName())
    {
        entityvillager.setCustomNameTag(this.getCustomNameTag());
        entityvillager.setAlwaysRenderNameTag(this.getAlwaysRenderNameTag());
    }

    this.world.spawnEntityInWorld(entityvillager);
    entityvillager.addPotionEffect(new PotionEffect(MobEffects.NAUSEA, 200, 0));
    this.world.playEvent((EntityPlayer)null, 1027, new BlockPos((int)this.posX, (int)this.posY, (int)this.posZ), 0);
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:27,代碼來源:EntityZombieVillager.java

示例4: convertToVillager

import net.minecraft.entity.passive.EntityVillager; //導入方法依賴的package包/類
/**
 * Convert this zombie into a villager.
 */
protected void convertToVillager()
{
    EntityVillager entityvillager = new EntityVillager(this.worldObj);
    entityvillager.copyLocationAndAnglesFrom(this);
    entityvillager.onInitialSpawn(this.worldObj.getDifficultyForLocation(new BlockPos(entityvillager)), (IEntityLivingData)null);
    entityvillager.setLookingForHome();

    if (this.isChild())
    {
        entityvillager.setGrowingAge(-24000);
    }

    this.worldObj.removeEntity(this);
    entityvillager.setNoAI(this.isAIDisabled());
    if (this.getVillagerTypeForge() != null)
        entityvillager.setProfession(this.getVillagerTypeForge());
    else
        entityvillager.setProfession(0);

    if (this.hasCustomName())
    {
        entityvillager.setCustomNameTag(this.getCustomNameTag());
        entityvillager.setAlwaysRenderNameTag(this.getAlwaysRenderNameTag());
    }

    this.worldObj.spawnEntityInWorld(entityvillager);
    entityvillager.addPotionEffect(new PotionEffect(MobEffects.NAUSEA, 200, 0));
    this.worldObj.playEvent((EntityPlayer)null, 1027, new BlockPos((int)this.posX, (int)this.posY, (int)this.posZ), 0);
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:33,代碼來源:EntityZombie.java


注:本文中的net.minecraft.entity.passive.EntityVillager.setLookingForHome方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。