net.minecraft.world.entity.ai

public class Brain<E extends LivingEntity>

bha
net.minecraft.world.entity.ai.Brain
net.minecraft.class_4095
net.minecraft.entity.ai.brain.Brain
net.minecraft.src.C_548_
net.minecraft.world.entity.ai.BehaviorController

Field summary

Modifier and TypeField
static final org.slf4j.Logger
a
LOGGER
field_24656
LOGGER
f_21841_
private final Supplier<com.mojang.serialization.Codec<Brain<E>>>
b
codec
field_24657
codecSupplier
f_21842_
private static final int
c
SCHEDULE_UPDATE_DELAY
field_30096
ACTIVITY_REFRESH_COOLDOWN
f_147338_
private final Map<MemoryModuleType<?>, Optional<? extends ExpirableValue<?>>>
d
memories
field_18322
memories
f_21843_
private final Map<SensorType<? extends Sensor<? super E>>, Sensor<? super E>>
e
sensors
field_18323
sensors
f_21844_
private final Map<Integer, Map<Activity, Set<BehaviorControl<? super E>>>>
f
availableBehaviorsByPriority
field_18324
tasks
f_21845_
private Schedule
g
schedule
field_18325
schedule
f_21846_
private final Map<Activity, Set<com.mojang.datafixers.util.Pair<MemoryModuleType<?>, MemoryStatus>>>
h
activityRequirements
field_18326
requiredActivityMemories
f_21847_
private final Map<Activity, Set<MemoryModuleType<?>>>
i
activityMemoriesToEraseWhenStopped
field_22282
forgettingActivityMemories
f_21848_
private Set<Activity>
j
coreActivities
field_18327
coreActivities
f_21849_
private final Set<Activity>
k
activeActivities
field_18328
possibleActivities
f_21850_
private Activity
l
defaultActivity
field_18329
defaultActivity
f_21851_
private long
m
lastScheduleUpdate
field_18853
activityStartTime
f_21852_

Constructor summary

ModifierConstructor
public (Collection<? extends MemoryModuleType<?>> memories, Collection<? extends SensorType<? extends Sensor<? super E>>> sensors, com.google.common.collect.ImmutableList<Brain$MemoryValue<?>> memoryEntries, Supplier<com.mojang.serialization.Codec<Brain<E>>> codecSupplier)

Method summary

