Class Behavior<E extends LivingEntity>
java.lang.Object
net.minecraft.world.entity.ai.behavior.Behavior<E>
- All Implemented Interfaces:
BehaviorControl<E>
- Direct Known Subclasses:
AnimalMakeLove
,AnimalPanic
,ArmadilloAi.ArmadilloBallUp
,CamelAi.RandomSitting
,CelebrateVillagersSurvivedRaid
,CountDownCooldownTicks
,Croak
,CrossbowAttack
,Digging
,Emerging
,FollowTemptation
,ForceUnmount
,GiveGiftToHero
,GoAndGiveItemsToTarget
,GoToPotentialJobSite
,HarvestFarmland
,JumpOnBed
,LongJump
,LongJumpMidJump
,LongJumpToRandomPos
,LookAndFollowTradingPlayerSink
,LookAtTargetSink
,MoveToTargetSink
,PlayDead
,PrepareRamNearestTarget
,RamTarget
,RandomLookAround
,Roar
,Shoot
,ShootTongue
,ShootWhenStuck
,ShowTradesToPlayer
,SleepInBed
,Slide
,SnifferAi.Digging
,SnifferAi.FeelingHappy
,SnifferAi.FinishedDigging
,SnifferAi.Scenting
,SnifferAi.Searching
,SnifferAi.Sniffing
,Sniffing
,SonicBoom
,Swim
,TradeWithVillager
,UseBonemeal
,VillagerMakeLove
,VillagerPanicTrigger
,WorkAtPoi
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
private long
protected final Map
<MemoryModuleType<?>, MemoryStatus> private final int
private final int
private Behavior.Status
-
Constructor Summary
ConstructorsConstructorDescriptionBehavior
(Map<MemoryModuleType<?>, MemoryStatus> entryCondition) Behavior
(Map<MemoryModuleType<?>, MemoryStatus> entryCondition, int duration) Behavior
(Map<MemoryModuleType<?>, MemoryStatus> entryCondition, int minDuration, int maxDuration) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
canStillUse
(ServerLevel level, E entity, long gameTime) protected boolean
checkExtraStartConditions
(ServerLevel level, E owner) final void
doStop
(ServerLevel level, E entity, long gameTime) protected boolean
hasRequiredMemories
(E owner) protected void
start
(ServerLevel level, E entity, long gameTime) protected void
stop
(ServerLevel level, E entity, long gameTime) protected void
tick
(ServerLevel level, E owner, long gameTime) final void
tickOrStop
(ServerLevel level, E entity, long gameTime) protected boolean
timedOut
(long gameTime) final boolean
tryStart
(ServerLevel level, E owner, long gameTime)
-
Field Details
-
DEFAULT_DURATION
public static final int DEFAULT_DURATION- See Also:
-
entryCondition
-
status
-
endTimestamp
private long endTimestamp -
minDuration
private final int minDuration -
maxDuration
private final int maxDuration
-
-
Constructor Details
-
Behavior
-
Behavior
-
Behavior
public Behavior(Map<MemoryModuleType<?>, MemoryStatus> entryCondition, int minDuration, int maxDuration)
-
-
Method Details
-
getStatus
- Specified by:
getStatus
in interfaceBehaviorControl<E extends LivingEntity>
-
tryStart
- Specified by:
tryStart
in interfaceBehaviorControl<E extends LivingEntity>
-
start
-
tickOrStop
- Specified by:
tickOrStop
in interfaceBehaviorControl<E extends LivingEntity>
-
tick
-
doStop
- Specified by:
doStop
in interfaceBehaviorControl<E extends LivingEntity>
-
stop
-
canStillUse
-
timedOut
protected boolean timedOut(long gameTime) -
checkExtraStartConditions
-
debugString
- Specified by:
debugString
in interfaceBehaviorControl<E extends LivingEntity>
-
hasRequiredMemories
-