Search in sources :

Example 21 with RevengeGoal

use of net.minecraft.entity.ai.goal.RevengeGoal 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 RevengeGoal

use of net.minecraft.entity.ai.goal.RevengeGoal 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 RevengeGoal

use of net.minecraft.entity.ai.goal.RevengeGoal in project Paradise-Lost by devs-immortal.

the class AechorPlantEntity method initGoals.

@Override
protected void initGoals() {
    super.initGoals();
    this.goalSelector.add(4, new ProjectileAttackGoal(this, 0.0D, 30, 1.0F));
    this.targetSelector.add(1, new RevengeGoal(this));
    this.targetSelector.add(2, new FollowTargetGoal<>(this, LivingEntity.class, true));
}
Also used : RevengeGoal(net.minecraft.entity.ai.goal.RevengeGoal) ProjectileAttackGoal(net.minecraft.entity.ai.goal.ProjectileAttackGoal)

Example 24 with RevengeGoal

use of net.minecraft.entity.ai.goal.RevengeGoal in project Neutrino by FrostWizard4.

the class RatEntity method initGoals.

@Override
protected void initGoals() {
    this.goalSelector.add(4, new RatEntity.AttackGoal(this));
    this.targetSelector.add(1, new RevengeGoal(this));
    this.goalSelector.add(1, new SwimGoal(this));
    this.targetSelector.add(2, new RatEntity.TargetGoal<>(this, PlayerEntity.class));
    super.initGoals();
}
Also used : RevengeGoal(net.minecraft.entity.ai.goal.RevengeGoal) SwimGoal(net.minecraft.entity.ai.goal.SwimGoal) PlayerEntity(net.minecraft.entity.player.PlayerEntity)

Example 25 with RevengeGoal

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

the class FireBaronEntity method initGoals.

@Override
protected void initGoals() {
    this.goalSelector.add(5, new WanderAroundFarGoal(this, 1.0D));
    this.goalSelector.add(6, new LookAtEntityGoal(this, PlayerEntity.class, 8.0F));
    this.goalSelector.add(6, new LookAroundGoal(this));
    this.goalSelector.add(5, new WanderAroundFarGoal(this, 0.8D));
    this.goalSelector.add(4, new RangedAttackGoal(this, new FireBaronEntity.FireballAttack(this).setProjectileOriginOffset(0.8, 0.4, 0.8).setDamage(config.baron_ranged_damage), 1.1D));
    this.targetSelector.add(1, new RevengeGoal(this, new Class[0]).setGroupRevenge());
    this.targetSelector.add(2, new ActiveTargetGoal<>(this, PlayerEntity.class, true));
    this.targetSelector.add(2, new ActiveTargetGoal<>(this, MerchantEntity.class, true));
}
Also used : RevengeGoal(net.minecraft.entity.ai.goal.RevengeGoal) WanderAroundFarGoal(net.minecraft.entity.ai.goal.WanderAroundFarGoal) MerchantEntity(net.minecraft.entity.passive.MerchantEntity) LookAroundGoal(net.minecraft.entity.ai.goal.LookAroundGoal) LookAtEntityGoal(net.minecraft.entity.ai.goal.LookAtEntityGoal) RangedAttackGoal(mod.azure.doom.entity.ai.goal.RangedAttackGoal) PlayerEntity(net.minecraft.entity.player.PlayerEntity)

Aggregations

RevengeGoal (net.minecraft.entity.ai.goal.RevengeGoal)44 PlayerEntity (net.minecraft.entity.player.PlayerEntity)43 LookAtEntityGoal (net.minecraft.entity.ai.goal.LookAtEntityGoal)42 MerchantEntity (net.minecraft.entity.passive.MerchantEntity)40 LookAroundGoal (net.minecraft.entity.ai.goal.LookAroundGoal)34 WanderAroundFarGoal (net.minecraft.entity.ai.goal.WanderAroundFarGoal)31 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)5 AbstractRangedAttack (mod.azure.doom.entity.attack.AbstractRangedAttack)4 ActiveTargetGoal (net.minecraft.entity.ai.goal.ActiveTargetGoal)4 SwimGoal (net.minecraft.entity.ai.goal.SwimGoal)3 UUID (java.util.UUID)2 Lists (com.google.common.collect.Lists)1 List (java.util.List)1 Predicate (java.util.function.Predicate)1 IconAttackGoal (mod.azure.doom.entity.ai.goal.IconAttackGoal)1