Class CustomNearestTargetGoal<T extends net.minecraft.world.entity.LivingEntity,R extends BasePlant & IFWAction>

java.lang.Object
net.minecraft.world.entity.ai.goal.Goal
nokunami.floral_warfare.common.entity.ai.goal.plants.targeting.CustomTargetGoal
nokunami.floral_warfare.common.entity.ai.goal.plants.targeting.CustomNearestTargetGoal<T,R>
Direct Known Subclasses:
NearestSunTargetGoal, NearestSupportGoal

public class CustomNearestTargetGoal<T extends net.minecraft.world.entity.LivingEntity,R extends BasePlant & IFWAction> extends CustomTargetGoal
  • Field Details

    • targetType

      protected final Class<T extends net.minecraft.world.entity.LivingEntity> targetType
    • randomInterval

      protected final int randomInterval
    • cachedTarget

      @Nullable protected net.minecraft.world.entity.LivingEntity cachedTarget
    • goalConfig

      protected TargetGoalConfig<T extends net.minecraft.world.entity.LivingEntity> goalConfig
    • targetConditions

      protected net.minecraft.world.entity.ai.targeting.TargetingConditions targetConditions
      This filter is applied to the Entity search. Only matching entities will be targeted.
    • horizontalDistance

      protected double horizontalDistance
    • verticalDistance

      protected double verticalDistance
    • priority

      protected TargetPriority priority
  • Constructor Details

    • CustomNearestTargetGoal

      public CustomNearestTargetGoal(R basePlant)
    • CustomNearestTargetGoal

      public CustomNearestTargetGoal(R basePlant, TargetGoalConfig<T> properties)
  • Method Details

    • canUse

      public boolean canUse()
      Specified by:
      canUse in class net.minecraft.world.entity.ai.goal.Goal
    • getTargetSearchArea

      protected net.minecraft.world.phys.AABB getTargetSearchArea()
    • findTarget

      protected void findTarget()
    • start

      public void start()
      Overrides:
      start in class CustomTargetGoal
    • tick

      public void tick()
      Overrides:
      tick in class net.minecraft.world.entity.ai.goal.Goal
    • setTargetAndResetCount

      protected void setTargetAndResetCount(net.minecraft.world.entity.LivingEntity entity)
    • getFollowDistance

      protected double getFollowDistance()
      Overrides:
      getFollowDistance in class CustomTargetGoal
    • setTarget

      protected void setTarget(net.minecraft.world.entity.LivingEntity entity)
      Overrides:
      setTarget in class CustomTargetGoal