Search in sources :

Example 16 with SwimGoal

use of net.minecraft.entity.ai.goal.SwimGoal in project ChocolateQuestRepoured by TeamChocoQuest.

the class AbstractEntityCQR method registerGoals.

@Override
protected void registerGoals() {
    if (CQRConfig.advanced.debugAI) {
    // TODO: AI Selectors are final now, change this or not?
    // this.goalSelector = new EntityAITasksProfiled((IProfiler) this.level.getProfiler(), this.level);
    // this.targetSelector = new EntityAITasksProfiled((IProfiler) this.level.getProfiler(), this.level);
    }
    this.spellHandler = this.createSpellHandler();
    this.goalSelector.addGoal(0, new SwimGoal(this));
    this.goalSelector.addGoal(1, new EntityAIOpenCloseDoor(this));
    if (this.canMountEntity()) {
        this.horseAI = new EntityAIRideHorse<>(this, 1.5);
        this.goalSelector.addGoal(8, this.horseAI);
    }
    this.goalSelector.addGoal(9, new EntityAIHealingPotion(this));
    this.goalSelector.addGoal(11, this.spellHandler);
    this.goalSelector.addGoal(12, new EntityAIAttackSpecial(this));
    this.goalSelector.addGoal(13, new EntityAIAttackRanged<>(this));
    this.goalSelector.addGoal(14, new EntityAIPotionThrower(this));
    this.goalSelector.addGoal(15, new EntityAIFireball(this));
    this.goalSelector.addGoal(16, new EntityAIHooker(this));
    this.goalSelector.addGoal(17, new EntityAIBackstab(this));
    this.goalSelector.addGoal(18, new EntityAIAttack(this));
    this.goalSelector.addGoal(19, new EntityAICursedBoneSummoner(this));
    this.goalSelector.addGoal(20, new EntityAIFollowAttackTarget(this));
    this.goalSelector.addGoal(22, new EntityAIFireFighter(this));
    this.goalSelector.addGoal(23, new EntityAITorchIgniter(this));
    this.goalSelector.addGoal(24, new EntityAILooter(this));
    this.goalSelector.addGoal(25, new EntityAITameAndLeashPet(this));
    this.goalSelector.addGoal(26, new EntityAISearchMount(this));
    this.goalSelector.addGoal(30, new EntityAIMoveToLeader(this));
    this.goalSelector.addGoal(31, new EntityAIFollowPath(this));
    this.goalSelector.addGoal(32, new EntityAIMoveToHome(this));
    this.goalSelector.addGoal(33, new EntityAIIdleSit(this));
    // Electrocution stuff
    // this.tasks.addTask(10, new EntityAIPanicElectrocute(this, 2.0D));
    // this.tasks.addTask(10, new EntityAIPanicFire(this, 2.0D));
    // this.tasks.addTask(3, new EntityAIAvoidEntity<EntityLivingBase>(this, EntityLivingBase.class,
    // TargetUtil.PREDICATE_IS_ELECTROCUTED, 8.0F, 1.5D, 2.0D));
    // this.tasks.addTask(2, new EntityAIAvoidEntity<EntityElectricField>(this, EntityElectricField.class, 1.0F, 1.5D,
    // 1.5D));
    this.targetSelector.addGoal(0, new EntityAICQRNearestAttackTarget(this));
    this.targetSelector.addGoal(1, new EntityAIHurtByTarget(this));
}
Also used : EntityAIFollowPath(team.cqr.cqrepoured.entity.ai.EntityAIFollowPath) EntityAIPotionThrower(team.cqr.cqrepoured.entity.ai.item.EntityAIPotionThrower) EntityAIAttack(team.cqr.cqrepoured.entity.ai.attack.EntityAIAttack) EntityAICursedBoneSummoner(team.cqr.cqrepoured.entity.ai.item.EntityAICursedBoneSummoner) EntityAIMoveToHome(team.cqr.cqrepoured.entity.ai.EntityAIMoveToHome) EntityAIHealingPotion(team.cqr.cqrepoured.entity.ai.item.EntityAIHealingPotion) EntityAIHurtByTarget(team.cqr.cqrepoured.entity.ai.target.EntityAIHurtByTarget) EntityAITameAndLeashPet(team.cqr.cqrepoured.entity.ai.EntityAITameAndLeashPet) EntityAIMoveToLeader(team.cqr.cqrepoured.entity.ai.EntityAIMoveToLeader) SwimGoal(net.minecraft.entity.ai.goal.SwimGoal) EntityAITorchIgniter(team.cqr.cqrepoured.entity.ai.EntityAITorchIgniter) EntityAILooter(team.cqr.cqrepoured.entity.ai.attack.special.EntityAILooter) EntityAIOpenCloseDoor(team.cqr.cqrepoured.entity.ai.EntityAIOpenCloseDoor) EntityAIFireFighter(team.cqr.cqrepoured.entity.ai.EntityAIFireFighter) EntityAICQRNearestAttackTarget(team.cqr.cqrepoured.entity.ai.target.EntityAICQRNearestAttackTarget) EntityAIIdleSit(team.cqr.cqrepoured.entity.ai.EntityAIIdleSit) EntityAIAttackSpecial(team.cqr.cqrepoured.entity.ai.attack.special.EntityAIAttackSpecial) EntityAIHooker(team.cqr.cqrepoured.entity.ai.attack.special.EntityAIHooker) EntityAIFollowAttackTarget(team.cqr.cqrepoured.entity.ai.EntityAIFollowAttackTarget) EntityAIFireball(team.cqr.cqrepoured.entity.ai.item.EntityAIFireball) EntityAIBackstab(team.cqr.cqrepoured.entity.ai.attack.EntityAIBackstab) EntityAISearchMount(team.cqr.cqrepoured.entity.ai.EntityAISearchMount) IHasTextureOverride(team.cqr.cqrepoured.customtextures.IHasTextureOverride)

