当前位置: 首页>>代码示例>>Java>>正文


Java EntityAIAttackMelee类代码示例

本文整理汇总了Java中net.minecraft.entity.ai.EntityAIAttackMelee的典型用法代码示例。如果您正苦于以下问题:Java EntityAIAttackMelee类的具体用法?Java EntityAIAttackMelee怎么用?Java EntityAIAttackMelee使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


EntityAIAttackMelee类属于net.minecraft.entity.ai包,在下文中一共展示了EntityAIAttackMelee类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initEntityAI

import net.minecraft.entity.ai.EntityAIAttackMelee; //导入依赖的package包/类
protected void initEntityAI()
{
    this.aiSit = new EntityAISit(this);
    this.tasks.addTask(1, new EntityAISwimming(this));
    this.tasks.addTask(2, this.aiSit);
    this.tasks.addTask(3, new EntityWolf.AIAvoidEntity(this, EntityLlama.class, 24.0F, 1.5D, 1.5D));
    this.tasks.addTask(4, new EntityAILeapAtTarget(this, 0.4F));
    this.tasks.addTask(5, new EntityAIAttackMelee(this, 1.0D, true));
    this.tasks.addTask(6, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F));
    this.tasks.addTask(7, new EntityAIMate(this, 1.0D));
    this.tasks.addTask(8, new EntityAIWanderAvoidWater(this, 1.0D));
    this.tasks.addTask(9, new EntityAIBeg(this, 8.0F));
    this.tasks.addTask(10, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
    this.tasks.addTask(10, new EntityAILookIdle(this));
    this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this));
    this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this));
    this.targetTasks.addTask(3, new EntityAIHurtByTarget(this, true, new Class[0]));
    this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntityAnimal.class, false, new Predicate<Entity>()
    {
        public boolean apply(@Nullable Entity p_apply_1_)
        {
            return p_apply_1_ instanceof EntitySheep || p_apply_1_ instanceof EntityRabbit;
        }
    }));
    this.targetTasks.addTask(5, new EntityAINearestAttackableTarget(this, AbstractSkeleton.class, false));
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:27,代码来源:EntityWolf.java

示例2: initEntityAI

import net.minecraft.entity.ai.EntityAIAttackMelee; //导入依赖的package包/类
protected void initEntityAI()
{
    this.tasks.addTask(0, new EntityAISwimming(this));
    this.tasks.addTask(2, new EntityAIAttackMelee(this, 1.0D, false));
    this.tasks.addTask(7, new EntityAIWanderAvoidWater(this, 1.0D, 0.0F));
    this.tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
    this.tasks.addTask(8, new EntityAILookIdle(this));
    this.tasks.addTask(10, new EntityEnderman.AIPlaceBlock(this));
    this.tasks.addTask(11, new EntityEnderman.AITakeBlock(this));
    this.targetTasks.addTask(1, new EntityEnderman.AIFindPlayer(this));
    this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false, new Class[0]));
    this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityEndermite.class, 10, true, false, new Predicate<EntityEndermite>()
    {
        public boolean apply(@Nullable EntityEndermite p_apply_1_)
        {
            return p_apply_1_.isSpawnedByPlayer();
        }
    }));
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:20,代码来源:EntityEnderman.java

示例3: initEntityAI

import net.minecraft.entity.ai.EntityAIAttackMelee; //导入依赖的package包/类
protected void initEntityAI()
{
    this.tasks.addTask(1, new EntityAIAttackMelee(this, 1.0D, true));
    this.tasks.addTask(2, new EntityAIMoveTowardsTarget(this, 0.9D, 32.0F));
    this.tasks.addTask(3, new EntityAIMoveThroughVillage(this, 0.6D, true));
    this.tasks.addTask(4, new EntityAIMoveTowardsRestriction(this, 1.0D));
    this.tasks.addTask(5, new EntityAILookAtVillager(this));
    this.tasks.addTask(6, new EntityAIWanderAvoidWater(this, 0.6D));
    this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
    this.tasks.addTask(8, new EntityAILookIdle(this));
    this.targetTasks.addTask(1, new EntityAIDefendVillage(this));
    this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false, new Class[0]));
    this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityLiving.class, 10, false, true, new Predicate<EntityLiving>()
    {
        public boolean apply(@Nullable EntityLiving p_apply_1_)
        {
            return p_apply_1_ != null && IMob.VISIBLE_MOB_SELECTOR.apply(p_apply_1_) && !(p_apply_1_ instanceof EntityCreeper);
        }
    }));
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:21,代码来源:EntityIronGolem.java

