@Nullable @Override protected Vec3d getPosition() { return RandomPositionGenerator.findRandomTarget(skater, 16, 0); } }
@Nullable @Override protected Vec3d getPosition() { return RandomPositionGenerator.findRandomTarget(locust, 32, 32); } }
@Nullable protected Vec3d getPosition() { return RandomPositionGenerator.findRandomTarget(entity, 32, 32); }
@Override public boolean shouldExecute() { if (this.swimmingEntity.getRNG().nextFloat() < 0.50) { return false; } Vec3d target = RandomPositionGenerator.findRandomTarget(this.swimmingEntity, 6, 2); if (target == null) { return false; } else { this.xPosition = target.x; this.yPosition = target.y; this.zPosition = target.z; return true; } }
@Override public boolean shouldExecute() { int chance = executionChance; if (isOnLeaves()) { chance *= 2; } if (entity.getRNG().nextInt(chance) != 0) { return false; } Vec3d vec3 = RandomPositionGenerator.findRandomTarget(entity, 4, 2); if (vec3 == null || entity.posY - vec3.y < -2) { return false; } randPosX = vec3.x; randPosY = vec3.y; randPosZ = vec3.z; return true; }
@Override public boolean shouldExecute() { if (this.entity.attackStateMachine != 0 || this.entity.getAttackTarget() == null) { return false; } EntityLivingBase target = this.entity.getAttackTarget(); Vec3d vec3d = null; if (target instanceof EntityCreature) { vec3d = RandomPositionGenerator.findRandomTarget((EntityCreature) target, 10, 7); } else { vec3d = RandomPositionGenerator.findRandomTarget(this.entity, 10, 7); } if (vec3d == null) { return false; } else { ticksLeft = this.entity.getEntityWorld().rand.nextInt(200) + 100; this.xPosition = vec3d.x; this.yPosition = vec3d.y; this.zPosition = vec3d.z; return true; } }
@Override public boolean shouldExecute() { if (!npc.getIsAIEnabled() || npc.shouldBeAtHome() || npc.getRNG().nextInt(120) != 0) { return false; } else { vec3 = RandomPositionGenerator.findRandomTarget(npc, MIN_RANGE, 7); return vec3 != null; } }
/** * Returns whether the EntityAIBase should begin execution. */ public boolean shouldExecute() { if (this.entity.getAge() >= 100) { return false; } else if (this.entity.getRNG().nextInt(randLimit) != 0) { return false; } else { Vec3 vec3 = RandomPositionGenerator.findRandomTarget(this.entity, 10, 7); if (vec3 == null) { return false; } else { this.xPosition = vec3.xCoord; this.yPosition = vec3.yCoord; this.zPosition = vec3.zCoord; return true; } } }
@Override public boolean shouldExecute() { if (theEntityCreature.getRevengeTarget() == null && !theEntityCreature.isBurning()) { return false; } Vec3d vec3 = RandomPositionGenerator.findRandomTarget(theEntityCreature, 5, 4); if (vec3 == null) { return false; } double yOffset = 1 + theEntityCreature.getEntityWorld().rand.nextInt(3); // double yOffset = 0; randPosX = vec3.x; randPosY = vec3.y + yOffset; randPosZ = vec3.z; return true; }
@Override public boolean shouldExecute() { if (!cockatrice.canMove() || cockatrice.getCommand() != 0) { return false; } if (!this.mustUpdate) { if (this.cockatrice.getRNG().nextInt(executionChance) != 0) { return false; } } Vec3d vec3d = RandomPositionGenerator.findRandomTarget(this.cockatrice, 10, 7); if (vec3d == null) { return false; } else { this.xPosition = vec3d.x; this.yPosition = vec3d.y; this.zPosition = vec3d.z; this.mustUpdate = false; return true; } }
@Override public boolean shouldContinueExecuting() { ticksLeft--; if (ticksLeft <= 0) { this.entity.attackStateMachine = 1; } this.entity.cloak(); if (this.entity.getNavigator().noPath()) { EntityLivingBase target = this.entity.getAttackTarget(); Vec3d vec3d; if (target instanceof EntityCreature) { vec3d = RandomPositionGenerator.findRandomTarget((EntityCreature) target, 10, 7); } else { vec3d = RandomPositionGenerator.findRandomTarget(this.entity, 10, 7); } if (vec3d != null) { this.xPosition = vec3d.x; this.yPosition = vec3d.y; this.zPosition = vec3d.z; this.entity.getNavigator().tryMoveToXYZ(this.xPosition, this.yPosition, this.zPosition, this.speed); } } return this.entity.attackStateMachine == 0; }
@Override public boolean shouldExecute() { if (!hippo.canMove()) { return false; } if (hippo.isFlying() || hippo.isHovering()) { return false; } if (!this.mustUpdate) { if (this.hippo.getRNG().nextInt(executionChance) != 0) { return false; } } Vec3d vec3d = RandomPositionGenerator.findRandomTarget(this.hippo, 10, 7); if (vec3d == null) { return false; } else { this.xPosition = vec3d.x; this.yPosition = vec3d.y; this.zPosition = vec3d.z; this.mustUpdate = false; return true; } }
@Override public boolean shouldExecute() { if (!dragon.canMove()) { return false; } if (dragon.getControllingPassenger() != null) { return false; } if (dragon.isFlying() || dragon.isHovering()) { return false; } if (!this.mustUpdate) { if (this.dragon.getRNG().nextInt(executionChance) != 0) { return false; } } Vec3d vec3d = RandomPositionGenerator.findRandomTarget(this.dragon, 10, 7); if (vec3d == null) { return false; } else { this.xPosition = vec3d.x; this.yPosition = vec3d.y; this.zPosition = vec3d.z; this.mustUpdate = false; return true; } }
@Override public boolean shouldExecute() { if (!this.myrmex.canMove() || this.myrmex.holdingBaby() || !this.myrmex.getNavigator().noPath() || !myrmex.canSeeSky() || this.myrmex.shouldEnterHive() || !this.myrmex.keepSearching) { return false; } List<BlockPos> allBlocks = new ArrayList<BlockPos>(); for (BlockPos pos : BlockPos.getAllInBox(this.myrmex.getPosition().add(-RADIUS, -RADIUS, -RADIUS), this.myrmex.getPosition().add(RADIUS, RADIUS, RADIUS))) { if (EntityMyrmexBase.isEdibleBlock(this.myrmex.world.getBlockState(pos))) { allBlocks.add(pos); this.myrmex.keepSearching = false; } } if (allBlocks.isEmpty()) { this.myrmex.keepSearching = true; this.wanderRadius += RADIUS; Vec3d vec = RandomPositionGenerator.findRandomTarget(this.myrmex, wanderRadius, 7); if(vec != null){ this.targetBlock = new BlockPos(vec); } return true; } allBlocks.sort(this.targetSorter); this.targetBlock = allBlocks.get(0); return true; }
if (this.swimmingEntity.getRNG().nextFloat() < 0.50 && !this.swimmingEntity.getNavigator().noPath()) return false; Vec3d target = RandomPositionGenerator.findRandomTarget(this.swimmingEntity, 6, 2);