Example 17 with SwimGoal

use of net.minecraft.entity.ai.goal.SwimGoal in project ChocolateQuestRepoured by TeamChocoQuest.

the class EntityCQRGiantSpider method registerGoals.

@Override
protected void registerGoals() {
    this.spellHandler = this.createSpellHandler();
    this.goalSelector.addGoal(0, new SwimGoal(this));
    this.goalSelector.addGoal(1, new BossAISpiderSummonMinions(this));
    this.goalSelector.addGoal(2, new BossAISpiderWebshot(this));
    this.goalSelector.addGoal(3, new BossAISpiderHook(this));
    this.goalSelector.addGoal(12, new BossAISpiderLeapAttack(this, 1.2F));
    this.goalSelector.addGoal(14, new EntityAIAttack(this));
    this.goalSelector.addGoal(20, new EntityAIFollowAttackTarget(this));
    this.goalSelector.addGoal(30, new EntityAIMoveToLeader(this));
    this.goalSelector.addGoal(31, new EntityAIFollowPath(this));
    this.goalSelector.addGoal(32, new EntityAIMoveToHome(this));
    this.goalSelector.addGoal(11, this.spellHandler);
    this.spellHandler.addSpell(0, new EntityAIShootPoisonProjectiles(this, 80, 20) {

        @Override
        protected SoundEvent getStartChargingSound() {
            return SoundEvents.SPIDER_HURT;
        }

        @Override
        protected SoundEvent getStartCastingSound() {
            return SoundEvents.SPIDER_AMBIENT;
        }
    });
    this.goalSelector.addGoal(0, new EntityAICQRNearestAttackTarget(this));
    this.goalSelector.addGoal(1, new EntityAIHurtByTarget(this));
}
Also used : EntityAIFollowPath(team.cqr.cqrepoured.entity.ai.EntityAIFollowPath) EntityAIAttack(team.cqr.cqrepoured.entity.ai.attack.EntityAIAttack) BossAISpiderHook(team.cqr.cqrepoured.entity.ai.boss.giantspider.BossAISpiderHook) EntityAIMoveToHome(team.cqr.cqrepoured.entity.ai.EntityAIMoveToHome) EntityAIHurtByTarget(team.cqr.cqrepoured.entity.ai.target.EntityAIHurtByTarget) EntityAIMoveToLeader(team.cqr.cqrepoured.entity.ai.EntityAIMoveToLeader) BossAISpiderSummonMinions(team.cqr.cqrepoured.entity.ai.boss.giantspider.BossAISpiderSummonMinions) SwimGoal(net.minecraft.entity.ai.goal.SwimGoal) SoundEvent(net.minecraft.util.SoundEvent) BossAISpiderWebshot(team.cqr.cqrepoured.entity.ai.boss.giantspider.BossAISpiderWebshot) BossAISpiderLeapAttack(team.cqr.cqrepoured.entity.ai.boss.giantspider.BossAISpiderLeapAttack) EntityAIShootPoisonProjectiles(team.cqr.cqrepoured.entity.ai.spells.EntityAIShootPoisonProjectiles) EntityAICQRNearestAttackTarget(team.cqr.cqrepoured.entity.ai.target.EntityAICQRNearestAttackTarget) EntityAIFollowAttackTarget(team.cqr.cqrepoured.entity.ai.EntityAIFollowAttackTarget)

