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/Tasksintermediary net/minecraft/class_7897official byd
-
Constructor Summary
Constructors -
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 fromweightedTasksrandomly.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 fromweightedTasksrandomly.- Parameters:
weightedTasks- the list of pairs of the task function and its weight- Returns:
- a task that picks and runs a task from
weightedTasksrandomly - Mappings:
Namespace Name Mixin selector named pickRandomlyLnet/minecraft/entity/ai/brain/task/Tasks;pickRandomly(Ljava/util/List;)Lnet/minecraft/entity/ai/brain/task/SingleTickTask;intermediary method_47166Lnet/minecraft/class_7897;method_47166(Ljava/util/List;)Lnet/minecraft/class_7894;official aLbyd;a(Ljava/util/List;)Lbws;
-
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 weightedLnet/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_47167Lnet/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 aLbyd;a(Ljava/util/List;Lbvv$a;Lbvv$b;)Lbws;
-