Package net.minecraft.entity.ai.goal
Class GoalSelector
java.lang.Object
net.minecraft.entity.ai.goal.GoalSelector
Manages a set of goals, which are competing for certain controls on the mob.
Multiple goals can run at the same time, so long as they are all using different controls.
A running goal will always be replaced with a goal with a lower priority, if
such a goal exists, it's competing for the same control and its
canStart()
method returns true. (Note that some goals randomize
this method.)
If two goals have the same priority and are competing for the same control, then one goal cannot replace the other if it's running. The goal selector tries to run goals in the order they were added.
- Mappings:
Namespace Name official bmw
intermediary net/minecraft/class_1355
named net/minecraft/entity/ai/goal/GoalSelector
-
Field Summary
Modifier and TypeFieldDescriptionprivate final EnumSet<Goal.Control>
private int
private final Set<PrioritizedGoal>
private final Map<Goal.Control,
PrioritizedGoal> private static final Logger
private static final PrioritizedGoal
private int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a goal with a certain priority.private static boolean
canReplaceAll
(PrioritizedGoal goal, Map<Goal.Control, PrioritizedGoal> goalsByControl) void
void
disableControl
(Goal.Control control) void
enableControl
(Goal.Control control) getGoals()
void
void
setControlEnabled
(Goal.Control control, boolean enabled) void
setTimeInterval
(int timeInterval) void
tick()
void
tickGoals
(boolean tickAll) private static boolean
usesAny
(PrioritizedGoal goal, EnumSet<Goal.Control> controls)
-
Field Details
-
LOGGER
- Mappings:
Namespace Name Mixin selector official a
Lbmw;a:Lorg/slf4j/Logger;
intermediary field_6466
Lnet/minecraft/class_1355;field_6466:Lorg/slf4j/Logger;
named LOGGER
Lnet/minecraft/entity/ai/goal/GoalSelector;LOGGER:Lorg/slf4j/Logger;
-
REPLACEABLE_GOAL
- Mappings:
Namespace Name Mixin selector official b
Lbmw;b:Lboj;
intermediary field_18410
Lnet/minecraft/class_1355;field_18410:Lnet/minecraft/class_4135;
named REPLACEABLE_GOAL
Lnet/minecraft/entity/ai/goal/GoalSelector;REPLACEABLE_GOAL:Lnet/minecraft/entity/ai/goal/PrioritizedGoal;
-
goalsByControl
- Mappings:
Namespace Name Mixin selector official c
Lbmw;c:Ljava/util/Map;
intermediary field_18411
Lnet/minecraft/class_1355;field_18411:Ljava/util/Map;
named goalsByControl
Lnet/minecraft/entity/ai/goal/GoalSelector;goalsByControl:Ljava/util/Map;
-
goals
- Mappings:
Namespace Name Mixin selector official d
Lbmw;d:Ljava/util/Set;
intermediary field_6461
Lnet/minecraft/class_1355;field_6461:Ljava/util/Set;
named goals
Lnet/minecraft/entity/ai/goal/GoalSelector;goals:Ljava/util/Set;
-
profiler
- Mappings:
Namespace Name Mixin selector official e
Lbmw;e:Ljava/util/function/Supplier;
intermediary field_6463
Lnet/minecraft/class_1355;field_6463:Ljava/util/function/Supplier;
named profiler
Lnet/minecraft/entity/ai/goal/GoalSelector;profiler:Ljava/util/function/Supplier;
-
disabledControls
- Mappings:
Namespace Name Mixin selector official f
Lbmw;f:Ljava/util/EnumSet;
intermediary field_6462
Lnet/minecraft/class_1355;field_6462:Ljava/util/EnumSet;
named disabledControls
Lnet/minecraft/entity/ai/goal/GoalSelector;disabledControls:Ljava/util/EnumSet;
-
field_30212
private int field_30212- Mappings:
Namespace Name Mixin selector official g
Lbmw;g:I
intermediary field_30212
Lnet/minecraft/class_1355;field_30212:I
named field_30212
Lnet/minecraft/entity/ai/goal/GoalSelector;field_30212:I
-
timeInterval
private int timeInterval- Mappings:
Namespace Name Mixin selector official h
Lbmw;h:I
intermediary field_6464
Lnet/minecraft/class_1355;field_6464:I
named timeInterval
Lnet/minecraft/entity/ai/goal/GoalSelector;timeInterval:I
-
-
Constructor Details
-
GoalSelector
- Mappings:
Namespace Name Mixin selector official <init>
Lbmw;<init>(Ljava/util/function/Supplier;)V
intermediary <init>
Lnet/minecraft/class_1355;<init>(Ljava/util/function/Supplier;)V
named <init>
Lnet/minecraft/entity/ai/goal/GoalSelector;<init>(Ljava/util/function/Supplier;)V
-
-
Method Details
-
add
Adds a goal with a certain priority. Goals with lower priorities will replace running goals with a higher priority.- Mappings:
Namespace Name Mixin selector official a
Lbmw;a(ILbmv;)V
intermediary method_6277
Lnet/minecraft/class_1355;method_6277(ILnet/minecraft/class_1352;)V
named add
Lnet/minecraft/entity/ai/goal/GoalSelector;add(ILnet/minecraft/entity/ai/goal/Goal;)V
-
clear
- Mappings:
Namespace Name Mixin selector official a
Lbmw;a(Ljava/util/function/Predicate;)V
intermediary method_35113
Lnet/minecraft/class_1355;method_35113(Ljava/util/function/Predicate;)V
named clear
Lnet/minecraft/entity/ai/goal/GoalSelector;clear(Ljava/util/function/Predicate;)V
-
remove
- Mappings:
Namespace Name Mixin selector official a
Lbmw;a(Lbmv;)V
intermediary method_6280
Lnet/minecraft/class_1355;method_6280(Lnet/minecraft/class_1352;)V
named remove
Lnet/minecraft/entity/ai/goal/GoalSelector;remove(Lnet/minecraft/entity/ai/goal/Goal;)V
-
usesAny
- Mappings:
Namespace Name Mixin selector official a
Lbmw;a(Lboj;Ljava/util/EnumSet;)Z
intermediary method_38063
Lnet/minecraft/class_1355;method_38063(Lnet/minecraft/class_4135;Ljava/util/EnumSet;)Z
named usesAny
Lnet/minecraft/entity/ai/goal/GoalSelector;usesAny(Lnet/minecraft/entity/ai/goal/PrioritizedGoal;Ljava/util/EnumSet;)Z
-
canReplaceAll
private static boolean canReplaceAll(PrioritizedGoal goal, Map<Goal.Control, PrioritizedGoal> goalsByControl) - Mappings:
Namespace Name Mixin selector official a
Lbmw;a(Lboj;Ljava/util/Map;)Z
intermediary method_38064
Lnet/minecraft/class_1355;method_38064(Lnet/minecraft/class_4135;Ljava/util/Map;)Z
named canReplaceAll
Lnet/minecraft/entity/ai/goal/GoalSelector;canReplaceAll(Lnet/minecraft/entity/ai/goal/PrioritizedGoal;Ljava/util/Map;)Z
-
tick
public void tick()- Mappings:
Namespace Name Mixin selector official a
Lbmw;a()V
intermediary method_6275
Lnet/minecraft/class_1355;method_6275()V
named tick
Lnet/minecraft/entity/ai/goal/GoalSelector;tick()V
-
tickGoals
public void tickGoals(boolean tickAll) - Mappings:
Namespace Name Mixin selector official a
Lbmw;a(Z)V
intermediary method_38849
Lnet/minecraft/class_1355;method_38849(Z)V
named tickGoals
Lnet/minecraft/entity/ai/goal/GoalSelector;tickGoals(Z)V
-
getGoals
- Mappings:
Namespace Name Mixin selector official b
Lbmw;b()Ljava/util/Set;
intermediary method_35115
Lnet/minecraft/class_1355;method_35115()Ljava/util/Set;
named getGoals
Lnet/minecraft/entity/ai/goal/GoalSelector;getGoals()Ljava/util/Set;
-
getRunningGoals
- Mappings:
Namespace Name Mixin selector official c
Lbmw;c()Ljava/util/stream/Stream;
intermediary method_19048
Lnet/minecraft/class_1355;method_19048()Ljava/util/stream/Stream;
named getRunningGoals
Lnet/minecraft/entity/ai/goal/GoalSelector;getRunningGoals()Ljava/util/stream/Stream;
-
setTimeInterval
public void setTimeInterval(int timeInterval) - Mappings:
Namespace Name Mixin selector official a
Lbmw;a(I)V
intermediary method_35114
Lnet/minecraft/class_1355;method_35114(I)V
named setTimeInterval
Lnet/minecraft/entity/ai/goal/GoalSelector;setTimeInterval(I)V
-
disableControl
- Mappings:
Namespace Name Mixin selector official a
Lbmw;a(Lbmv$a;)V
intermediary method_6274
Lnet/minecraft/class_1355;method_6274(Lnet/minecraft/class_1352$class_4134;)V
named disableControl
Lnet/minecraft/entity/ai/goal/GoalSelector;disableControl(Lnet/minecraft/entity/ai/goal/Goal$Control;)V
-
enableControl
- Mappings:
Namespace Name Mixin selector official b
Lbmw;b(Lbmv$a;)V
intermediary method_6273
Lnet/minecraft/class_1355;method_6273(Lnet/minecraft/class_1352$class_4134;)V
named enableControl
Lnet/minecraft/entity/ai/goal/GoalSelector;enableControl(Lnet/minecraft/entity/ai/goal/Goal$Control;)V
-
setControlEnabled
- Mappings:
Namespace Name Mixin selector official a
Lbmw;a(Lbmv$a;Z)V
intermediary method_6276
Lnet/minecraft/class_1355;method_6276(Lnet/minecraft/class_1352$class_4134;Z)V
named setControlEnabled
Lnet/minecraft/entity/ai/goal/GoalSelector;setControlEnabled(Lnet/minecraft/entity/ai/goal/Goal$Control;Z)V
-