Example 18 with SwimGoal

use of net.minecraft.entity.ai.goal.SwimGoal in project ChocolateQuestRepoured by TeamChocoQuest.

the class EntityCQRExterminator method registerGoals.

@Override
protected void registerGoals() {
    if (CQRConfig.advanced.debugAI) {
    // this.goalSelector = new EntityAITasksProfiled(this.level.profiler, this.level);
    // this.targetSelector = new EntityAITasksProfiled(this.level.profiler, this.level);
    }
    this.goalSelector.addGoal(1, new SwimGoal(this));
    this.goalSelector.addGoal(2, new EntityAIOpenCloseDoor(this));
    this.goalSelector.addGoal(0, new BossAIExterminatorStun(this));
    this.goalSelector.addGoal(2, new BossAIExterminatorHulkSmash(this));
    this.goalSelector.addGoal(3, new BossAIExterminatorHandLaser(this));
    this.goalSelector.addGoal(4, new BossAIArmCannon(this));
    this.goalSelector.addGoal(12, new EntityAIAttackSpecial(this));
    this.goalSelector.addGoal(13, new EntityAIAttackRanged<AbstractEntityCQR>(this));
    this.goalSelector.addGoal(14, new EntityAIPotionThrower(this));
    /* AI for secondary Item */
    this.goalSelector.addGoal(15, new EntityAIFireball(this));
    /* AI for secondary Item */
    this.goalSelector.addGoal(16, new EntityAIHooker(this));
    /* AI for secondary Item */
    this.goalSelector.addGoal(17, new EntityAIBackstab(this));
    this.goalSelector.addGoal(18, new EntityAIAttack(this) {

        @Override
        public boolean canUse() {
            return super.canUse() && !EntityCQRExterminator.this.isStunned();
        }

        @Override
        public boolean canContinueToUse() {
            return super.canContinueToUse() && !EntityCQRExterminator.this.isStunned();
        }
    });
    this.goalSelector.addGoal(19, new EntityAICursedBoneSummoner(this));
    this.goalSelector.addGoal(20, new EntityAIFollowAttackTarget(this));
    this.goalSelector.addGoal(24, new EntityAILooter(this));
    this.goalSelector.addGoal(30, new EntityAIMoveToLeader(this));
    this.goalSelector.addGoal(31, new EntityAIFollowPath(this));
    this.goalSelector.addGoal(32, new EntityAIMoveToHome(this));
    this.goalSelector.addGoal(33, new EntityAIIdleSit(this));
    // Target tasks for the electro stuff
    this.targetSelector.addGoal(0, new EntityAICQRNearestAttackTarget(this));
    this.targetSelector.addGoal(1, new EntityAIHurtByTarget(this));
    this.targetSelector.addGoal(2, new EntityAITargetElectrocute(this, this::getElectroCuteTargetLeft, this::setElectroCuteTargetLeft));
    this.targetSelector.addGoal(2, new EntityAITargetElectrocute(this, this::getElectroCuteTargetRight, this::setElectroCuteTargetRight));
}
Also used : EntityAIPotionThrower(team.cqr.cqrepoured.entity.ai.item.EntityAIPotionThrower) EntityAIAttack(team.cqr.cqrepoured.entity.ai.attack.EntityAIAttack) EntityAICursedBoneSummoner(team.cqr.cqrepoured.entity.ai.item.EntityAICursedBoneSummoner) BossAIExterminatorHandLaser(team.cqr.cqrepoured.entity.ai.boss.exterminator.BossAIExterminatorHandLaser) AbstractEntityCQR(team.cqr.cqrepoured.entity.bases.AbstractEntityCQR) EntityAIHurtByTarget(team.cqr.cqrepoured.entity.ai.target.EntityAIHurtByTarget) EntityAIMoveToLeader(team.cqr.cqrepoured.entity.ai.EntityAIMoveToLeader) BossAIExterminatorHulkSmash(team.cqr.cqrepoured.entity.ai.boss.exterminator.BossAIExterminatorHulkSmash) SwimGoal(net.minecraft.entity.ai.goal.SwimGoal) BossAIExterminatorStun(team.cqr.cqrepoured.entity.ai.boss.exterminator.BossAIExterminatorStun) EntityAITargetElectrocute(team.cqr.cqrepoured.entity.ai.target.exterminator.EntityAITargetElectrocute) EntityAIAttackSpecial(team.cqr.cqrepoured.entity.ai.attack.special.EntityAIAttackSpecial) EntityAIHooker(team.cqr.cqrepoured.entity.ai.attack.special.EntityAIHooker) EntityAIFollowAttackTarget(team.cqr.cqrepoured.entity.ai.EntityAIFollowAttackTarget) EntityAIFireball(team.cqr.cqrepoured.entity.ai.item.EntityAIFireball) EntityAIBackstab(team.cqr.cqrepoured.entity.ai.attack.EntityAIBackstab) EntityAIFollowPath(team.cqr.cqrepoured.entity.ai.EntityAIFollowPath) EntityAIMoveToHome(team.cqr.cqrepoured.entity.ai.EntityAIMoveToHome) BossAIArmCannon(team.cqr.cqrepoured.entity.ai.boss.exterminator.BossAIArmCannon) EntityAILooter(team.cqr.cqrepoured.entity.ai.attack.special.EntityAILooter) EntityAIOpenCloseDoor(team.cqr.cqrepoured.entity.ai.EntityAIOpenCloseDoor) EntityAICQRNearestAttackTarget(team.cqr.cqrepoured.entity.ai.target.EntityAICQRNearestAttackTarget) EntityAIIdleSit(team.cqr.cqrepoured.entity.ai.EntityAIIdleSit)

