Search in sources :

Example 21 with LookAtEntityGoal

use of net.minecraft.entity.ai.goal.LookAtEntityGoal in project beebuddy by queenofthebees.

the class BeeEntityMixin method beebuddy$initTamedGoals.

@Unique
private void beebuddy$initTamedGoals() {
    BeeEntity us = (BeeEntity) (Object) this;
    this.goalSelector.add(0, new BeeSitGoal(us));
    this.goalSelector.add(1, StingGoalInvoker.beebuddy$make(us, us, 1.399999976158142D, true));
    this.goalSelector.add(2, new FollowParentGoal(us, 1.25D));
    this.goalSelector.add(3, new FollowFriendGoal(us));
    this.goalSelector.add(4, new AnimalMateGoal(us, 1.0D));
    if (pollinateGoal == null) {
        // we can be called before initGoals's body
        pollinateGoal = PollinateGoalInvoker.beebuddy$make(us);
    }
    this.goalSelector.add(5, pollinateGoal);
    if (moveToFlowerGoal == null) {
        moveToFlowerGoal = MoveToFlowerGoalInvoker.beebuddy$make(us);
    }
    this.goalSelector.add(6, moveToFlowerGoal);
    this.goalSelector.add(7, new SitOnHeadGoal(us));
    this.goalSelector.add(7, BeeWanderAroundGoalInvoker.beebuddy$make(us));
    this.goalSelector.add(8, new LookAtEntityGoal(us, PlayerEntity.class, 4.0F));
    this.goalSelector.add(8, new SwimGoal(us));
    BeeEntityMixin mix = this;
    this.targetSelector.add(1, (new RevengeGoal(this) {

        @Override
        public boolean canStart() {
            if (!super.canStart()) {
                return false;
            }
            if (us.getAttacker() != null) {
                UUID u = us.getAttacker().getUuid();
                return !u.equals(mix.beebuddy$getFriend());
            } else {
                return true;
            }
        }

        @Override
        public boolean shouldContinue() {
            return us.hasAngerTime() && super.shouldContinue();
        }
    }).setGroupRevenge(new Class[0]));
}
Also used : RevengeGoal(net.minecraft.entity.ai.goal.RevengeGoal) FollowParentGoal(net.minecraft.entity.ai.goal.FollowParentGoal) FollowFriendGoal(nomble.beebuddy.entity.ai.goal.FollowFriendGoal) LookAtEntityGoal(net.minecraft.entity.ai.goal.LookAtEntityGoal) SitOnHeadGoal(nomble.beebuddy.entity.ai.goal.SitOnHeadGoal) SwimGoal(net.minecraft.entity.ai.goal.SwimGoal) PlayerEntity(net.minecraft.entity.player.PlayerEntity) ServerPlayerEntity(net.minecraft.server.network.ServerPlayerEntity) AnimalMateGoal(net.minecraft.entity.ai.goal.AnimalMateGoal) BeeSitGoal(nomble.beebuddy.entity.ai.goal.BeeSitGoal) BeeEntity(net.minecraft.entity.passive.BeeEntity) UUID(java.util.UUID) Unique(org.spongepowered.asm.mixin.Unique)

Example 22 with LookAtEntityGoal

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

the class StoneGolemEntity method initGoals.

