API reference / @jsprismarine/entity-brains / VillagerHostilesSensor
Class: VillagerHostilesSensor
Defined in: sensing/sensors.ts:375
Java's VillagerHostilesSensor.
Extends
Constructors
Constructor
new VillagerHostilesSensor(
scanRate?):VillagerHostilesSensor
Defined in: sensing/sensor.ts:33
Parameters
scanRate?
number = DEFAULT_SCAN_RATE
Returns
VillagerHostilesSensor
Inherited from
NearestVisibleLivingEntitySensor.constructor
Properties
name
readonlyname:"VillagerHostilesSensor"='VillagerHostilesSensor'
Defined in: sensing/sensors.ts:376
The Java class name, which is what a debug read-out shows.
Overrides
NearestVisibleLivingEntitySensor.name
scanRate
readonlyscanRate:number=DEFAULT_SCAN_RATE
Defined in: sensing/sensor.ts:33
Inherited from
NearestVisibleLivingEntitySensor.scanRate
Accessors
requires
Get Signature
get requires(): readonly
MemoryModuleType<unknown>[]
Defined in: sensing/sensors.ts:287
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.
Inherited from
NearestVisibleLivingEntitySensor.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
NearestVisibleLivingEntitySensor.randomlyDelayStart
tick()
tick(
context):void
Defined in: sensing/sensor.ts:41
Counts down and scans when the countdown reaches zero.
Parameters
context
Returns
void