Search in sources :

Example 1 with RangedAttackGoal

use of net.minecraft.entity.ai.goal.RangedAttackGoal in project Hostile-Mobs-and-Girls by Mechalopa.

the class ArurauneEntity method registerGoals.

@Override
protected void registerGoals() {
    this.goalSelector.addGoal(1, new SwimGoal(this));
    this.goalSelector.addGoal(4, new RangedAttackGoal(this, 1.0D, 40, 60, 10.0F));
    this.goalSelector.addGoal(5, new WaterAvoidingRandomWalkingGoal(this, 1.0D));
    this.goalSelector.addGoal(6, new LookAtGoal(this, PlayerEntity.class, 8.0F));
    this.goalSelector.addGoal(6, new LookRandomlyGoal(this));
    this.targetSelector.addGoal(1, new HurtByTargetGoal(this));
    this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, PlayerEntity.class, true));
    if (ModConfigs.cachedServer.ARURAUNE_ATTACK_VILLAGERS)
        this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, AbstractVillagerEntity.class, false));
    this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, IronGolemEntity.class, true));
}
Also used : LookAtGoal(net.minecraft.entity.ai.goal.LookAtGoal) LookRandomlyGoal(net.minecraft.entity.ai.goal.LookRandomlyGoal) WaterAvoidingRandomWalkingGoal(net.minecraft.entity.ai.goal.WaterAvoidingRandomWalkingGoal) HurtByTargetGoal(net.minecraft.entity.ai.goal.HurtByTargetGoal) IronGolemEntity(net.minecraft.entity.passive.IronGolemEntity) NearestAttackableTargetGoal(net.minecraft.entity.ai.goal.NearestAttackableTargetGoal) RangedAttackGoal(net.minecraft.entity.ai.goal.RangedAttackGoal) SwimGoal(net.minecraft.entity.ai.goal.SwimGoal) PlayerEntity(net.minecraft.entity.player.PlayerEntity)

Example 2 with RangedAttackGoal

use of net.minecraft.entity.ai.goal.RangedAttackGoal in project DivineRPG by DivineRPG.

the class EntityFrostArcher method registerGoals.

@Override
protected void registerGoals() {
    super.registerGoals();
    addAttackingAI();
    goalSelector.addGoal(0, new RangedAttackGoal(this, this.getAttribute(Attributes.MOVEMENT_SPEED).getBaseValue(), 3, (float) getAttribute(Attributes.FOLLOW_RANGE).getBaseValue()));
}
Also used : RangedAttackGoal(net.minecraft.entity.ai.goal.RangedAttackGoal)

Example 3 with RangedAttackGoal

use of net.minecraft.entity.ai.goal.RangedAttackGoal in project DivineRPG by DivineRPG.

the class EntityKingOfScorchers method registerGoals.

@Override
protected void registerGoals() {
    super.registerGoals();
    this.goalSelector.addGoal(2, new RangedAttackGoal(this, 1.0D, 40, 32.0F));
    this.goalSelector.addGoal(1, new NearestAttackableTargetGoal<>(this, PlayerEntity.class, true));
    this.targetSelector.addGoal(1, new NearestAttackableTargetGoal<>(this, PlayerEntity.class, 10, true, false, (entity) -> {
        return Math.abs(entity.getY() - this.getY()) <= 4.0D;
    }));
}
Also used : PlayerEntity(net.minecraft.entity.player.PlayerEntity) World(net.minecraft.world.World) Color(net.minecraft.world.BossInfo.Color) EntityStats(divinerpg.util.EntityStats) EntityKingOfScorchersShot(divinerpg.entities.projectile.EntityKingOfScorchersShot) DamageSource(net.minecraft.util.DamageSource) ProjectileEntity(net.minecraft.entity.projectile.ProjectileEntity) AttributeModifierMap(net.minecraft.entity.ai.attributes.AttributeModifierMap) EntityDivineBoss(divinerpg.entities.base.EntityDivineBoss) RangedAttackGoal(net.minecraft.entity.ai.goal.RangedAttackGoal) EntityKingOfScorchersMeteor(divinerpg.entities.projectile.EntityKingOfScorchersMeteor) Attributes(net.minecraft.entity.ai.attributes.Attributes) MathHelper(net.minecraft.util.math.MathHelper) net.minecraft.entity(net.minecraft.entity) SoundRegistry(divinerpg.registries.SoundRegistry) NearestAttackableTargetGoal(net.minecraft.entity.ai.goal.NearestAttackableTargetGoal) EntityRegistry(divinerpg.registries.EntityRegistry) MonsterEntity(net.minecraft.entity.monster.MonsterEntity) SoundEvent(net.minecraft.util.SoundEvent) RangedAttackGoal(net.minecraft.entity.ai.goal.RangedAttackGoal) PlayerEntity(net.minecraft.entity.player.PlayerEntity)

