Class Brain<E extends LivingEntity>

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

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

  • Constructor Details

  • Method Details

    • provider

      public static <E extends LivingEntity> Brain.BrainCodec<E> provider(Collection<? extends MemoryModuleType<?>> p_233705_0_, Collection<? extends SensorType<? extends Sensor<? super E>>> p_233705_1_)
    • codec

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

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

      private Stream<Brain.MemoryCodec<?>> memories()
    • hasMemoryValue

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

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

      public <U> void setMemory(MemoryModuleType<U> p_218205_1_, @Nullable U p_218205_2_)
    • setMemoryWithExpiry

      public <U> void setMemoryWithExpiry(MemoryModuleType<U> p_233696_1_, U p_233696_2_, long p_233696_3_)
    • setMemory

      public <U> void setMemory(MemoryModuleType<U> p_218226_1_, Optional<? extends U> p_218226_2_)
    • setMemoryInternal

      private <U> void setMemoryInternal(MemoryModuleType<U> p_233709_1_, Optional<? extends Memory<?>> p_233709_2_)
    • getMemory

      public <U> Optional<U> getMemory(MemoryModuleType<U> p_218207_1_)
    • isMemoryValue

      public <U> boolean isMemoryValue(MemoryModuleType<U> p_233708_1_, U p_233708_2_)
    • checkMemory

      public boolean checkMemory(MemoryModuleType<?> p_218196_1_, MemoryModuleStatus p_218196_2_)
    • getSchedule

      public Schedule getSchedule()
    • setSchedule

      public void setSchedule(Schedule p_218203_1_)
    • setCoreActivities

      public void setCoreActivities(Set<Activity> p_218199_1_)
    • getRunningBehaviors

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

      public void useDefaultActivity()
    • getActiveNonCoreActivity

      public Optional<Activity> getActiveNonCoreActivity()
    • setActiveActivityIfPossible

      public void setActiveActivityIfPossible(Activity p_218202_1_)
    • setActiveActivity

      private void setActiveActivity(Activity p_233713_1_)
    • eraseMemoriesForOtherActivitesThan

      private void eraseMemoriesForOtherActivitesThan(Activity p_233715_1_)
    • updateActivityFromSchedule

      public void updateActivityFromSchedule(long p_218211_1_, long p_218211_3_)
    • setActiveActivityToFirstValid

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

      public void setDefaultActivity(Activity p_218200_1_)
    • addActivity

      public void addActivity(Activity p_233698_1_, int p_233698_2_, com.google.common.collect.ImmutableList<? extends Task<? super E>> p_233698_3_)
    • addActivityAndRemoveMemoryWhenStopped

      public void addActivityAndRemoveMemoryWhenStopped(Activity p_233699_1_, int p_233699_2_, com.google.common.collect.ImmutableList<? extends Task<? super E>> p_233699_3_, MemoryModuleType<?> p_233699_4_)
    • addActivity

      public void addActivity(Activity p_218208_1_, com.google.common.collect.ImmutableList<? extends com.mojang.datafixers.util.Pair<Integer,? extends Task<? super E>>> p_218208_2_)
    • addActivityWithConditions

      public void addActivityWithConditions(Activity p_233700_1_, com.google.common.collect.ImmutableList<? extends com.mojang.datafixers.util.Pair<Integer,? extends Task<? super E>>> p_233700_2_, Set<com.mojang.datafixers.util.Pair<MemoryModuleType<?>,MemoryModuleStatus>> p_233700_3_)
    • addActivityAndRemoveMemoriesWhenStopped

      private void addActivityAndRemoveMemoriesWhenStopped(Activity p_233701_1_, com.google.common.collect.ImmutableList<? extends com.mojang.datafixers.util.Pair<Integer,? extends Task<? super E>>> p_233701_2_, Set<com.mojang.datafixers.util.Pair<MemoryModuleType<?>,MemoryModuleStatus>> p_233701_3_, Set<MemoryModuleType<?>> p_233701_4_)
    • isActive

      public boolean isActive(Activity p_218214_1_)
    • copyWithoutBehaviors

      public Brain<E> copyWithoutBehaviors()
    • tick

      public void tick(ServerWorld p_218210_1_, E p_218210_2_)
    • tickSensors

      private void tickSensors(ServerWorld p_233711_1_, E p_233711_2_)
    • forgetOutdatedMemories

      private void forgetOutdatedMemories()
    • stopAll

      public void stopAll(ServerWorld p_218227_1_, E p_218227_2_)
    • startEachNonRunningBehavior

      private void startEachNonRunningBehavior(ServerWorld p_218218_1_, E p_218218_2_)
    • tickEachRunningBehavior

      private void tickEachRunningBehavior(ServerWorld p_218222_1_, E p_218222_2_)
    • activityRequirementsAreMet

      private boolean activityRequirementsAreMet(Activity p_218217_1_)
    • isEmptyCollection

      private boolean isEmptyCollection(Object p_218213_1_)
    • createPriorityPairs

      com.google.common.collect.ImmutableList<? extends com.mojang.datafixers.util.Pair<Integer,? extends Task<? super E>>> createPriorityPairs(int p_233692_1_, com.google.common.collect.ImmutableList<? extends Task<? super E>> p_233692_2_)