Class GoalSelector
java.lang.Object
net.minecraft.world.entity.ai.goal.GoalSelector
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Set<WrappedGoal> private final Map<Goal.Flag, WrappedGoal> Goals currently using a particular flagprivate static final WrappedGoalprivate final Supplier<ProfilerFiller> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a goal to the GoalSelector with a certain priority.voiddisableControlFlag(Goal.Flag flag) voidenableControlFlag(Goal.Flag flag) private static booleangoalCanBeReplacedForAllFlags(WrappedGoal goal, Map<Goal.Flag, WrappedGoal> flag) private static booleangoalContainsAnyFlags(WrappedGoal goal, EnumSet<Goal.Flag> flag) voidremoveAllGoals(Predicate<Goal> filter) voidremoveGoal(Goal goal) Remove the goal from the GoalSelector.voidsetControlFlag(Goal.Flag flag, boolean enabled) voidtick()voidtickRunningGoals(boolean tickAllRunning)
-
Field Details
-
NO_GOAL
-
lockedFlags
Goals currently using a particular flag -
availableGoals
-
profiler
-
disabledFlags
-
-
Constructor Details
-
GoalSelector
-
-
Method Details
-
addGoal
Add a goal to the GoalSelector with a certain priority. Lower numbers are higher priority. -
removeAllGoals
-
removeGoal
Remove the goal from the GoalSelector. This must be the same object as the goal you are trying to remove, which may not always be accessible. -
goalContainsAnyFlags
-
goalCanBeReplacedForAllFlags
private static boolean goalCanBeReplacedForAllFlags(WrappedGoal goal, Map<Goal.Flag, WrappedGoal> flag) -
tick
public void tick() -
tickRunningGoals
public void tickRunningGoals(boolean tickAllRunning) -
getAvailableGoals
-
disableControlFlag
-
enableControlFlag
-
setControlFlag
-