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 WrappedGoal
private final Supplier
<ProfilerFiller> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a goal to the GoalSelector with a certain priority.void
disableControlFlag
(Goal.Flag flag) void
enableControlFlag
(Goal.Flag flag) private static boolean
goalCanBeReplacedForAllFlags
(WrappedGoal goal, Map<Goal.Flag, WrappedGoal> flag) private static boolean
goalContainsAnyFlags
(WrappedGoal goal, EnumSet<Goal.Flag> flag) void
removeAllGoals
(Predicate<Goal> filter) void
removeGoal
(Goal goal) Remove the goal from the GoalSelector.void
setControlFlag
(Goal.Flag flag, boolean enabled) void
tick()
void
tickRunningGoals
(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
-