Class Tasks
java.lang.Object
net.minecraft.entity.ai.brain.task.Tasks
Contains task-related utility methods.
- Mappings:
Namespace Name official bkk
intermediary net/minecraft/class_7897
named net/minecraft/entity/ai/brain/task/Tasks
-
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 official a
Lbkk;a(Ljava/util/List;)Lbiz;
intermediary method_47166
Lnet/minecraft/class_7897;method_47166(Ljava/util/List;)Lnet/minecraft/class_7894;
named pickRandomly
Lnet/minecraft/entity/ai/brain/task/Tasks;pickRandomly(Ljava/util/List;)Lnet/minecraft/entity/ai/brain/task/SingleTickTask;
-
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 official a
Lbkk;a(Ljava/util/List;Lbid$a;Lbid$b;)Lbiz;
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;
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;
-