示例4: initEntityAI

import net.minecraft.entity.ai.EntityAIAttackMelee; //导入依赖的package包/类
protected void initEntityAI()
{
    this.aiSit = new EntityAISit(this);
    this.tasks.addTask(1, new EntityAISwimming(this));
    this.tasks.addTask(2, this.aiSit);
    this.tasks.addTask(3, new EntityAILeapAtTarget(this, 0.4F));
    this.tasks.addTask(4, new EntityAIAttackMelee(this, 1.0D, true));
    this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F));
    this.tasks.addTask(6, new EntityAIMate(this, 1.0D));
    this.tasks.addTask(7, new EntityAIWander(this, 1.0D));
    this.tasks.addTask(8, new EntityAIBeg(this, 8.0F));
    this.tasks.addTask(9, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
    this.tasks.addTask(9, new EntityAILookIdle(this));
    this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this));
    this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this));
    this.targetTasks.addTask(3, new EntityAIHurtByTarget(this, true, new Class[0]));
    this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntityAnimal.class, false, new Predicate<Entity>()
    {
        public boolean apply(@Nullable Entity p_apply_1_)
        {
            return p_apply_1_ instanceof EntitySheep || p_apply_1_ instanceof EntityRabbit;
        }
    }));
    this.targetTasks.addTask(5, new EntityAINearestAttackableTarget(this, EntitySkeleton.class, false));
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:26,代码来源:EntityWolf.java

示例5: initEntityAI

import net.minecraft.entity.ai.EntityAIAttackMelee; //导入依赖的package包/类
protected void initEntityAI()
{
    this.tasks.addTask(0, new EntityAISwimming(this));
    this.tasks.addTask(2, new EntityAIAttackMelee(this, 1.0D, false));
    this.tasks.addTask(7, new EntityAIWander(this, 1.0D));
    this.tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
    this.tasks.addTask(8, new EntityAILookIdle(this));
    this.tasks.addTask(10, new EntityEnderman.AIPlaceBlock(this));
    this.tasks.addTask(11, new EntityEnderman.AITakeBlock(this));
    this.targetTasks.addTask(1, new EntityEnderman.AIFindPlayer(this));
    this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false, new Class[0]));
    this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityEndermite.class, 10, true, false, new Predicate<EntityEndermite>()
    {
        public boolean apply(@Nullable EntityEndermite p_apply_1_)
        {
            return p_apply_1_.isSpawnedByPlayer();
        }
    }));
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:20,代码来源:EntityEnderman.java

示例6: initEntityAI

import net.minecraft.entity.ai.EntityAIAttackMelee; //导入依赖的package包/类
protected void initEntityAI()
{
    this.tasks.addTask(1, new EntityAIAttackMelee(this, 1.0D, true));
    this.tasks.addTask(2, new EntityAIMoveTowardsTarget(this, 0.9D, 32.0F));
    this.tasks.addTask(3, new EntityAIMoveThroughVillage(this, 0.6D, true));
    this.tasks.addTask(4, new EntityAIMoveTowardsRestriction(this, 1.0D));
    this.tasks.addTask(5, new EntityAILookAtVillager(this));
    this.tasks.addTask(6, new EntityAIWander(this, 0.6D));
    this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
    this.tasks.addTask(8, new EntityAILookIdle(this));
    this.targetTasks.addTask(1, new EntityAIDefendVillage(this));
    this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false, new Class[0]));
    this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityLiving.class, 10, false, true, new Predicate<EntityLiving>()
    {
        public boolean apply(@Nullable EntityLiving p_apply_1_)
        {
            return p_apply_1_ != null && IMob.VISIBLE_MOB_SELECTOR.apply(p_apply_1_) && !(p_apply_1_ instanceof EntityCreeper);
        }
    }));
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:21,代码来源:EntityIronGolem.java

