API reference / @jsprismarine/entity-brains / WardenEntitySensor
Class: WardenEntitySensor
Defined in: sensing/sensors.ts:520
Java's WardenEntitySensor: NearestLivingEntitySensor plus one extra memory.
NEAREST_ATTACKABLE goes to the closest targetable player, and only to the closest non-player when there is no player at all. That ordering is why a warden prefers a player standing further away over a mob at its feet.
Extends
Constructors
Constructor
new WardenEntitySensor(
canTargetEntity):WardenEntitySensor
Defined in: sensing/sensors.ts:523
Parameters
canTargetEntity
(context, entity) => boolean
Returns
WardenEntitySensor
Overrides
NearestLivingEntitySensor.constructor
Properties
name
readonlyname:"WardenEntitySensor"='WardenEntitySensor'
Defined in: sensing/sensors.ts:521
The Java class name, which is what a debug read-out shows.
Overrides
NearestLivingEntitySensor.name
scanRate
readonlyscanRate:number=DEFAULT_SCAN_RATE
Defined in: sensing/sensor.ts:33
Inherited from
NearestLivingEntitySensor.scanRate
Accessors
requires
Get Signature
get requires(): readonly
MemoryModuleType<unknown>[]
Defined in: sensing/sensors.ts:527
Every memory the sensor writes. The brain registers each one when the sensor is added.
Returns
readonly MemoryModuleType<unknown>[]
Every memory the sensor writes. The brain registers each one when the sensor is added.
Overrides
NearestLivingEntitySensor.requires
Methods
randomlyDelayStart()
randomlyDelayStart(
randomInt):void
Defined in: sensing/sensor.ts:36
Java's randomlyDelayStart: offsets the first scan into [0, scanRate).
Parameters
randomInt
(bound) => number
Returns
void
Inherited from
NearestLivingEntitySensor.randomlyDelayStart
tick()
tick(
context):void
Defined in: sensing/sensor.ts:41
Counts down and scans when the countdown reaches zero.
Parameters
context
Returns
void