Example 4 with RangedAttackGoal

use of net.minecraft.entity.ai.goal.RangedAttackGoal in project Hostile-Mobs-and-Girls by Mechalopa.

the class MeltyMonsterEntity method registerGoals.

@Override
protected void registerGoals() {
    this.goalSelector.addGoal(2, new AvoidEntityGoal<>(this, StriderEntity.class, 10.0F, 1.0D, 1.5D));
    this.goalSelector.addGoal(3, new MeltyMonsterEntity.MoveToLavaGoal(this, 1.5D));
    this.goalSelector.addGoal(5, new RangedAttackGoal(this, 1.0D, 30, 40, 8.0F));
    this.goalSelector.addGoal(6, new WaterAvoidingRandomWalkingGoal(this, 1.0D));
    this.goalSelector.addGoal(7, new LookAtGoal(this, PlayerEntity.class, 8.0F));
    this.goalSelector.addGoal(7, new LookRandomlyGoal(this));
    this.targetSelector.addGoal(1, new HurtByTargetGoal(this));
    this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, PlayerEntity.class, 10, true, false, (p) -> {
        return !(p.getVehicle() instanceof StriderEntity);
    }));
}
Also used : StriderEntity(net.minecraft.entity.passive.StriderEntity) EntityType(net.minecraft.entity.EntityType) Random(java.util.Random) Direction(net.minecraft.util.Direction) SpawnReason(net.minecraft.entity.SpawnReason) StriderEntity(net.minecraft.entity.passive.StriderEntity) PathType(net.minecraft.pathfinding.PathType) BlockState(net.minecraft.block.BlockState) HurtByTargetGoal(net.minecraft.entity.ai.goal.HurtByTargetGoal) PlayerEntity(net.minecraft.entity.player.PlayerEntity) LivingEntity(net.minecraft.entity.LivingEntity) Pose(net.minecraft.entity.Pose) MoveToBlockGoal(net.minecraft.entity.ai.goal.MoveToBlockGoal) ForgeEventFactory(net.minecraftforge.event.ForgeEventFactory) GroundPathNavigator(net.minecraft.pathfinding.GroundPathNavigator) AbstractFireBlock(net.minecraft.block.AbstractFireBlock) WaterAvoidingRandomWalkingGoal(net.minecraft.entity.ai.goal.WaterAvoidingRandomWalkingGoal) EntitySize(net.minecraft.entity.EntitySize) IWorldReader(net.minecraft.world.IWorldReader) PathNodeType(net.minecraft.pathfinding.PathNodeType) LookAtGoal(net.minecraft.entity.ai.goal.LookAtGoal) SmallFireballEntity(net.minecraft.entity.projectile.SmallFireballEntity) RangedAttackGoal(net.minecraft.entity.ai.goal.RangedAttackGoal) Attributes(net.minecraft.entity.ai.attributes.Attributes) IPacket(net.minecraft.network.IPacket) AvoidEntityGoal(net.minecraft.entity.ai.goal.AvoidEntityGoal) NetworkHooks(net.minecraftforge.fml.network.NetworkHooks) NearestAttackableTargetGoal(net.minecraft.entity.ai.goal.NearestAttackableTargetGoal) ISelectionContext(net.minecraft.util.math.shapes.ISelectionContext) IServerWorld(net.minecraft.world.IServerWorld) Nonnull(javax.annotation.Nonnull) PathNavigator(net.minecraft.pathfinding.PathNavigator) WalkNodeProcessor(net.minecraft.pathfinding.WalkNodeProcessor) FluidTags(net.minecraft.tags.FluidTags) World(net.minecraft.world.World) PathFinder(net.minecraft.pathfinding.PathFinder) BlockPos(net.minecraft.util.math.BlockPos) FlowingFluidBlock(net.minecraft.block.FlowingFluidBlock) DamageSource(net.minecraft.util.DamageSource) Blocks(net.minecraft.block.Blocks) SoundEvents(net.minecraft.util.SoundEvents) AttributeModifierMap(net.minecraft.entity.ai.attributes.AttributeModifierMap) ParticleTypes(net.minecraft.particles.ParticleTypes) MathHelper(net.minecraft.util.math.MathHelper) ModConfigs(hmag.ModConfigs) Fluid(net.minecraft.fluid.Fluid) LookRandomlyGoal(net.minecraft.entity.ai.goal.LookRandomlyGoal) IRangedAttackMob(net.minecraft.entity.IRangedAttackMob) MonsterEntity(net.minecraft.entity.monster.MonsterEntity) SoundEvent(net.minecraft.util.SoundEvent) LookAtGoal(net.minecraft.entity.ai.goal.LookAtGoal) LookRandomlyGoal(net.minecraft.entity.ai.goal.LookRandomlyGoal) WaterAvoidingRandomWalkingGoal(net.minecraft.entity.ai.goal.WaterAvoidingRandomWalkingGoal) HurtByTargetGoal(net.minecraft.entity.ai.goal.HurtByTargetGoal) RangedAttackGoal(net.minecraft.entity.ai.goal.RangedAttackGoal) PlayerEntity(net.minecraft.entity.player.PlayerEntity)

