本文整理汇总了Java中net.minecraft.entity.ai.EntityAIFindEntityNearestPlayer类的典型用法代码示例。如果您正苦于以下问题:Java EntityAIFindEntityNearestPlayer类的具体用法?Java EntityAIFindEntityNearestPlayer怎么用?Java EntityAIFindEntityNearestPlayer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EntityAIFindEntityNearestPlayer类属于net.minecraft.entity.ai包,在下文中一共展示了EntityAIFindEntityNearestPlayer类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: removeDummyAIBlockerTask
import net.minecraft.entity.ai.EntityAIFindEntityNearestPlayer; //导入依赖的package包/类
/**
* Removes the (last found) dummy blocker AI task, if any
* @param tasks
*/
public static void removeDummyAIBlockerTask(EntityAITasks tasks)
{
EntityAIBase task = null;
for (EntityAITaskEntry taskEntry : tasks.taskEntries)
{
if (taskEntry.action instanceof EntityAIDummyBlockerTask)
{
task = taskEntry.action;
}
// Restore the default mutex bits.
// TODO: If modded mob tasks use this bit, then we should store the original value so we can restore it.
if (taskEntry.action instanceof EntityAIFindEntityNearestPlayer)
{
taskEntry.action.setMutexBits(taskEntry.action.getMutexBits() & 0x7F);
}
}
if (task != null)
{
tasks.removeTask(task);
}
}
示例2: initEntityAI
import net.minecraft.entity.ai.EntityAIFindEntityNearestPlayer; //导入依赖的package包/类
protected void initEntityAI()
{
this.tasks.addTask(5, new AIRandomFly(this));
this.tasks.addTask(7, new AILookAround(this));
this.tasks.addTask(7, new AIFireballAttack(this));
this.targetTasks.addTask(1, new EntityAIFindEntityNearestPlayer(this));
}
示例3: EntityGhast
import net.minecraft.entity.ai.EntityAIFindEntityNearestPlayer; //导入依赖的package包/类
public EntityGhast(World worldIn)
{
super(worldIn);
this.setSize(4.0F, 4.0F);
this.isImmuneToFire = true;
this.experienceValue = 5;
this.moveHelper = new EntityGhast.GhastMoveHelper(this);
this.tasks.addTask(5, new EntityGhast.AIRandomFly(this));
this.tasks.addTask(7, new EntityGhast.AILookAround(this));
this.tasks.addTask(7, new EntityGhast.AIFireballAttack(this));
this.targetTasks.addTask(1, new EntityAIFindEntityNearestPlayer(this));
}
示例4: EntitySlime
import net.minecraft.entity.ai.EntityAIFindEntityNearestPlayer; //导入依赖的package包/类
public EntitySlime(World worldIn)
{
super(worldIn);
this.moveHelper = new EntitySlime.SlimeMoveHelper(this);
this.tasks.addTask(1, new EntitySlime.AISlimeFloat(this));
this.tasks.addTask(2, new EntitySlime.AISlimeAttack(this));
this.tasks.addTask(3, new EntitySlime.AISlimeFaceRandom(this));
this.tasks.addTask(5, new EntitySlime.AISlimeHop(this));
this.targetTasks.addTask(1, new EntityAIFindEntityNearestPlayer(this));
this.targetTasks.addTask(3, new EntityAIFindEntityNearest(this, EntityIronGolem.class));
}
示例5: initEntityAI
import net.minecraft.entity.ai.EntityAIFindEntityNearestPlayer; //导入依赖的package包/类
protected void initEntityAI()
{
this.tasks.addTask(5, new EntityGhast.AIRandomFly(this));
this.tasks.addTask(7, new EntityGhast.AILookAround(this));
this.tasks.addTask(7, new EntityGhast.AIFireballAttack(this));
this.targetTasks.addTask(1, new EntityAIFindEntityNearestPlayer(this));
}
示例6: initEntityAI
import net.minecraft.entity.ai.EntityAIFindEntityNearestPlayer; //导入依赖的package包/类
protected void initEntityAI()
{
this.tasks.addTask(1, new EntitySlime.AISlimeFloat(this));
this.tasks.addTask(2, new EntitySlime.AISlimeAttack(this));
this.tasks.addTask(3, new EntitySlime.AISlimeFaceRandom(this));
this.tasks.addTask(5, new EntitySlime.AISlimeHop(this));
this.targetTasks.addTask(1, new EntityAIFindEntityNearestPlayer(this));
this.targetTasks.addTask(3, new EntityAIFindEntityNearest(this, EntityIronGolem.class));
}
示例7: initEntityAI
import net.minecraft.entity.ai.EntityAIFindEntityNearestPlayer; //导入依赖的package包/类
@Override
protected void initEntityAI()
{
this.tasks.addTask(1, new EntitySentry.AISlimeFloat(this));
this.tasks.addTask(2, new EntitySentry.AISlimeAttack(this));
this.tasks.addTask(3, new EntitySentry.AISlimeFaceRandom(this));
this.tasks.addTask(5, new EntitySentry.AISlimeHop(this));
this.targetTasks.addTask(1, new EntityAIFindEntityNearestPlayer(this));
this.targetTasks.addTask(3, new EntityAIFindEntityNearest(this, EntityIronGolem.class));
}
示例8: addCollisionBoxToList
import net.minecraft.entity.ai.EntityAIFindEntityNearestPlayer; //导入依赖的package包/类
@Deprecated
@Override
public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB mask, List<AxisAlignedBB> list, Entity collidingEntity, boolean p_185477_7_) {
int type = state.getValue(TYPE).intValue();
boolean collide = false;
switch(type) {
case 0: // Everything
collide = true;
break;
case 1: // ONLY players
collide |= collidingEntity instanceof EntityPlayer;
break;
case 2: // ALL living
collide |= collidingEntity instanceof EntityLivingBase;
break;
case 3: // ALL living EXCEPT player
collide |= collidingEntity instanceof EntityLiving;
break;
case 4: // ALL monsters
if(collidingEntity instanceof EntityLiving) {
EntityLiving living = (EntityLiving) collidingEntity;
for(Object targetTask : living.targetTasks.taskEntries) {
if(targetTask instanceof EntityAIFindEntityNearestPlayer) {
collide |= true;
break;
}
}
}
break;
case 5: // ALL villagers
collide |= collidingEntity instanceof EntityVillager;
break;
case 6: // ALL items
collide |= collidingEntity instanceof EntityItem;
break;
default: // Everything.
collide = true;
break;
}
if(collide) {
super.addCollisionBoxToList(state, worldIn, pos, mask, list, collidingEntity, p_185477_7_);
}
}
示例9: newAIFindEntityNearestPlayer
import net.minecraft.entity.ai.EntityAIFindEntityNearestPlayer; //导入依赖的package包/类
@Override
public AIFindEntityNearestPlayer newAIFindEntityNearestPlayer(EntityLiving entityLiving) {
return (AIFindEntityNearestPlayer) new EntityAIFindEntityNearestPlayer((net.minecraft.entity.EntityLiving) entityLiving);
}