Class Brain<E extends LivingEntity>

java.lang.Object
net.minecraft.world.entity.ai.Brain<E>

public class Brain<E extends LivingEntity> extends Object
  • Field Details

  • Constructor Details

  • Method Details

    • provider

      public static <E extends LivingEntity> Brain.Provider<E> provider(Collection<? extends MemoryModuleType<?>> p_21924_, Collection<? extends SensorType<? extends Sensor<? super E>>> p_21925_)
    • codec

      public static <E extends LivingEntity> com.mojang.serialization.Codec<Brain<E>> codec(Collection<? extends MemoryModuleType<?>> p_21947_, Collection<? extends SensorType<? extends Sensor<? super E>>> p_21948_)
    • serializeStart

      public <T> com.mojang.serialization.DataResult<T> serializeStart(com.mojang.serialization.DynamicOps<T> p_21915_)
    • memories

      Stream<Brain.MemoryValue<?>> memories()
    • hasMemoryValue

      public boolean hasMemoryValue(MemoryModuleType<?> p_21875_)
    • eraseMemory

      public <U> void eraseMemory(MemoryModuleType<U> p_21937_)
    • setMemory

      public <U> void setMemory(MemoryModuleType<U> p_21880_, @Nullable U p_21881_)
    • setMemoryWithExpiry

      public <U> void setMemoryWithExpiry(MemoryModuleType<U> p_21883_, U p_21884_, long p_21885_)
    • setMemory

      public <U> void setMemory(MemoryModuleType<U> p_21887_, Optional<? extends U> p_21888_)
    • setMemoryInternal

      <U> void setMemoryInternal(MemoryModuleType<U> p_21942_, Optional<? extends ExpirableValue<?>> p_21943_)
    • getMemory

      public <U> Optional<U> getMemory(MemoryModuleType<U> p_21953_)
    • getTimeUntilExpiry

      public <U> long getTimeUntilExpiry(MemoryModuleType<U> p_147342_)
    • getMemories

      @Deprecated public Map<MemoryModuleType<?>,​Optional<? extends ExpirableValue<?>>> getMemories()
      Deprecated.
    • isMemoryValue

      public <U> boolean isMemoryValue(MemoryModuleType<U> p_21939_, U p_21940_)
    • checkMemory

      public boolean checkMemory(MemoryModuleType<?> p_21877_, MemoryStatus p_21878_)
    • getSchedule

      public Schedule getSchedule()
    • setSchedule

      public void setSchedule(Schedule p_21913_)
    • setCoreActivities

      public void setCoreActivities(Set<Activity> p_21931_)
    • getActiveActivities

      @Deprecated public Set<Activity> getActiveActivities()
      Deprecated.
    • getRunningBehaviors

      @Deprecated public List<Behavior<? super E>> getRunningBehaviors()
      Deprecated.
    • useDefaultActivity

      public void useDefaultActivity()
    • getActiveNonCoreActivity

      public Optional<Activity> getActiveNonCoreActivity()
    • setActiveActivityIfPossible

      public void setActiveActivityIfPossible(Activity p_21890_)
    • setActiveActivity

      private void setActiveActivity(Activity p_21961_)
    • eraseMemoriesForOtherActivitesThan

      private void eraseMemoriesForOtherActivitesThan(Activity p_21967_)
    • updateActivityFromSchedule

      public void updateActivityFromSchedule(long p_21863_, long p_21864_)
    • setActiveActivityToFirstValid

      public void setActiveActivityToFirstValid(List<Activity> p_21927_)
    • setDefaultActivity

      public void setDefaultActivity(Activity p_21945_)
    • addActivity

      public void addActivity(Activity p_21892_, int p_21893_, com.google.common.collect.ImmutableList<? extends Behavior<? super E>> p_21894_)
    • addActivityAndRemoveMemoryWhenStopped

      public void addActivityAndRemoveMemoryWhenStopped(Activity p_21896_, int p_21897_, com.google.common.collect.ImmutableList<? extends Behavior<? super E>> p_21898_, MemoryModuleType<?> p_21899_)
    • addActivity

      public void addActivity(Activity p_21901_, com.google.common.collect.ImmutableList<? extends com.mojang.datafixers.util.Pair<Integer,​? extends Behavior<? super E>>> p_21902_)
    • addActivityWithConditions

      public void addActivityWithConditions(Activity p_21904_, com.google.common.collect.ImmutableList<? extends com.mojang.datafixers.util.Pair<Integer,​? extends Behavior<? super E>>> p_21905_, Set<com.mojang.datafixers.util.Pair<MemoryModuleType<?>,​MemoryStatus>> p_21906_)
    • addActivityAndRemoveMemoriesWhenStopped

      public void addActivityAndRemoveMemoriesWhenStopped(Activity p_21908_, com.google.common.collect.ImmutableList<? extends com.mojang.datafixers.util.Pair<Integer,​? extends Behavior<? super E>>> p_21909_, Set<com.mojang.datafixers.util.Pair<MemoryModuleType<?>,​MemoryStatus>> p_21910_, Set<MemoryModuleType<?>> p_21911_)
    • removeAllBehaviors

      public void removeAllBehaviors()
    • isActive

      public boolean isActive(Activity p_21955_)
    • copyWithoutBehaviors

      public Brain<E> copyWithoutBehaviors()
    • tick

      public void tick(ServerLevel p_21866_, E p_21867_)
    • tickSensors

      private void tickSensors(ServerLevel p_21950_, E p_21951_)
    • forgetOutdatedMemories

      private void forgetOutdatedMemories()
    • stopAll

      public void stopAll(ServerLevel p_21934_, E p_21935_)
    • startEachNonRunningBehavior

      private void startEachNonRunningBehavior(ServerLevel p_21958_, E p_21959_)
    • tickEachRunningBehavior

      private void tickEachRunningBehavior(ServerLevel p_21964_, E p_21965_)
    • activityRequirementsAreMet

      private boolean activityRequirementsAreMet(Activity p_21970_)
    • isEmptyCollection

      private boolean isEmptyCollection(Object p_21919_)
    • createPriorityPairs

      com.google.common.collect.ImmutableList<? extends com.mojang.datafixers.util.Pair<Integer,​? extends Behavior<? super E>>> createPriorityPairs(int p_21860_, com.google.common.collect.ImmutableList<? extends Behavior<? super E>> p_21861_)