Modifier and TypeMethod
public static <E extends LivingEntity> Brain$Provider<E>
a(Collection<? extends bpb<?>> arg0, Collection<? extends bqg<? extends bqf<? super E>>> arg1)
provider(Collection<? extends MemoryModuleType<?>> arg0, Collection<? extends SensorType<? extends Sensor<? super E>>> arg1)
method_28311(Collection<? extends class_4140<?>> arg0, Collection<? extends class_4149<? extends class_4148<? super E>>> arg1)
createProfile(Collection<? extends MemoryModuleType<?>> memoryModules, Collection<? extends SensorType<? extends Sensor<? super E>>> sensors)
m_21923_(Collection<? extends C_753_<?>> p_21924_, Collection<? extends C_777_<? extends C_776_<? super E>>> p_21925_)
public static <E extends LivingEntity> com.mojang.serialization.Codec<Brain<E>>
b(Collection<? extends bpb<?>> arg0, Collection<? extends bqg<? extends bqf<? super E>>> arg1)
codec(Collection<? extends MemoryModuleType<?>> arg0, Collection<? extends SensorType<? extends Sensor<? super E>>> arg1)
method_28313(Collection<? extends class_4140<?>> arg0, Collection<? extends class_4149<? extends class_4148<? super E>>> arg1)
createBrainCodec(Collection<? extends MemoryModuleType<?>> memoryModules, Collection<? extends SensorType<? extends Sensor<? super E>>> sensors)
m_21946_(Collection<? extends C_753_<?>> p_21947_, Collection<? extends C_777_<? extends C_776_<? super E>>> p_21948_)
public <T> com.mojang.serialization.DataResult<T>
a(com.mojang.serialization.DynamicOps<T> arg0)
serializeStart(com.mojang.serialization.DynamicOps<T> arg0)
method_28310(com.mojang.serialization.DynamicOps<T> arg0)
encode(com.mojang.serialization.DynamicOps<T> ops)
m_21914_(com.mojang.serialization.DynamicOps<T> arg0)
Stream<Brain$MemoryValue<?>>
j()
memories()
method_28315()
streamMemories()
m_21975_()
public boolean
a(bpb<?> arg0)
hasMemoryValue(MemoryModuleType<?> arg0)
method_18896(class_4140<?> arg0)
hasMemoryModule(MemoryModuleType<?> type)
m_21874_(C_753_<?> arg0)
public void
a()
clearMemories()
method_49709()
forgetAll()
m_276084_()
public <U> void
b(bpb<U> arg0)
eraseMemory(MemoryModuleType<U> arg0)
method_18875(class_4140<U> arg0)
forget(MemoryModuleType<U> type)
m_21936_(C_753_<U> arg0)
public <U> void
a(bpb<U> arg0, U arg1)
setMemory(MemoryModuleType<U> arg0, U arg1)
method_18878(class_4140<U> arg0, U arg1)
remember(MemoryModuleType<U> type, U value)
m_21879_(C_753_<U> p_21881_, U arg1)
public <U> void
a(bpb<U> arg0, U arg1, long arg2)
setMemoryWithExpiry(MemoryModuleType<U> arg0, U arg1, long arg2)
method_24525(class_4140<U> arg0, U arg1, long arg2)
remember(MemoryModuleType<U> type, U value, long expiry)
m_21882_(C_753_<U> p_21884_, U p_21885_, long arg2)
public <U> void
a(bpb<U> arg0, Optional<? extends U> arg1)
setMemory(MemoryModuleType<U> arg0, Optional<? extends U> arg1)
method_18879(class_4140<U> arg0, Optional<? extends U> arg1)
remember(MemoryModuleType<U> type, Optional<? extends U> value)
m_21886_(C_753_<U> p_21888_, Optional<? extends U> arg1)
<U> void
b(bpb<U> arg0, Optional<? extends bpa<?>> arg1)
setMemoryInternal(MemoryModuleType<U> arg0, Optional<? extends ExpirableValue<?>> arg1)
method_24535(class_4140<U> arg0, Optional<? extends class_4831<?>> arg1)
setMemory(MemoryModuleType<U> type, Optional<? extends Memory<?>> memory)
m_21941_(C_753_<U> p_21943_, Optional<? extends C_752_<?>> arg1)
public <U> Optional<U>
c(bpb<U> arg0)
getMemory(MemoryModuleType<U> arg0)
method_18904(class_4140<U> arg0)
getOptionalRegisteredMemory(MemoryModuleType<U> type)
m_21952_(C_753_<U> arg0)
public <U> Optional<U>
d(bpb<U> arg0)
getMemoryInternal(MemoryModuleType<U> arg0)
method_46873(class_4140<U> arg0)
getOptionalMemory(MemoryModuleType<U> type)
m_257414_(C_753_<U> arg0)
public <U> long
e(bpb<U> arg0)
getTimeUntilExpiry(MemoryModuleType<U> arg0)
method_36978(class_4140<U> arg0)
getMemoryExpiry(MemoryModuleType<U> type)
m_147341_(C_753_<U> arg0)
public Map<MemoryModuleType<?>, Optional<? extends ExpirableValue<?>>>
b()
getMemories()
method_35058()
getMemories()
m_147339_()
public <U> boolean
b(bpb<U> arg0, U arg1)
isMemoryValue(MemoryModuleType<U> arg0, U arg1)
method_29519(class_4140<U> arg0, U arg1)
hasMemoryModuleWithValue(MemoryModuleType<U> type, U value)
m_21938_(C_753_<U> p_21940_, U arg1)
public boolean
a(bpb<?> arg0, bpc arg1)
checkMemory(MemoryModuleType<?> arg0, MemoryStatus arg1)
method_18876(class_4140<?> arg0, class_4141 arg1)
isMemoryInState(MemoryModuleType<?> type, MemoryModuleState state)
m_21876_(C_753_<?> p_21878_, C_754_ arg1)
public Schedule
c()
getSchedule()
method_18894()
getSchedule()
m_21932_()
public void
a(cab arg0)
setSchedule(Schedule arg0)
method_18884(class_4170 arg0)
setSchedule(Schedule schedule)
m_21912_(C_1197_ arg0)
public void
a(Set<bzz> arg0)
setCoreActivities(Set<Activity> arg0)
method_18890(Set<class_4168> arg0)
setCoreActivities(Set<Activity> coreActivities)
m_21930_(Set<C_1195_> arg0)
public Set<Activity>
d()
getActiveActivities()
method_35059()
getPossibleActivities()
m_147340_()
public List<BehaviorControl<? super E>>
e()
getRunningBehaviors()
method_27074()
getRunningTasks()
m_21956_()
public void
f()
useDefaultActivity()
method_24536()
resetPossibleActivities()
m_21962_()
public Optional<Activity>
g()
getActiveNonCoreActivity()
method_24538()
getFirstPossibleNonCoreActivity()
m_21968_()
public void
a(bzz arg0)
setActiveActivityIfPossible(Activity arg0)
method_24526(class_4168 arg0)
doExclusively(Activity activity)
m_21889_(C_1195_ arg0)
private void
d(bzz arg0)
setActiveActivity(Activity arg0)
method_18880(class_4168 arg0)
resetPossibleActivities(Activity except)
m_21960_(C_1195_ arg0)
private void
e(bzz arg0)
eraseMemoriesForOtherActivitesThan(Activity arg0)
method_24537(class_4168 arg0)
forgetIrrelevantMemories(Activity except)
m_21966_(C_1195_ arg0)
public void
a(long arg0, long arg1)
updateActivityFromSchedule(long arg0, long arg1)
method_18871(long arg0, long arg1)
refreshActivities(long timeOfDay, long time)
m_21862_(long p_21864_, long arg1)
public void
a(List<bzz> arg0)
setActiveActivityToFirstValid(List<Activity> arg0)
method_24531(List<class_4168> arg0)
resetPossibleActivities(List<Activity> activities)
m_21926_(List<C_1195_> arg0)
public void
b(bzz arg0)
setDefaultActivity(Activity arg0)
method_18897(class_4168 arg0)
setDefaultActivity(Activity activity)
m_21944_(C_1195_ arg0)
public void
a(bzz arg0, int arg1, com.google.common.collect.ImmutableList<? extends bhs<? super E>> arg2)
addActivity(Activity arg0, int arg1, com.google.common.collect.ImmutableList<? extends BehaviorControl<? super E>> arg2)
method_18882(class_4168 arg0, int arg1, com.google.common.collect.ImmutableList<? extends class_7893<? super E>> arg2)
setTaskList(Activity activity, int begin, com.google.common.collect.ImmutableList<? extends Task<? super E>> list)
m_21891_(C_1195_ p_21893_, int p_21894_, com.google.common.collect.ImmutableList<? extends C_256692_<? super E>> arg2)
public void
a(bzz arg0, int arg1, com.google.common.collect.ImmutableList<? extends bhs<? super E>> arg2, bpb<?> arg3)
addActivityAndRemoveMemoryWhenStopped(Activity arg0, int arg1, com.google.common.collect.ImmutableList<? extends BehaviorControl<? super E>> arg2, MemoryModuleType<?> arg3)
method_24527(class_4168 arg0, int arg1, com.google.common.collect.ImmutableList<? extends class_7893<? super E>> arg2, class_4140<?> arg3)
setTaskList(Activity activity, int begin, com.google.common.collect.ImmutableList<? extends Task<? super E>> tasks, MemoryModuleType<?> memoryType)
m_21895_(C_1195_ p_21897_, int p_21898_, com.google.common.collect.ImmutableList<? extends C_256692_<? super E>> p_21899_, C_753_<?> arg3)
public void
a(bzz arg0, com.google.common.collect.ImmutableList<? extends com.mojang.datafixers.util.Pair<Integer, ? extends bhs<? super E>>> arg1)
addActivity(Activity arg0, com.google.common.collect.ImmutableList<? extends com.mojang.datafixers.util.Pair<Integer, ? extends BehaviorControl<? super E>>> arg1)
method_18881(class_4168 arg0, com.google.common.collect.ImmutableList<? extends com.mojang.datafixers.util.Pair<Integer, ? extends class_7893<? super E>>> arg1)
setTaskList(Activity activity, com.google.common.collect.ImmutableList<? extends com.mojang.datafixers.util.Pair<Integer, ? extends Task<? super E>>> indexedTasks)
m_21900_(C_1195_ p_21902_, com.google.common.collect.ImmutableList<? extends com.mojang.datafixers.util.Pair<Integer, ? extends C_256692_<? super E>>> arg1)
public void
a(bzz arg0, com.google.common.collect.ImmutableList<? extends com.mojang.datafixers.util.Pair<Integer, ? extends bhs<? super E>>> arg1, Set<com.mojang.datafixers.util.Pair<bpb<?>, bpc>> arg2)
addActivityWithConditions(Activity arg0, com.google.common.collect.ImmutableList<? extends com.mojang.datafixers.util.Pair<Integer, ? extends BehaviorControl<? super E>>> arg1, Set<com.mojang.datafixers.util.Pair<MemoryModuleType<?>, MemoryStatus>> arg2)
method_24529(class_4168 arg0, com.google.common.collect.ImmutableList<? extends com.mojang.datafixers.util.Pair<Integer, ? extends class_7893<? super E>>> arg1, Set<com.mojang.datafixers.util.Pair<class_4140<?>, class_4141>> arg2)
setTaskList(Activity activity, com.google.common.collect.ImmutableList<? extends com.mojang.datafixers.util.Pair<Integer, ? extends Task<? super E>>> indexedTasks, Set<com.mojang.datafixers.util.Pair<MemoryModuleType<?>, MemoryModuleState>> requiredMemories)
m_21903_(C_1195_ p_21905_, com.google.common.collect.ImmutableList<? extends com.mojang.datafixers.util.Pair<Integer, ? extends C_256692_<? super E>>> p_21906_, Set<com.mojang.datafixers.util.Pair<C_753_<?>, C_754_>> arg2)
public void
a(bzz arg0, com.google.common.collect.ImmutableList<? extends com.mojang.datafixers.util.Pair<Integer, ? extends bhs<? super E>>> arg1, Set<com.mojang.datafixers.util.Pair<bpb<?>, bpc>> arg2, Set<bpb<?>> arg3)
addActivityAndRemoveMemoriesWhenStopped(Activity arg0, com.google.common.collect.ImmutableList<? extends com.mojang.datafixers.util.Pair<Integer, ? extends BehaviorControl<? super E>>> arg1, Set<com.mojang.datafixers.util.Pair<MemoryModuleType<?>, MemoryStatus>> arg2, Set<MemoryModuleType<?>> arg3)
method_24530(class_4168 arg0, com.google.common.collect.ImmutableList<? extends com.mojang.datafixers.util.Pair<Integer, ? extends class_7893<? super E>>> arg1, Set<com.mojang.datafixers.util.Pair<class_4140<?>, class_4141>> arg2, Set<class_4140<?>> arg3)
setTaskList(Activity activity, com.google.common.collect.ImmutableList<? extends com.mojang.datafixers.util.Pair<Integer, ? extends Task<? super E>>> indexedTasks, Set<com.mojang.datafixers.util.Pair<MemoryModuleType<?>, MemoryModuleState>> requiredMemories, Set<MemoryModuleType<?>> forgettingMemories)
m_21907_(C_1195_ p_21909_, com.google.common.collect.ImmutableList<? extends com.mojang.datafixers.util.Pair<Integer, ? extends C_256692_<? super E>>> p_21910_, Set<com.mojang.datafixers.util.Pair<C_753_<?>, C_754_>> p_21911_, Set<C_753_<?>> arg3)
public void
h()
removeAllBehaviors()
method_35060()
clear()
m_147343_()
public boolean
c(bzz arg0)
isActive(Activity arg0)
method_18906(class_4168 arg0)
hasActivity(Activity activity)
m_21954_(C_1195_ arg0)
public Brain<E>
i()
copyWithoutBehaviors()
method_18911()
copy()
m_21973_()
public void
a(aif arg0, E arg1)
tick(ServerLevel arg0, E arg1)
method_19542(class_3218 arg0, E arg1)
tick(ServerWorld world, E entity)
m_21865_(C_12_ p_21867_, E arg1)
private void
c(aif arg0, E arg1)
tickSensors(ServerLevel arg0, E arg1)
method_27073(class_3218 arg0, E arg1)
tickSensors(ServerWorld world, E entity)
m_21949_(C_12_ p_21951_, E arg1)
private void
k()
forgetOutdatedMemories()
method_27075()
tickMemories()
m_21976_()
public void
b(aif arg0, E arg1)
stopAll(ServerLevel arg0, E arg1)
method_18900(class_3218 arg0, E arg1)
stopAllTasks(ServerWorld world, E entity)
m_21933_(C_12_ p_21935_, E arg1)
private void
d(aif arg0, E arg1)
startEachNonRunningBehavior(ServerLevel arg0, E arg1)
method_18891(class_3218 arg0, E arg1)
startTasks(ServerWorld world, E entity)
m_21957_(C_12_ p_21959_, E arg1)
private void
e(aif arg0, E arg1)
tickEachRunningBehavior(ServerLevel arg0, E arg1)
method_19545(class_3218 arg0, E arg1)
updateTasks(ServerWorld world, E entity)
m_21963_(C_12_ p_21965_, E arg1)
private boolean
f(bzz arg0)
activityRequirementsAreMet(Activity arg0)
method_18874(class_4168 arg0)
canDoActivity(Activity activity)
m_21969_(C_1195_ arg0)
private boolean
a(Object arg0)
isEmptyCollection(Object arg0)
method_19948(Object arg0)
isEmptyCollection(Object value)
m_21918_(Object arg0)
com.google.common.collect.ImmutableList<? extends com.mojang.datafixers.util.Pair<Integer, ? extends BehaviorControl<? super E>>>
a(int arg0, com.google.common.collect.ImmutableList<? extends bhs<? super E>> arg1)
createPriorityPairs(int arg0, com.google.common.collect.ImmutableList<? extends BehaviorControl<? super E>> arg1)
method_24524(int arg0, com.google.common.collect.ImmutableList<? extends class_7893<? super E>> arg1)
indexTaskList(int begin, com.google.common.collect.ImmutableList<? extends Task<? super E>> tasks)
m_21859_(int p_21861_, com.google.common.collect.ImmutableList<? extends C_256692_<? super E>> arg1)