API reference / @jsprismarine/entity-brains / PiglinSpecificSensor
Class: PiglinSpecificSensor
Defined in: sensing/sensors.ts:581
Java's PiglinSpecificSensor: one pass over the visible set that writes ten memories.
The nemesis branch reads oddly in the decompiled form and it is worth stating plainly: a wither skeleton or a wither becomes NEAREST_VISIBLE_NEMESIS only while no nemesis has been found yet, so the first one wins and later ones fall through to the zombified check.
Extends
Constructors
Constructor
new PiglinSpecificSensor(
isWearingSafeArmor,isPlayerHoldingLovedItem):PiglinSpecificSensor
Defined in: sensing/sensors.ts:599
Parameters
isWearingSafeArmor
(player) => boolean
isPlayerHoldingLovedItem
(player) => boolean
Returns
PiglinSpecificSensor
Overrides
Properties
name
readonlyname:"PiglinSpecificSensor"='PiglinSpecificSensor'
Defined in: sensing/sensors.ts:582
The Java class name, which is what a debug read-out shows.
Overrides
requires
readonlyrequires: readonlyMemoryModuleType<unknown>[]
Defined in: sensing/sensors.ts:583
Every memory the sensor writes. The brain registers each one when the sensor is added.
Overrides
scanRate
readonlyscanRate:number=DEFAULT_SCAN_RATE
Defined in: sensing/sensor.ts:33
Inherited from
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
tick()
tick(
context):void
Defined in: sensing/sensor.ts:41
Counts down and scans when the countdown reaches zero.
Parameters
context
Returns
void