本文整理汇总了Java中net.minecraft.entity.ai.EntityAITargetNonTamed类的典型用法代码示例。如果您正苦于以下问题:Java EntityAITargetNonTamed类的具体用法?Java EntityAITargetNonTamed怎么用?Java EntityAITargetNonTamed使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EntityAITargetNonTamed类属于net.minecraft.entity.ai包,在下文中一共展示了EntityAITargetNonTamed类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: EntityOcelot
import net.minecraft.entity.ai.EntityAITargetNonTamed; //导入依赖的package包/类
public EntityOcelot(World worldIn)
{
super(worldIn);
this.setSize(0.6F, 0.7F);
((PathNavigateGround)this.getNavigator()).setAvoidsWater(true);
this.tasks.addTask(1, new EntityAISwimming(this));
this.tasks.addTask(2, this.aiSit);
this.tasks.addTask(3, this.aiTempt = new EntityAITempt(this, 0.6D, Items.fish, true));
this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 5.0F));
this.tasks.addTask(6, new EntityAIOcelotSit(this, 0.8D));
this.tasks.addTask(7, new EntityAILeapAtTarget(this, 0.3F));
this.tasks.addTask(8, new EntityAIOcelotAttack(this));
this.tasks.addTask(9, new EntityAIMate(this, 0.8D));
this.tasks.addTask(10, new EntityAIWander(this, 0.8D));
this.tasks.addTask(11, new EntityAIWatchClosest(this, EntityPlayer.class, 10.0F));
this.targetTasks.addTask(1, new EntityAITargetNonTamed(this, EntityChicken.class, false, (Predicate)null));
}
示例2: spawnEvent
import net.minecraft.entity.ai.EntityAITargetNonTamed; //导入依赖的package包/类
@SubscribeEvent
public void spawnEvent(EntityJoinWorldEvent event) {
if (event.entity instanceof EntityPig) {
EntityPig pig = (EntityPig) event.entity;
if (EtFuturum.enableBeetroot)
pig.tasks.addTask(4, new EntityAITempt(pig, 1.2, ModItems.beetroot, false));
} else if (event.entity instanceof EntityChicken) {
EntityChicken chicken = (EntityChicken) event.entity;
if (EtFuturum.enableBeetroot)
chicken.tasks.addTask(3, new EntityAITempt(chicken, 1.0D, ModItems.beetroot_seeds, false));
} else if (event.entity instanceof EntityWolf) {
EntityWolf wolf = (EntityWolf) event.entity;
if (EtFuturum.enableRabbit)
wolf.targetTasks.addTask(4, new EntityAITargetNonTamed(wolf, EntityRabbit.class, 200, false));
} else if (event.entity instanceof EntityVillager) {
EntityVillager villager = (EntityVillager) event.entity;
for (Object obj : villager.tasks.taskEntries) {
EntityAITaskEntry entry = (EntityAITaskEntry) obj;
if (entry.action instanceof EntityAIOpenDoor) {
villager.tasks.removeTask(entry.action);
villager.tasks.addTask(entry.priority, new EntityAIOpenCustomDoor(villager, true));
break;
}
}
}
}
示例3: initEntityAI
import net.minecraft.entity.ai.EntityAITargetNonTamed; //导入依赖的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));
}
示例4: initEntityAI
import net.minecraft.entity.ai.EntityAITargetNonTamed; //导入依赖的package包/类
protected void initEntityAI()
{
this.aiSit = new EntityAISit(this);
this.aiTempt = new EntityAITempt(this, 0.6D, Items.FISH, true);
this.tasks.addTask(1, new EntityAISwimming(this));
this.tasks.addTask(2, this.aiSit);
this.tasks.addTask(3, this.aiTempt);
this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 5.0F));
this.tasks.addTask(6, new EntityAIOcelotSit(this, 0.8D));
this.tasks.addTask(7, new EntityAILeapAtTarget(this, 0.3F));
this.tasks.addTask(8, new EntityAIOcelotAttack(this));
this.tasks.addTask(9, new EntityAIMate(this, 0.8D));
this.tasks.addTask(10, new EntityAIWanderAvoidWater(this, 0.8D, 1.0000001E-5F));
this.tasks.addTask(11, new EntityAIWatchClosest(this, EntityPlayer.class, 10.0F));
this.targetTasks.addTask(1, new EntityAITargetNonTamed(this, EntityChicken.class, false, (Predicate)null));
}
示例5: initEntityAI
import net.minecraft.entity.ai.EntityAITargetNonTamed; //导入依赖的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));
}
示例6: initEntityAI
import net.minecraft.entity.ai.EntityAITargetNonTamed; //导入依赖的package包/类
protected void initEntityAI()
{
this.aiSit = new EntityAISit(this);
this.aiTempt = new EntityAITempt(this, 0.6D, Items.FISH, true);
this.tasks.addTask(1, new EntityAISwimming(this));
this.tasks.addTask(2, this.aiSit);
this.tasks.addTask(3, this.aiTempt);
this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 5.0F));
this.tasks.addTask(6, new EntityAIOcelotSit(this, 0.8D));
this.tasks.addTask(7, new EntityAILeapAtTarget(this, 0.3F));
this.tasks.addTask(8, new EntityAIOcelotAttack(this));
this.tasks.addTask(9, new EntityAIMate(this, 0.8D));
this.tasks.addTask(10, new EntityAIWander(this, 0.8D));
this.tasks.addTask(11, new EntityAIWatchClosest(this, EntityPlayer.class, 10.0F));
this.targetTasks.addTask(1, new EntityAITargetNonTamed(this, EntityChicken.class, false, (Predicate)null));
}
示例7: EntitySlave
import net.minecraft.entity.ai.EntityAITargetNonTamed; //导入依赖的package包/类
public EntitySlave(World p_i1688_1_)
{
super(p_i1688_1_);
this.setSize(0.8F, 1.6F);
this.getNavigator().setAvoidsWater(true);
this.tasks.addTask(1, new EntityAISwimming(this));
this.tasks.addTask(2, this.aiSit);
this.tasks.addTask(3, this.aiTempt = new EntityAITempt(this, 0.6D, Items.diamond, true));
this.tasks.addTask(4, new EntityAIFollowOwner(this, 1.0D, 10.0F, 5.0F));
this.tasks.addTask(5, new EntityAIAvoidEntity(this, EntityCreeper.class, 16.0F, 0.8D, 1.33D));
this.tasks.addTask(6, new EntityAILeapAtTarget(this, 0.3F));
this.tasks.addTask(7, new EntityAIOcelotAttack(this));
this.tasks.addTask(8, new EntityAIMate(this, 0.8D));
this.tasks.addTask(9, new EntityAIWander(this, 0.8D));
this.tasks.addTask(10, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
this.targetTasks.addTask(1, new EntityAITargetNonTamed(this, EntityMob.class, 750, false));
this.setType(this.rand.nextInt(4));
this.setRandomStuff();
}
示例8: EntityStymph
import net.minecraft.entity.ai.EntityAITargetNonTamed; //导入依赖的package包/类
public EntityStymph(World w)
{
super(w);
this.setSize(0.6F, 1.4F);
this.getNavigator().setAvoidsWater(true);
this.tasks.addTask(1, new EntityAISwimming(this));
this.tasks.addTask(2, this.aiSit);
this.tasks.addTask(3, this.aiTempt = new EntityAITempt(this, 0.6D, ItemRegister.BERRY_RED, true));
this.tasks.addTask(4, new EntityAIAvoidEntity(this, EntityCow.class, 16.0F, 0.8D, 1.33D));
this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 5.0F));
this.tasks.addTask(7, new EntityAILeapAtTarget(this, 0.3F));
this.tasks.addTask(8, new EntityAIOcelotAttack(this));
this.tasks.addTask(9, new EntityAIMate(this, 0.8D));
this.tasks.addTask(10, new EntityAIWander(this, 0.8D));
this.tasks.addTask(11, new EntityAIWatchClosest(this, EntityPlayer.class, 10.0F));
this.targetTasks.addTask(1, new EntityAITargetNonTamed(this, EntitySnowCube.class, 750, false));
this.setTameSkin(this.worldObj.rand.nextInt(3));
}
示例9: EntityKitty
import net.minecraft.entity.ai.EntityAITargetNonTamed; //导入依赖的package包/类
public EntityKitty(World p_i1688_1_)
{
super(p_i1688_1_);
this.setSize(0.6F, 0.8F);
this.getNavigator().setAvoidsWater(true);
this.tasks.addTask(1, new EntityAISwimming(this));
this.tasks.addTask(2, this.aiSit);
this.tasks.addTask(3, this.aiTempt = new EntityAITempt(this, 0.6D, Items.fish, true));
//this.tasks.addTask(4, new EntityAIAvoidEntity(this, EntityPlayer.class, 16.0F, 0.8D, 1.33D));
this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 5.0F));
this.tasks.addTask(6, new EntityAIKittySit(this, 1.33D));
this.tasks.addTask(7, new EntityAILeapAtTarget(this, 0.3F));
this.tasks.addTask(8, new EntityAIOcelotAttack(this));
this.tasks.addTask(9, new EntityAIMate(this, 0.8D));
this.tasks.addTask(10, new EntityAIWander(this, 0.8D));
this.tasks.addTask(11, new EntityAIWatchClosest(this, EntityPlayer.class, 10.0F));
this.targetTasks.addTask(1, new EntityAITargetNonTamed(this, EntityChicken.class, 750, false));
this.hasCustomNameTag();
this.setCustomNameTag("Kitty");
}
示例10: EntityVelociraptor
import net.minecraft.entity.ai.EntityAITargetNonTamed; //导入依赖的package包/类
public EntityVelociraptor(World world)
{
super(world);
this.setSize(1F, 0.6F);
isCarnivore = true;
minSize = 0.2F;
maxSize = 1.4F;
adultAge = 10;
maxAge = 16;
this.tasks.addTask(8, new EntityAITempt(this, 1.2D, Items.chicken, false));
this.tasks.addTask(10, new MobAIWatchClosestWhenAwake(this, EntityPlayer.class, 8.0F));
this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntityChicken.class, 200, false));
this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntityCow.class, 200, false));
this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntitySheep.class, 200, false));
this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntityCompsognathus.class, 200, false));
this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntityPig.class, 200, false));
this.setTamed(false);
}
示例11: EntityWolf
import net.minecraft.entity.ai.EntityAITargetNonTamed; //导入依赖的package包/类
public EntityWolf(World par1World)
{
super(par1World);
this.setSize(0.6F, 0.8F);
this.getNavigator().setAvoidsWater(true);
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 EntityAIAttackOnCollide(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));
this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntitySheep.class, 200, false));
this.setTamed(false);
}
示例12: EntityOcelot
import net.minecraft.entity.ai.EntityAITargetNonTamed; //导入依赖的package包/类
public EntityOcelot(World par1World)
{
super(par1World);
this.setSize(0.6F, 0.8F);
this.getNavigator().setAvoidsWater(true);
this.tasks.addTask(1, new EntityAISwimming(this));
this.tasks.addTask(2, this.aiSit);
this.tasks.addTask(3, this.aiTempt = new EntityAITempt(this, 0.6D, Items.fish, true));
this.tasks.addTask(4, new EntityAIAvoidEntity(this, EntityPlayer.class, 16.0F, 0.8D, 1.33D));
this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 5.0F));
this.tasks.addTask(6, new EntityAIOcelotSit(this, 1.33D));
this.tasks.addTask(7, new EntityAILeapAtTarget(this, 0.3F));
this.tasks.addTask(8, new EntityAIOcelotAttack(this));
this.tasks.addTask(9, new EntityAIMate(this, 0.8D));
this.tasks.addTask(10, new EntityAIWander(this, 0.8D));
this.tasks.addTask(11, new EntityAIWatchClosest(this, EntityPlayer.class, 10.0F));
this.targetTasks.addTask(1, new EntityAITargetNonTamed(this, EntityChicken.class, 750, false));
}
示例13: EntityForisZertum
import net.minecraft.entity.ai.EntityAITargetNonTamed; //导入依赖的package包/类
public EntityForisZertum(World p_i1696_1_)
{
super(p_i1696_1_);
this.setSize(0.6F, 1.5F);
this.getNavigator().setAvoidsWater(true);
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 EntityAIAttackOnCollide(this, 1.0D, true));
this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F));
this.tasks.addTask(6, aiFetchBone);
this.tasks.addTask(7, new EntityAIMate(this, 1.0D));
this.tasks.addTask(8, new EntityAIWander(this, 1.0D));
this.tasks.addTask(9, new EntityCustomFZAIBeg(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));
this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntitySheep.class, 200, false));
this.setTamed(false);
this.inventory = new InventoryPack(this);
}
示例14: EntityDestroZertum
import net.minecraft.entity.ai.EntityAITargetNonTamed; //导入依赖的package包/类
public EntityDestroZertum(World p_i1696_1_)
{
super(p_i1696_1_);
this.setSize(0.6F, 1.5F);
this.getNavigator().setAvoidsWater(true);
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 EntityAIAttackOnCollide(this, 1.0D, true));
this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F));
this.tasks.addTask(6, aiFetchBone);
this.tasks.addTask(7, new EntityAIMate(this, 1.0D));
this.tasks.addTask(8, new EntityAIWander(this, 1.0D));
this.tasks.addTask(9, new EntityCustomDeZAIBeg(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));
this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntitySheep.class, 200, false));
this.setTamed(false);
this.inventory = new InventoryPack(this);
}
示例15: EntityRedZertum
import net.minecraft.entity.ai.EntityAITargetNonTamed; //导入依赖的package包/类
public EntityRedZertum(World p_i1696_1_)
{
super(p_i1696_1_);
this.isImmuneToFire = true;
this.setSize(0.6F, 1.5F);
this.getNavigator().setAvoidsWater(true);
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 EntityAIAttackOnCollide(this, 1.0D, true));
this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F));
this.tasks.addTask(6, aiFetchBone);
this.tasks.addTask(7, new EntityAIMate(this, 1.0D));
this.tasks.addTask(8, new EntityAIWander(this, 1.0D));
this.tasks.addTask(9, new EntityCustomRZAIBeg(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));
this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntitySheep.class, 200, false));
this.setTamed(false);
this.inventory = new InventoryPack(this);
}