Interface EntityScheduleManager
public interface EntityScheduleManager
Represents the Schedule Manager for this Entity.
A
Activities can switch automatically depending on the current action (e.g. during a raid
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 TypeMethodDescriptionvoidclear()Removes all activities from the current Activity Map.Fetches a set of all active activities.@Nullable ScheduleDeprecated.Schedules no longer exist in 1.21.11+@Nullable ActivityFetches the Secondary Activity that is currently running.booleanisEmpty()Whether the current running Activity Map is empty.booleanWhether this Activity is currently active and running.Associates an Activity with a function.default voidAssociates all the activities with their respective functions.voidsetDefaultActivity(@NotNull Activity activity) Sets the current default Activity when no schedule is present.voidsetRunningActivity(@NotNull Activity activity) Sets the Secondary Activity that is currently running.voidsetSchedule(@NotNull Schedule schedule) Deprecated.Schedules no longer exist in 1.21.11+intsize()Fetches the current Activity Map size.voidUses the current default activity, overriding the current schedule.
-
Method Details
-
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.Schedules no longer exist in 1.21.11+Sets the current schedule.- Parameters:
schedule- Schedule to set
-
getActiveActivities
-
setDefaultActivity
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
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
Fetches the Secondary Activity that is currently running.- Returns:
- Secondary Activity Running, or null if none
-
isRunning
Whether this Activity is currently active and running.- Parameters:
activity- Activity to check- Returns:
- true if active, else false
-
put
-
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
-
clear
void clear()Removes all activities from the current Activity Map.
-