Example 19 with SwimGoal

use of net.minecraft.entity.ai.goal.SwimGoal in project MCDoom by AzureDoom.

the class ProwlerEntity method initGoals.

@Override
protected void initGoals() {
    this.goalSelector.add(0, new SwimGoal(this));
    this.goalSelector.add(4, new DemonAttackGoal(this, 1.25D, 2));
    this.goalSelector.add(4, new ProwlerEntity.RangedStrafeAttackGoal(this, new FireballAttack(this, false).setProjectileOriginOffset(0.8, 0.8, 0.8).setDamage(config.prowler_ranged_damage).setSound(SoundEvents.ENTITY_BLAZE_SHOOT, 1.0F, 1.4F + this.getRandom().nextFloat() * 0.35F), 1.0D, 50, 30, 15, 15F).setMultiShot(3, 2));
    this.goalSelector.add(8, new LookAtEntityGoal(this, PlayerEntity.class, 8.0F));
    this.goalSelector.add(8, new LookAroundGoal(this));
    this.targetSelector.add(1, new ProwlerEntity.TeleportTowardsPlayerGoal(this, this::shouldAngerAt));
    this.targetSelector.add(3, new ActiveTargetGoal<>(this, PlayerEntity.class, true));
    this.targetSelector.add(3, new ActiveTargetGoal<>(this, MerchantEntity.class, true));
    this.targetSelector.add(2, new RevengeGoal(this));
    this.targetSelector.add(4, new UniversalAngerGoal<>(this, false));
}
Also used : RevengeGoal(net.minecraft.entity.ai.goal.RevengeGoal) MerchantEntity(net.minecraft.entity.passive.MerchantEntity) DemonAttackGoal(mod.azure.doom.entity.ai.goal.DemonAttackGoal) LookAroundGoal(net.minecraft.entity.ai.goal.LookAroundGoal) LookAtEntityGoal(net.minecraft.entity.ai.goal.LookAtEntityGoal) SwimGoal(net.minecraft.entity.ai.goal.SwimGoal) PlayerEntity(net.minecraft.entity.player.PlayerEntity) FireballAttack(mod.azure.doom.entity.attack.FireballAttack)

