Class Tasks
java.lang.Object
net.minecraft.entity.ai.brain.task.Tasks
Contains task-related utility methods.
- Mappings:
Namespace Name named net/minecraft/entity/ai/brain/task/Tasks
intermediary net/minecraft/class_7897
official byb
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <E extends LivingEntity>
SingleTickTask<E> pickRandomly
(List<com.mojang.datafixers.util.Pair<? extends TaskRunnable<? super E>, Integer>> weightedTasks) Returns a task that picks and runs a task fromweightedTasks
randomly.static <E extends LivingEntity>
SingleTickTask<E> weighted
(List<com.mojang.datafixers.util.Pair<? extends TaskRunnable<? super E>, Integer>> weightedTasks, CompositeTask.Order order, CompositeTask.RunMode runMode) Returns a task that runs task(s) fromweightedTasks
.
-
Constructor Details
-
Tasks
public Tasks()
-
-
Method Details
-
pickRandomly
public static <E extends LivingEntity> SingleTickTask<E> pickRandomly(List<com.mojang.datafixers.util.Pair<? extends TaskRunnable<? super E>, Integer>> weightedTasks) Returns a task that picks and runs a task fromweightedTasks
randomly.- Parameters:
weightedTasks
- the list of pairs of the task function and its weight- Returns:
- a task that picks and runs a task from
weightedTasks
randomly - Mappings:
Namespace Name Mixin selector named pickRandomly
Lnet/minecraft/entity/ai/brain/task/Tasks;pickRandomly(Ljava/util/List;)Lnet/minecraft/entity/ai/brain/task/SingleTickTask;
intermediary method_47166
Lnet/minecraft/class_7897;method_47166(Ljava/util/List;)Lnet/minecraft/class_7894;
official a
Lbyb;a(Ljava/util/List;)Lbwq;
-
weighted
public static <E extends LivingEntity> SingleTickTask<E> weighted(List<com.mojang.datafixers.util.Pair<? extends TaskRunnable<? super E>, Integer>> weightedTasks, CompositeTask.Order order, CompositeTask.RunMode runMode) Returns a task that runs task(s) fromweightedTasks
.- Parameters:
weightedTasks
- the list of pairs of the task function and its weightorder
- whether to sort or shuffle the task listrunMode
- whether to run all or just one of the tasks- Returns:
- a task that runs task(s) from
weightedTasks
- Mappings:
Namespace Name Mixin selector named weighted
Lnet/minecraft/entity/ai/brain/task/Tasks;weighted(Ljava/util/List;Lnet/minecraft/entity/ai/brain/task/CompositeTask$Order;Lnet/minecraft/entity/ai/brain/task/CompositeTask$RunMode;)Lnet/minecraft/entity/ai/brain/task/SingleTickTask;
intermediary method_47167
Lnet/minecraft/class_7897;method_47167(Ljava/util/List;Lnet/minecraft/class_4103$class_4104;Lnet/minecraft/class_4103$class_4216;)Lnet/minecraft/class_7894;
official a
Lbyb;a(Ljava/util/List;Lbvt$a;Lbvt$b;)Lbwq;
-