Class Tasks

java.lang.Object
net.minecraft.entity.ai.brain.task.Tasks

public class Tasks extends Object
Contains task-related utility methods.
Mappings:
Namespace Name
named net/minecraft/entity/ai/brain/task/Tasks
intermediary net/minecraft/class_7897
official byf
  • 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 from weightedTasks 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 Lbyf;a(Ljava/util/List;)Lbwu;
    • 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) from weightedTasks.
      Parameters:
      weightedTasks - the list of pairs of the task function and its weight
      order - whether to sort or shuffle the task list
      runMode - 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 Lbyf;a(Ljava/util/List;Lbvx$a;Lbvx$b;)Lbwu;