Search in sources :

Example 6 with MeleeAttackGoal

use of net.minecraft.world.entity.ai.goal.MeleeAttackGoal in project Tropicraft by Tropicraft.

the class TropiCreeperEntity method registerGoals.

@Override
protected void registerGoals() {
    this.goalSelector.addGoal(1, new FloatGoal(this));
    this.goalSelector.addGoal(2, new TropiCreeperSwellGoal(this));
    this.goalSelector.addGoal(3, new AvoidEntityGoal<>(this, Ocelot.class, 6.0F, 1.0D, 1.2D));
    this.goalSelector.addGoal(3, new AvoidEntityGoal<>(this, Cat.class, 6.0F, 1.0D, 1.2D));
    this.goalSelector.addGoal(4, new MeleeAttackGoal(this, 1.0D, false));
    this.goalSelector.addGoal(5, new WaterAvoidingRandomStrollGoal(this, 0.8D));
    this.goalSelector.addGoal(6, new LookAtPlayerGoal(this, Player.class, 8.0F));
    this.goalSelector.addGoal(6, new RandomLookAroundGoal(this));
    this.targetSelector.addGoal(1, new NearestAttackableTargetGoal<>(this, Player.class, true));
    this.targetSelector.addGoal(2, new HurtByTargetGoal(this));
}
Also used : Ocelot(net.minecraft.world.entity.animal.Ocelot) RandomLookAroundGoal(net.minecraft.world.entity.ai.goal.RandomLookAroundGoal) Player(net.minecraft.world.entity.player.Player) WaterAvoidingRandomStrollGoal(net.minecraft.world.entity.ai.goal.WaterAvoidingRandomStrollGoal) LookAtPlayerGoal(net.minecraft.world.entity.ai.goal.LookAtPlayerGoal) MeleeAttackGoal(net.minecraft.world.entity.ai.goal.MeleeAttackGoal) Cat(net.minecraft.world.entity.animal.Cat) HurtByTargetGoal(net.minecraft.world.entity.ai.goal.target.HurtByTargetGoal) FloatGoal(net.minecraft.world.entity.ai.goal.FloatGoal) TropiCreeperSwellGoal(net.tropicraft.core.common.entity.ai.TropiCreeperSwellGoal)

Aggregations

FloatGoal (net.minecraft.world.entity.ai.goal.FloatGoal)6 LookAtPlayerGoal (net.minecraft.world.entity.ai.goal.LookAtPlayerGoal)6 MeleeAttackGoal (net.minecraft.world.entity.ai.goal.MeleeAttackGoal)6 Player (net.minecraft.world.entity.player.Player)6 RandomLookAroundGoal (net.minecraft.world.entity.ai.goal.RandomLookAroundGoal)5 HurtByTargetGoal (net.minecraft.world.entity.ai.goal.target.HurtByTargetGoal)4 MoveTowardsRestrictionGoal (net.minecraft.world.entity.ai.goal.MoveTowardsRestrictionGoal)3 WaterAvoidingRandomStrollGoal (net.minecraft.world.entity.ai.goal.WaterAvoidingRandomStrollGoal)3 EntityAIWanderNotLazy (net.tropicraft.core.common.entity.ai.EntityAIWanderNotLazy)2 AgeableMob (net.minecraft.world.entity.AgeableMob)1 LivingEntity (net.minecraft.world.entity.LivingEntity)1 Mob (net.minecraft.world.entity.Mob)1 FollowOwnerGoal (net.minecraft.world.entity.ai.goal.FollowOwnerGoal)1 LeapAtTargetGoal (net.minecraft.world.entity.ai.goal.LeapAtTargetGoal)1 RandomStrollGoal (net.minecraft.world.entity.ai.goal.RandomStrollGoal)1 SitWhenOrderedToGoal (net.minecraft.world.entity.ai.goal.SitWhenOrderedToGoal)1 TradeWithPlayerGoal (net.minecraft.world.entity.ai.goal.TradeWithPlayerGoal)1 WrappedGoal (net.minecraft.world.entity.ai.goal.WrappedGoal)1 NearestAttackableTargetGoal (net.minecraft.world.entity.ai.goal.target.NearestAttackableTargetGoal)1 OwnerHurtByTargetGoal (net.minecraft.world.entity.ai.goal.target.OwnerHurtByTargetGoal)1