Class EntityAIGroup

java.lang.Object
net.minestom.server.entity.ai.EntityAIGroup

public class EntityAIGroup extends Object
Represents a group of entity's AI. It may contains goal selectors and target selectors. All AI groups of a single entity are independent of each other.
  • Constructor Details

    • EntityAIGroup

      public EntityAIGroup()
  • Method Details

    • getGoalSelectors

      @NotNull public @NotNull List<GoalSelector> getGoalSelectors()
      Gets the goal selectors of this group.
      Returns:
      a modifiable list containing this group goal selectors
    • getTargetSelectors

      @NotNull public @NotNull List<TargetSelector> getTargetSelectors()
      Gets the target selectors of this group.
      Returns:
      a modifiable list containing this group target selectors
    • getCurrentGoalSelector

      @Nullable public @Nullable GoalSelector getCurrentGoalSelector()
      Gets the current goal selector of this group.
      Returns:
      the current goal selector of this group, null if not any
    • setCurrentGoalSelector

      public void setCurrentGoalSelector(@Nullable @Nullable GoalSelector goalSelector)
      Changes the current goal selector of this group.

      Mostly unsafe since the current goal selector should normally be chosen during the group tick method.

      Parameters:
      goalSelector - the new goal selector of this group, null to disable it
    • tick

      public void tick(long time)