@Override
protected void initGoals() {
    super.initGoals();
    this.goalSelector.add(1, new BetterCrossbowAttackGoal<>(this, 1.0D, 24.0F));
    this.goalSelector.add(2, new LookAtEntityGoal(this, PlayerEntity.class, 5.0F, 1.0F));
    this.goalSelector.add(3, new LookAtEntityGoal(this, MobEntity.class, 5.0F));
    this.goalSelector.add(4, new LookAtEntityGoal(this, StoneGolemEntity.class, 10.0F));
    this.goalSelector.add(5, new LookAtEntityGoal(this, GolemEntity.class, 5.0F));
    this.targetSelector.add(1, new RevengeGoal(this));
    this.targetSelector.add(2, new FollowTargetGoal<>(this, MerchantEntity.class, false));
    this.targetSelector.add(3, new FollowTargetGoal<>(this, StoneGolemEntity.class, false));
    this.targetSelector.add(4, new FollowTargetGoal<>(this, IronGolemEntity.class, false));
    this.targetSelector.add(5, new FollowTargetGoal<>(this, PlayerEntity.class, 10, true, false, this::shouldAngerAt));
    this.targetSelector.add(6, new FollowTargetGoal<>(this, MobEntity.class, 5, false, false, (livingEntity) -> {
        return livingEntity instanceof Monster && !(livingEntity instanceof CreeperEntity);
    }));
    this.targetSelector.add(4, new UniversalAngerGoal<>(this, false));
}
Also used : BMEffects(party.lemons.biomemakeover.init.BMEffects) GolemEntity(net.minecraft.entity.passive.GolemEntity) RangedWeaponItem(net.minecraft.item.RangedWeaponItem) MerchantEntity(net.minecraft.entity.passive.MerchantEntity) EntityNavigation(net.minecraft.entity.ai.pathing.EntityNavigation) SoundEvents(net.minecraft.sound.SoundEvents) StoneGolemTurnSoundInstance(party.lemons.biomemakeover.util.sound.StoneGolemTurnSoundInstance) UniversalAngerGoal(net.minecraft.entity.ai.goal.UniversalAngerGoal) PlayerEntity(net.minecraft.entity.player.PlayerEntity) Predicate(java.util.function.Predicate) UUID(java.util.UUID) TrackedData(net.minecraft.entity.data.TrackedData) ProjectileEntity(net.minecraft.entity.projectile.ProjectileEntity) ActionResult(net.minecraft.util.ActionResult) BMEntities(party.lemons.biomemakeover.init.BMEntities) Nullable(org.jetbrains.annotations.Nullable) List(java.util.List) CompoundTag(net.minecraft.nbt.CompoundTag) ServerPlayerEntity(net.minecraft.server.network.ServerPlayerEntity) BMBlocks(party.lemons.biomemakeover.init.BMBlocks) SoundEvent(net.minecraft.sound.SoundEvent) Durations(net.minecraft.entity.ai.Durations) BodyControl(net.minecraft.entity.ai.control.BodyControl) ServerWorld(net.minecraft.server.world.ServerWorld) Environment(net.fabricmc.api.Environment) ServerWorldAccess(net.minecraft.world.ServerWorldAccess) TrackedDataHandlerRegistry(net.minecraft.entity.data.TrackedDataHandlerRegistry) IronGolemEntity(net.minecraft.entity.passive.IronGolemEntity) AttributeContainer(net.minecraft.entity.attribute.AttributeContainer) DamageSource(net.minecraft.entity.damage.DamageSource) net.minecraft.entity.mob(net.minecraft.entity.mob) EntityAttributes(net.minecraft.entity.attribute.EntityAttributes) LookAtEntityGoal(net.minecraft.entity.ai.goal.LookAtEntityGoal) ItemStack(net.minecraft.item.ItemStack) Lists(com.google.common.collect.Lists) FollowTargetGoal(net.minecraft.entity.ai.goal.FollowTargetGoal) net.minecraft.entity(net.minecraft.entity) EntityPredicates(net.minecraft.predicate.entity.EntityPredicates) BetterCrossbowAttackGoal(party.lemons.biomemakeover.entity.ai.BetterCrossbowAttackGoal) EnvType(net.fabricmc.api.EnvType) IntRange(net.minecraft.util.math.IntRange) EmptyMobNavigation(party.lemons.biomemakeover.entity.ai.EmptyMobNavigation) Hand(net.minecraft.util.Hand) World(net.minecraft.world.World) Box(net.minecraft.util.math.Box) RevengeGoal(net.minecraft.entity.ai.goal.RevengeGoal) Items(net.minecraft.item.Items) DataTracker(net.minecraft.entity.data.DataTracker) MathHelper(net.minecraft.util.math.MathHelper) MinecraftClient(net.minecraft.client.MinecraftClient) LocalDifficulty(net.minecraft.world.LocalDifficulty) BMCriterion(party.lemons.biomemakeover.init.BMCriterion) RevengeGoal(net.minecraft.entity.ai.goal.RevengeGoal) MerchantEntity(net.minecraft.entity.passive.MerchantEntity) LookAtEntityGoal(net.minecraft.entity.ai.goal.LookAtEntityGoal) GolemEntity(net.minecraft.entity.passive.GolemEntity) IronGolemEntity(net.minecraft.entity.passive.IronGolemEntity) PlayerEntity(net.minecraft.entity.player.PlayerEntity) ServerPlayerEntity(net.minecraft.server.network.ServerPlayerEntity) IronGolemEntity(net.minecraft.entity.passive.IronGolemEntity)

Example 23 with LookAtEntityGoal

use of net.minecraft.entity.ai.goal.LookAtEntityGoal in project friends-and-foes by Faboslav.

the class GlareEntity method initGoals.

