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


Java EntityMob.getCreatureAttribute方法代碼示例

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


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

示例1: updateTick

import net.minecraft.entity.monster.EntityMob; //導入方法依賴的package包/類
@Override
public void updateTick(World world, BlockPos pos, IBlockState state, Random rand)
{
	if (!world.isRemote)
	{
		world.scheduleUpdate(pos, this, 5);
		AxisAlignedBB axisalignedbb = this.getCollisionBoundingBox(world, pos, state).expand(6, 6, 6);
		List<EntityMob> list = world.getEntitiesWithinAABB(EntityMob.class, axisalignedbb);
		for (EntityMob mob : list)
		{
			if (mob.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD)
			{
				mob.setFire(20);
			}
		}
	}
}
 
開發者ID:MinestrapTeam,項目名稱:Minestrappolation-4,代碼行數:18,代碼來源:BlockGodstone.java

示例2: onUpdate

import net.minecraft.entity.monster.EntityMob; //導入方法依賴的package包/類
@Override
public void onUpdate(ItemStack is, World w, Entity e, int i, boolean isHeld) {
	if (w.isRemote || is.getItemDamage() > 0)
		return;
	if (e instanceof EntityLivingBase) {
		final EntityLivingBase sucker = (EntityLivingBase) e;
		if ((sucker.getAge() & 127) == 0)
			if (sucker.getCreatureAttribute() != EnumCreatureAttribute.UNDEAD) {
				final List li = w.getEntitiesWithinAABBExcludingEntity(sucker,
						AxisAlignedBB.getBoundingBox(sucker.posX - 32, sucker.posY - 8, sucker.posZ - 32,
								sucker.posX + 32, sucker.posY + 24, sucker.posZ + 32));
				for (final Object ent : li)
					if (ent instanceof EntityMob) {
						final EntityMob joker = (EntityMob) ent;
						if (joker.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD)
							if (ent instanceof IIaSMobGetters) {
								((IIaSMobGetters) ent).setSearchTarget(sucker);
							} else if (!joker.isInvisible() && joker.getAttackTarget() == null) {
								joker.setTarget(sucker);
							}
					}
			}
	}
	super.onUpdate(is, w, e, i, isHeld);
}
 
開發者ID:TheDaemoness,項目名稱:IceAndShadow2,代碼行數:26,代碼來源:NyxItemAlabaster.java

示例3: shouldDefend

import net.minecraft.entity.monster.EntityMob; //導入方法依賴的package包/類
@Override
public boolean shouldDefend(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, ArmourSlot slot) {
    Entity entity = source.getSourceOfDamage();

    if (entity == null) {
        return false;
    }

    if (!(entity instanceof EntityMob)) {
        return false;
    }

    EntityMob entityMob = (EntityMob) entity;

    return entityMob.getCreatureAttribute() == EnumCreatureAttribute.ARTHROPOD;
}
 
開發者ID:chbachman,項目名稱:ModularArmour,代碼行數:17,代碼來源:UpgradeArthropod.java

示例4: shouldDefend

import net.minecraft.entity.monster.EntityMob; //導入方法依賴的package包/類
@Override
public boolean shouldDefend(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, ArmourSlot slot) {

    Entity entity = source.getSourceOfDamage();

    if (entity == null) {
        return false;
    }

    if (!(entity instanceof EntityMob)) {
        return false;
    }

    EntityMob entityMob = (EntityMob) entity;

    return entityMob.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD;
}
 
開發者ID:chbachman,項目名稱:ModularArmour,代碼行數:18,代碼來源:UpgradeUndead.java


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