DetectionConfig
Controls how a hostile citizen detects and responds to nearby players — view distance, hearing, alert states, and search behavior.
package com.electro.hycitizens.models;
Constructors
DetectionConfig() // Hostile defaults
DetectionConfig(boolean hostile) // true = hostile defaults, false = all zeros
copyFrom
void copyFrom(@Nonnull DetectionConfig other)
Sight & Hearing
getViewRange / setViewRange
float getViewRange() / void setViewRange(float viewRange)
How far the citizen can see (blocks). Default: 15.
getViewSector / setViewSector
float getViewSector() / void setViewSector(float viewSector)
Field of view in degrees. Default: 180.
getHearingRange / setHearingRange
float getHearingRange() / void setHearingRange(float hearingRange)
How far the citizen can hear player movement (blocks). Default: 8.
getAbsoluteDetectionRange / setAbsoluteDetectionRange
float getAbsoluteDetectionRange() / void setAbsoluteDetectionRange(float range)
Within this range, the citizen detects the player regardless of sight or hearing. Default: 2.
getAlertedRange / setAlertedRange
float getAlertedRange() / void setAlertedRange(float alertedRange)
Nearby citizens within this range are alerted when this citizen spots a target. Default: 45.
getInvestigateRange / setInvestigateRange
float getInvestigateRange() / void setInvestigateRange(float range)
Maximum distance the citizen will travel to investigate a sound or last-known position. Default: 40.0.
Alert & Search Timers
getAlertedTimeMin / Max
float getAlertedTimeMin() / void setAlertedTimeMin(float v)
float getAlertedTimeMax() / void setAlertedTimeMax(float v)
Seconds the citizen stays in an alerted state. Default: 1.0 – 2.0.
getConfusedTimeMin / Max
float getConfusedTimeMin() / void setConfusedTimeMin(float v)
float getConfusedTimeMax() / void setConfusedTimeMax(float v)
Seconds the citizen appears confused after losing a target. Default: 1.0 – 2.0.
getSearchTimeMin / Max
float getSearchTimeMin() / void setSearchTimeMin(float v)
float getSearchTimeMax() / void setSearchTimeMax(float v)
Seconds the citizen actively searches for a lost target. Default: 10.0 – 14.0.
getChanceToBeAlertedWhenReceivingCallForHelp / set...
int getChanceToBeAlertedWhenReceivingCallForHelp()
void setChanceToBeAlertedWhenReceivingCallForHelp(int v)
Probability (0–100) of responding to a nearby citizen's call for help. Default: 70.