Search in sources :

Example 1 with FollowTargetGoal

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

Aggregations

Lists (com.google.common.collect.Lists)1 List (java.util.List)1 UUID (java.util.UUID)1 Predicate (java.util.function.Predicate)1 EnvType (net.fabricmc.api.EnvType)1 Environment (net.fabricmc.api.Environment)1 MinecraftClient (net.minecraft.client.MinecraftClient)1 net.minecraft.entity (net.minecraft.entity)1 Durations (net.minecraft.entity.ai.Durations)1 BodyControl (net.minecraft.entity.ai.control.BodyControl)1 FollowTargetGoal (net.minecraft.entity.ai.goal.FollowTargetGoal)1 LookAtEntityGoal (net.minecraft.entity.ai.goal.LookAtEntityGoal)1 RevengeGoal (net.minecraft.entity.ai.goal.RevengeGoal)1 UniversalAngerGoal (net.minecraft.entity.ai.goal.UniversalAngerGoal)1 EntityNavigation (net.minecraft.entity.ai.pathing.EntityNavigation)1 AttributeContainer (net.minecraft.entity.attribute.AttributeContainer)1 EntityAttributes (net.minecraft.entity.attribute.EntityAttributes)1 DamageSource (net.minecraft.entity.damage.DamageSource)1 DataTracker (net.minecraft.entity.data.DataTracker)1 TrackedData (net.minecraft.entity.data.TrackedData)1