Search in sources :

Example 1 with FollowParentGoal

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

use of net.minecraft.entity.ai.goal.FollowParentGoal in project endergetic by team-abnormals.

the class PuffBugEntity method registerGoals.

@Override
protected void registerGoals() {
    this.goalSelector.addGoal(0, new PuffBugPullOutGoal(this));
    this.goalSelector.addGoal(0, new PuffBugRestOnHiveGoal(this));
    this.goalSelector.addGoal(1, new PuffBugAttachToHiveGoal(this));
    this.goalSelector.addGoal(1, new PuffBugRotateToFireGoal(this));
    this.goalSelector.addGoal(2, new PuffBugCreateItemGoal(this));
    this.goalSelector.addGoal(2, new PuffBugAttackGoal(this));
    this.goalSelector.addGoal(3, new PuffBugTeleportToRestGoal(this));
    this.goalSelector.addGoal(4, new PuffBugPollinateGoal(this));
    this.goalSelector.addGoal(5, new PuffBugDescentGoal(this));
    this.goalSelector.addGoal(6, new PuffBugTeleportToBudGoal(this));
    this.goalSelector.addGoal(7, new BreedGoal(this, 1.0F));
    this.goalSelector.addGoal(8, new FollowParentGoal(this, 1.5F));
    this.goalSelector.addGoal(9, new PuffBugBoostGoal(this));
    this.targetSelector.addGoal(2, new PuffBugTargetAggressorGoal(this));
}
Also used : FollowParentGoal(net.minecraft.entity.ai.goal.FollowParentGoal) BreedGoal(net.minecraft.entity.ai.goal.BreedGoal)

Aggregations

FollowParentGoal (net.minecraft.entity.ai.goal.FollowParentGoal)2 UUID (java.util.UUID)1 AnimalMateGoal (net.minecraft.entity.ai.goal.AnimalMateGoal)1 BreedGoal (net.minecraft.entity.ai.goal.BreedGoal)1 LookAtEntityGoal (net.minecraft.entity.ai.goal.LookAtEntityGoal)1 RevengeGoal (net.minecraft.entity.ai.goal.RevengeGoal)1 SwimGoal (net.minecraft.entity.ai.goal.SwimGoal)1 BeeEntity (net.minecraft.entity.passive.BeeEntity)1 PlayerEntity (net.minecraft.entity.player.PlayerEntity)1 ServerPlayerEntity (net.minecraft.server.network.ServerPlayerEntity)1 BeeSitGoal (nomble.beebuddy.entity.ai.goal.BeeSitGoal)1 FollowFriendGoal (nomble.beebuddy.entity.ai.goal.FollowFriendGoal)1 SitOnHeadGoal (nomble.beebuddy.entity.ai.goal.SitOnHeadGoal)1 Unique (org.spongepowered.asm.mixin.Unique)1