示例7: initEntityAI

import net.minecraft.entity.ai.EntityAIAttackMelee; //导入依赖的package包/类
protected void initEntityAI() {
	areaAI = new EntityAIMoveIntoArea(this, 0.5D, 30);
	tasks.addTask(0, new EntityAISwimming(this));
	tasks.addTask(2, new EntityAIAttackMelee(this, 0.6D, false));
	tasks.addTask(4, areaAI);
	tasks.addTask(7, new EntityAIWander(this, 0.35D));
	tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
	tasks.addTask(8, new EntityAILookIdle(this));

	targetTasks.addTask(2, new EntityAINearestAttackableCivTarget(this));
	targetTasks.addTask(3, new EntityAINearestAttackableTarget<EntityMob>(this, EntityMob.class, 10, false, false, new Predicate<EntityMob>() {
		@Override
		public boolean apply(EntityMob target) {
			return !(target instanceof EntityCreeper);
		}
	}));
}
 
开发者ID:ToroCraft,项目名称:ToroQuest,代码行数:18,代码来源:EntityGuard.java

示例8: EntityDamnedWarrior

import net.minecraft.entity.ai.EntityAIAttackMelee; //导入依赖的package包/类
public EntityDamnedWarrior(World world) {
        super(world);


//        this.tasks.addTask(2, new EntityAIRestrictSun(this));
//        this.tasks.addTask(5, new EntityAIWander(this, 1));
//        this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 10));
//        this.tasks.addTask(7, new EntityAILookIdle(this));
//
//
//        this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, new Class[0]));
//        this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
//        this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityIronGolem.class, true));
//
        if (world != null && !world.isRemote) {
            this.tasks.addTask(4, new EntityAIAttackMelee(this, 1.2D, false));
        }
    }
 
开发者ID:NightKosh,项目名称:Gravestone-mod-Extended,代码行数:19,代码来源:EntityDamnedWarrior.java

示例9: EntityGendrome

import net.minecraft.entity.ai.EntityAIAttackMelee; //导入依赖的package包/类
public EntityGendrome(World worldIn) {
    super(worldIn, Config.scaleMin*0.75f, Config.scaleMax*0.75f);
    this.setSize(2.25F, 2.5F);
    setBaseHealth(300);
    setBaseAttack(2*1.5);
    setBaseSpeed(0.3*1.5);
    setBaseKnockback(0.5*1.5);
    this.tasks.addTask(1, new EntityAILeapAtTarget(this,0.5f));
    this.tasks.addTask(4, new EntityAIAttackMelee(this, 1.0D, false));
    this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityVillager.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityAnimal.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityWitch.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityMHHerbivore.class, true));
}
 
开发者ID:alxnns1,项目名称:MobHunter,代码行数:17,代码来源:EntityGendrome.java

示例10: EntityJaggia

import net.minecraft.entity.ai.EntityAIAttackMelee; //导入依赖的package包/类
public EntityJaggia(World worldIn)
{
    super(worldIn, 1, 1, Items.FISH);
    this.setSize(1.5F, 1.8125F);
    setBaseHealth(12);
    setBaseAttack(2);
    setBaseSpeed(0.3);
    setBaseKnockback(0.1);
    this.tasks.addTask(1, new EntityAILeapAtTarget(this,0.5f));
    this.tasks.addTask(4, new EntityAIAttackMelee(this, 1.0D, false));
    this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityVillager.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityAnimal.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityWitch.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityMHHerbivore.class, true));
}
 
开发者ID:alxnns1,项目名称:MobHunter,代码行数:18,代码来源:EntityJaggia.java

示例11: EntityGenprey