Example 5 with RangedAttackGoal

use of net.minecraft.entity.ai.goal.RangedAttackGoal in project DivineRPG by DivineRPG.

the class EntityFrost method registerGoals.

@Override
protected void registerGoals() {
    super.registerGoals();
    addAttackingAI();
    this.goalSelector.addGoal(2, new RangedAttackGoal(this, 1.0D, 40, 20.0F));
}
Also used : RangedAttackGoal(net.minecraft.entity.ai.goal.RangedAttackGoal)

Aggregations

RangedAttackGoal (net.minecraft.entity.ai.goal.RangedAttackGoal)5 NearestAttackableTargetGoal (net.minecraft.entity.ai.goal.NearestAttackableTargetGoal)3 PlayerEntity (net.minecraft.entity.player.PlayerEntity)3 AttributeModifierMap (net.minecraft.entity.ai.attributes.AttributeModifierMap)2 Attributes (net.minecraft.entity.ai.attributes.Attributes)2 HurtByTargetGoal (net.minecraft.entity.ai.goal.HurtByTargetGoal)2 LookAtGoal (net.minecraft.entity.ai.goal.LookAtGoal)2 LookRandomlyGoal (net.minecraft.entity.ai.goal.LookRandomlyGoal)2 WaterAvoidingRandomWalkingGoal (net.minecraft.entity.ai.goal.WaterAvoidingRandomWalkingGoal)2 MonsterEntity (net.minecraft.entity.monster.MonsterEntity)2 DamageSource (net.minecraft.util.DamageSource)2 SoundEvent (net.minecraft.util.SoundEvent)2 EntityDivineBoss (divinerpg.entities.base.EntityDivineBoss)1 EntityKingOfScorchersMeteor (divinerpg.entities.projectile.EntityKingOfScorchersMeteor)1 EntityKingOfScorchersShot (divinerpg.entities.projectile.EntityKingOfScorchersShot)1 EntityRegistry (divinerpg.registries.EntityRegistry)1 SoundRegistry (divinerpg.registries.SoundRegistry)1 EntityStats (divinerpg.util.EntityStats)1 ModConfigs (hmag.ModConfigs)1 Random (java.util.Random)1