Example 20 with SwimGoal

use of net.minecraft.entity.ai.goal.SwimGoal in project Biome-Makeover by Lemonszz.

the class DragonflyEntity method initGoals.

protected void initGoals() {
    this.goalSelector.add(8, new FlyWanderAroundGoal(this));
    this.goalSelector.add(9, new SwimGoal(this));
}
Also used : FlyWanderAroundGoal(party.lemons.biomemakeover.entity.ai.FlyWanderAroundGoal) SwimGoal(net.minecraft.entity.ai.goal.SwimGoal)

Aggregations

SwimGoal (net.minecraft.entity.ai.goal.SwimGoal)23 PlayerEntity (net.minecraft.entity.player.PlayerEntity)12 LookAtGoal (net.minecraft.entity.ai.goal.LookAtGoal)7 LookRandomlyGoal (net.minecraft.entity.ai.goal.LookRandomlyGoal)6 ServerPlayerEntity (net.minecraft.entity.player.ServerPlayerEntity)5 AbstractEntityCitizen (com.minecolonies.api.entity.citizen.AbstractEntityCitizen)4 EntityAIInteractToggleAble (com.minecolonies.coremod.entity.ai.minimal.EntityAIInteractToggleAble)4 LookAtEntityGoal (net.minecraft.entity.ai.goal.LookAtEntityGoal)4 LookAtWithoutMovingGoal (net.minecraft.entity.ai.goal.LookAtWithoutMovingGoal)4 RandomWalkingGoal (net.minecraft.entity.ai.goal.RandomWalkingGoal)3 RevengeGoal (net.minecraft.entity.ai.goal.RevengeGoal)3 WaterAvoidingRandomWalkingGoal (net.minecraft.entity.ai.goal.WaterAvoidingRandomWalkingGoal)3 EntityAIFollowAttackTarget (team.cqr.cqrepoured.entity.ai.EntityAIFollowAttackTarget)3 EntityAIFollowPath (team.cqr.cqrepoured.entity.ai.EntityAIFollowPath)3 EntityAIMoveToHome (team.cqr.cqrepoured.entity.ai.EntityAIMoveToHome)3 EntityAIMoveToLeader (team.cqr.cqrepoured.entity.ai.EntityAIMoveToLeader)3 EntityAIAttack (team.cqr.cqrepoured.entity.ai.attack.EntityAIAttack)3 EntityAICQRNearestAttackTarget (team.cqr.cqrepoured.entity.ai.target.EntityAICQRNearestAttackTarget)3 EntityAIHurtByTarget (team.cqr.cqrepoured.entity.ai.target.EntityAIHurtByTarget)3 EntityAIVisitor (com.minecolonies.coremod.entity.ai.minimal.EntityAIVisitor)2