Simple Voice Chat
voicechat/detection_chance
SVC Detection Chance
Calculates the probability (0.0 – 1.0) that a voice is audible at a given distance, with configurable min/max range and a falloff curve.
Note: Formula: chance = (1 − normalised_distance) ^ falloffCurve, where normalised_distance = (distance − minRange) / (maxRange − minRange)
Falloff curve guide (chance at the midpoint between minRange and maxRange):
• 0.5 → sharp drop-off (~29 % at midpoint)
• 1.0 → linear drop-off (50 % at midpoint) ← default
• 1.5 → gradual drop-off (~65 % at midpoint)
• 2.0 → very gradual drop-off (~75 % at midpoint)
Tip: use **SVC Voice Range** to compute a volume-scaled maxRange and feed it here for dynamic detection.
Inputs
| Name | Type | Optional | Description |
|---|---|---|---|
distance |
number | Distance in blocks between the listener and the speaker. | |
minRange |
number | Distance within which detection is guaranteed (100 %). | |
maxRange |
number | Distance beyond which detection is impossible (0 %). |
Outputs
| Name | Type | Description |
|---|---|---|
detectionChance |
number | Probability from 0.0 (cannot hear) to 1.0 (guaranteed). |
canHear |
boolean | True if detectionChance is greater than 0. |
Properties
| Key | Type | Default | Description |
|---|---|---|---|
falloffCurve |
number | 1 |
Controls how quickly detection chance falls off between minRange and maxRange. |
Examples
Probabilistic mob detection
Give mobs a realistic chance of detecting a nearby speaking player based on distance.
- SVC Speaking Trigger → player → Get Player Location
- Get Player Location + Mob Location → Distance Between Locations → SVC Detection Chance (distance)
- Constant (5) → SVC Detection Chance (minRange)
- Constant (30) → SVC Detection Chance (maxRange)
- SVC Detection Chance → detectionChance → Random Number Check (0–1)
- Random Number Check → pass branch → Trigger mob alert
Combine with volume-scaled range
Louder voices are detectable from further away.
- SVC Speaking Trigger → decibels → SVC Voice Range (decibels)
- Constant (48) → SVC Voice Range (baseRange)
- SVC Voice Range → effectiveRange → SVC Detection Chance (maxRange)
- Constant (5) → SVC Detection Chance (minRange)
- Distance Between Locations → SVC Detection Chance (distance)
- SVC Detection Chance → detectionChance → <use as probability>