import net.minecraft.entity.ai.EntityAIAttackMelee; //导入依赖的package包/类
public EntityGenprey(World worldIn)
{
    super(worldIn, 1, 1);
    this.setSize(1.5F, 1.8125F);
    setBaseHealth(12);
    setBaseAttack(2);
    setBaseSpeed(0.3);
    setBaseKnockback(0.1);
    this.tasks.addTask(1, new EntityAILeapAtTarget(this,0.5f));
    this.tasks.addTask(4, new EntityAIAttackMelee(this, 1.0D, false));
    this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityVillager.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityAnimal.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityWitch.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityMHHerbivore.class, true));
}
 
开发者ID:alxnns1,项目名称:MobHunter,代码行数:18,代码来源:EntityGenprey.java

示例12: EntityVelocidrome

import net.minecraft.entity.ai.EntityAIAttackMelee; //导入依赖的package包/类
public EntityVelocidrome(World worldIn)
{
    super(worldIn, Config.scaleMin*0.75f, Config.scaleMax*0.75f);
    this.setSize(2.25F, 2.5F);
    setBaseHealth(300);
    setBaseAttack(2*1.5);
    setBaseSpeed(0.3*1.5);
    setBaseKnockback(0.5*1.5);
    this.tasks.addTask(1, new EntityAILeapAtTarget(this,0.5f));
    this.tasks.addTask(4, new EntityAIAttackMelee(this, 1.0D, false));
    this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityVillager.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityAnimal.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityWitch.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityMHHerbivore.class, true));
}
 
开发者ID:alxnns1,项目名称:MobHunter,代码行数:18,代码来源:EntityVelocidrome.java

示例13: EntityJaggi

import net.minecraft.entity.ai.EntityAIAttackMelee; //导入依赖的package包/类
public EntityJaggi(World worldIn)
{
    super(worldIn, 1, 1, Items.FISH);
    this.setSize(1.0F, 1.0F);
    setBaseHealth(9);
    setBaseAttack(2);
    setBaseSpeed(0.3);
    setBaseKnockback(0.1);
    this.tasks.addTask(1, new EntityAILeapAtTarget(this,0.5f));
    this.tasks.addTask(4, new EntityAIAttackMelee(this, 1.0D, false));
    this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityVillager.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityAnimal.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityWitch.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityMHHerbivore.class, true));
}
 
开发者ID:alxnns1,项目名称:MobHunter,代码行数:18,代码来源:EntityJaggi.java

示例14: EntityGreatJaggi

import net.minecraft.entity.ai.EntityAIAttackMelee; //导入依赖的package包/类
public EntityGreatJaggi(World worldIn)
{
    super(worldIn, Config.scaleMin*0.75f, Config.scaleMax*0.75f);
    this.setSize(2.25F, 2.5F);
    setBaseHealth(390);
    setBaseAttack(2*1.5);
    setBaseSpeed(0.3*1.5);
    setBaseKnockback(0.5*1.5);
    this.tasks.addTask(1, new EntityAILeapAtTarget(this,0.5f));
    this.tasks.addTask(4, new EntityAIAttackMelee(this, 1.0D, false));
    this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityVillager.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityAnimal.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityWitch.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityMHHerbivore.class, true));
}
 
开发者ID:alxnns1,项目名称:MobHunter,代码行数:18,代码来源:EntityGreatJaggi.java

示例15: EntityVelociprey

import net.minecraft.entity.ai.EntityAIAttackMelee; //导入依赖的package包/类
public EntityVelociprey(World worldIn)
{
    super(worldIn, 1,1);
    this.setSize(1.5F, 1.8125F);
    setBaseHealth(10);
    setBaseAttack(2);
    setBaseSpeed(0.3);
    setBaseKnockback(0.1);
    this.tasks.addTask(1, new EntityAILeapAtTarget(this,0.5f));
    this.tasks.addTask(4, new EntityAIAttackMelee(this, 1.0D, false));
    this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityVillager.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityAnimal.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityWitch.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityMHHerbivore.class, true));
}
 
开发者ID:alxnns1,项目名称:MobHunter,代码行数:18,代码来源:EntityVelociprey.java


注:本文中的net.minecraft.entity.ai.EntityAIAttackMelee类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。