Interface EntityScheduleManager


public interface EntityScheduleManager
Represents the Schedule Manager for this Entity.

A Schedule is a routine that the Mob performs between every MC Day and Night, starting at 0 ticks and ending at 24,000 ticks.

Activities can switch automatically depending on the current action (e.g. during a raid Activity.RAID will be used). Setting active activities that do not apply to the Mob or are set at a poor time will be ignored.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Removes all activities from the current Activity Map.
    @NotNull Set<Activity>
    Fetches a set of all active activities.
    @Nullable Schedule
    Deprecated.
    Schedules no longer exist in 1.21.11+
    @Nullable Activity
    Fetches the Secondary Activity that is currently running.
    boolean
    Whether the current running Activity Map is empty.
    boolean
    isRunning(@NotNull Activity activity)
    Whether this Activity is currently active and running.
    @Nullable Consumer<Mob>
    put(@NotNull Activity a, Consumer<Mob> func)
    Associates an Activity with a function.
    default void
    Associates all the activities with their respective functions.
    void
    setDefaultActivity(@NotNull Activity activity)
    Sets the current default Activity when no schedule is present.
    void
    setRunningActivity(@NotNull Activity activity)
    Sets the Secondary Activity that is currently running.
    void
    setSchedule(@NotNull Schedule schedule)
    Deprecated.
    Schedules no longer exist in 1.21.11+
    int
    Fetches the current Activity Map size.
    void
    Uses the current default activity, overriding the current schedule.
  • Method Details

    • getCurrentSchedule

      @Nullable @Deprecated @Nullable Schedule getCurrentSchedule()
      Deprecated.
      Schedules no longer exist in 1.21.11+
      Fetches the current schedule that this Mob has.
      Returns:
      Current Schedule, or null if none
    • setSchedule

      @Deprecated void setSchedule(@NotNull @NotNull Schedule schedule)
      Deprecated.
      Schedules no longer exist in 1.21.11+
      Sets the current schedule.
      Parameters:
      schedule - Schedule to set
    • getActiveActivities

      @NotNull @NotNull Set<Activity> getActiveActivities()
      Fetches a set of all active activities.
      Returns:
      Set of active activities
    • setDefaultActivity

      void setDefaultActivity(@NotNull @NotNull Activity activity)
      Sets the current default Activity when no schedule is present.
      Parameters:
      activity - Activity to set
    • useDefaultActivity

      void useDefaultActivity()
      Uses the current default activity, overriding the current schedule.
    • setRunningActivity

      void setRunningActivity(@NotNull @NotNull Activity activity)
      Sets the Secondary Activity that is currently running.

      This activity wil not override the Activities in the current schedule, but is useful when running two activities at once.
      Parameters:
      activity - Activity Running
    • getRunningActivity

      @Nullable @Nullable Activity getRunningActivity()
      Fetches the Secondary Activity that is currently running.
      Returns:
      Secondary Activity Running, or null if none
    • isRunning

      boolean isRunning(@NotNull @NotNull Activity activity)
      Whether this Activity is currently active and running.
      Parameters:
      activity - Activity to check
      Returns:
      true if active, else false
    • put

      @Nullable @Nullable Consumer<Mob> put(@NotNull @NotNull Activity a, Consumer<Mob> func)
      Associates an Activity with a function.
      Parameters:
      a - Activity to add
      func - Function associated with this Activity
      Returns:
      Function added
    • isEmpty

      boolean isEmpty()
      Whether the current running Activity Map is empty.
      Returns:
      true if no activities are associated, else false
    • size

      int size()
      Fetches the current Activity Map size.
      Returns:
      Activity Map Size
    • putAll

      default void putAll(Map<Activity, Consumer<Mob>> map)
      Associates all the activities with their respective functions.
      Parameters:
      map - Activity Map to put
    • clear

      void clear()
      Removes all activities from the current Activity Map.