protected void initGoals() {
    this.goalSelector.add(1, new GlareSitGoal(this));
    this.goalSelector.add(2, new GlareFollowOwnerGoal(this, 8.0F, 2.0F, false));
    this.goalSelector.add(3, new GlareAvoidMonsterGoal(this, HostileEntity.class, 16.0F));
    this.eatGlowBerriesGoal = new GlareEatGlowBerriesGoal(this);
    this.goalSelector.add(4, this.eatGlowBerriesGoal);
    this.goalSelector.add(4, new GlareShakeOffGlowBerriesGoal(this));
    this.flyToDarkSpotGoal = new GlareFlyToDarkSpotGoal(this);
    this.goalSelector.add(5, this.flyToDarkSpotGoal);
    this.goalSelector.add(6, new GlareWanderAroundGoal(this));
    this.goalSelector.add(7, new LookAtEntityGoal(this, PlayerEntity.class, 8.0F));
    this.goalSelector.add(8, new SwimGoal(this));
}
Also used : HostileEntity(net.minecraft.entity.mob.HostileEntity) LookAtEntityGoal(net.minecraft.entity.ai.goal.LookAtEntityGoal) SwimGoal(net.minecraft.entity.ai.goal.SwimGoal) PlayerEntity(net.minecraft.entity.player.PlayerEntity) ServerPlayerEntity(net.minecraft.server.network.ServerPlayerEntity)

Example 24 with LookAtEntityGoal

use of net.minecraft.entity.ai.goal.LookAtEntityGoal in project LittleMaidModelLoader-Fabric by SistrScarlet.

the class MultiModelEntity method initGoals.

@Override
protected void initGoals() {
    this.goalSelector.add(0, new SwimGoal(this));
    this.goalSelector.add(7, new LookAtEntityGoal(this, PlayerEntity.class, 6.0F));
    this.goalSelector.add(8, new LookAroundGoal(this));
}
Also used : 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)

Example 25 with LookAtEntityGoal

use of net.minecraft.entity.ai.goal.LookAtEntityGoal in project wildmod by Osmiooo.

the class AllayEntity method initGoals.

protected void initGoals() {
    this.goalSelector.add(1, new LookAtEntityGoal(this, PlayerEntity.class, 8.0F));
    this.goalSelector.add(3, new FlyRandomlyGoal(this));
    this.setCanPickUpLoot(true);
    List<ItemEntity> list = AllayEntity.this.world.getEntitiesByClass(ItemEntity.class, AllayEntity.this.getBoundingBox().expand(8.0D, 8.0D, 8.0D), AllayEntity.CAN_TAKE);
}
Also used : FlyRandomlyGoal(frozenblock.wild.mod.liukrastapi.FlyRandomlyGoal) ItemEntity(net.minecraft.entity.ItemEntity) LookAtEntityGoal(net.minecraft.entity.ai.goal.LookAtEntityGoal) PlayerEntity(net.minecraft.entity.player.PlayerEntity)

Aggregations

LookAtEntityGoal (net.minecraft.entity.ai.goal.LookAtEntityGoal)48 PlayerEntity (net.minecraft.entity.player.PlayerEntity)48 RevengeGoal (net.minecraft.entity.ai.goal.RevengeGoal)42 MerchantEntity (net.minecraft.entity.passive.MerchantEntity)42 LookAroundGoal (net.minecraft.entity.ai.goal.LookAroundGoal)37 WanderAroundFarGoal (net.minecraft.entity.ai.goal.WanderAroundFarGoal)33 RangedAttackGoal (mod.azure.doom.entity.ai.goal.RangedAttackGoal)12 DemonAttackGoal (mod.azure.doom.entity.ai.goal.DemonAttackGoal)10 RangedStrafeAttackGoal (mod.azure.doom.entity.ai.goal.RangedStrafeAttackGoal)8 RandomFlyConvergeOnTargetGoal (mod.azure.doom.entity.ai.goal.RandomFlyConvergeOnTargetGoal)7 FireballAttack (mod.azure.doom.entity.attack.FireballAttack)7 ServerPlayerEntity (net.minecraft.server.network.ServerPlayerEntity)7 AbstractRangedAttack (mod.azure.doom.entity.attack.AbstractRangedAttack)4 ActiveTargetGoal (net.minecraft.entity.ai.goal.ActiveTargetGoal)4 SwimGoal (net.minecraft.entity.ai.goal.SwimGoal)4 UUID (java.util.UUID)2 IronGolemEntity (net.minecraft.entity.passive.IronGolemEntity)2 Lists (com.google.common.collect.Lists)1 FlyRandomlyGoal (frozenblock.wild.mod.liukrastapi.FlyRandomlyGoal)1 List (java.util.List)1