Simple Voice Mechanics

Make the Game hear you using Simple Voice Chat and Simple Voice Mechanics!

715

Quick challenge

How far can you run before the mobs catch you?

Simple Voice Mechanics

Simple Voice Mechanics

Realistic mob reactions to voice in Minecraft. Uses Simple Voice Chat for dynamic audio detection with volume and distance-based behavior.

Features

- Sculk Sensors: Opus decoding with dB calculation - Sculk Sensors: Louder voices heard from further away (40%-220% of base range) - Sculk Sensors: Biome & time-based acoustics (caves echo, forests dampen, night = more sensitive) - Sculk Sensors: Hostile mobs call reinforcements (zombies summon hordes, wolves hunt in packs) - Sculk Sensors: Probabilistic reactions, cooldowns, eye contact system - Sculk Sensors: Hostile (attack), Neutral (look), Peaceful (look/flee/follow), Warden (anger system) - Sculk Sensors: GameEvent-based activation on loud voices

Mob Behavior

| Category | Reaction | Threshold | Special Features | |----------|----------|-----------|------------------| | Sculk | Attack | -40 dB | Target player, Sculk | | Sculk | Look (8s) | -35 dB | 60% reaction chance | | Sculk | Look (10s) | -30 dB | Flee at >-20 dB, Follow when sneaking + eye contact | | Sculk | Anger +15-60 | -20 dB | Volume & distance dependent | | Sculk | Activate | -20 dB | Only on loud voices |

Peaceful Mobs Details: - Normal speaking: Look at player - Loud speaking (>-20 dB): Flee 3 blocks away - Sneaking + Speaking + Eye contact: Follow for 60s

Environmental Effects

| Environment | Range Modifier | Sensitivity | Example | |-------------|---------------|-------------|---------| | Mountain + Night | ~2.0x | -13 dB | Mountain + Night - Mobs hear whispers from far away | | Mountain + Night | 0.75x | +3 dB | Safer - Vegetation dampens sound | | Mountain + Night | 1.3x | Normal | Sound carries in open spaces | | Mountain + Night | 1.56x | -8 dB | Sound echoes across peaks |

Mob Group Alerts: - Zombies: Call 5 allies within 16 blocks → Horde attack - Wolves: Alert pack within 20 blocks → Coordinated hunt - Piglins: Summon group within 18 blocks → Group combat

Requirements

- Minecraft 1.18+ (Paper or compatible) - Java 17+ - Simple Voice Chat Plugin

Note: Sculk Sensors require Minecraft 1.19+

Installation

1. Install Simple Voice Chat 2. Place SimpleVoiceMechanics JAR in `plugins/` folder 3. Restart server 4. Adjust `plugins/SimpleVoiceMechanics/config.yml` as needed

Configuration

Global Settings

```yaml detection: max-range: 16.0 min-range: 2.0 falloff-curve: 1.0 # 0.5-2.0 (0.5=linear, 2.0=steep) ```

Environmental Modifiers

```yaml environmental-modifiers: biome-modifiers: enabled: true # Caves echo, forests dampen time-modifiers: enabled: true # Night = 30% more range, 8 dB more sensitive ```

Mob Group Alerts

```yaml mob-hearing: hostile-mobs: group-alert: enabled: true max-alerts: 5 # Max mobs to summon per detection ranges: zombie: 16.0 # Horde radius wolf: 20.0 # Pack radius piglin: 18.0 # Group radius ```

Per-Category Settings

```yaml peaceful-mobs: enabled: true volume-threshold-db: -30.0 max-range: 8.0 natural-behavior: reaction-chance: 0.7 # 70% reaction probability look-duration: 10 # Look duration in seconds reaction-cooldown: 3 # Cooldown between reactions flee-behavior: enabled: true flee-volume-db: -20.0 flee-distance: 3.0 flee-duration: 3 follow-when-sneaking: enabled: true require-eye-contact: true eye-contact-range: 4.0 eye-contact-memory: 5 duration: 60 max-distance: 12.0 blacklist: [] # Exclude EntityTypes ```

Volume Scale (dB)

- -10 dB: Whispering - -10 dB: Normal speaking (Default Hostile) - -10 dB: Quiet to normal (Default Peaceful) - -10 dB: Loud speaking (Default Warden/Sculk) - -10 dB: Shouting

Commands

- `/voicelistener reload` - Reload config - `/voicelistener toggle <hostile|neutral|peaceful|warden|sculk>` - Toggle category - `/voicelistener status` - Show current config

Aliases: `/vl`, `/voicemechanics`

Permissions

- `voicelistener.admin` (default: op)

Preset Examples

Stealth Server

```yaml hostile-mobs: volume-threshold-db: -50.0 # Whispers detected max-range: 24.0 falloff-curve: 0.8 environmental-modifiers: biome-modifiers: enabled: true # Caves are extra dangerous time-modifiers: enabled: true # Nights are terrifying ```

Action Server

```yaml hostile-mobs: volume-threshold-db: -25.0 # Only loud speaking max-range: 12.0 falloff-curve: 1.5 group-alert: enabled: true max-alerts: 8 # Larger mob groups! ```

Warden Extreme Challenge

```yaml warden: volume-threshold-db: -60.0 # Hears everything! max-range: 32.0 falloff-curve: 0.5 ```

Hardcore Survival

```yaml environmental-modifiers: biome-modifiers: enabled: true time-modifiers: enabled: true mob-hearing: hostile-mobs: volume-threshold-db: -50.0 group-alert: enabled: true max-alerts: 10 # Massive hordes! ```

Gameplay Examples

Combined: ~2x range, -13 dB more sensitive - Biome: Cave (1.5x range, -5 dB) - Time: Night (1.3x range, -8 dB) - Combined: ~2x range, -13 dB more sensitive - Result: Whispering attracts zombies from far away. 1 zombie calls 5 more → 6 zombies attack!

Combined: 0.75x range - Biome: Forest (0.75x range, +3 dB) - Time: Day (normal) - Combined: 0.75x range - Result: Vegetation dampens sound. Normal speaking is safe.

Nether Fortress: - Biome: Nether (1.3x range) - Mobs: Piglins (18 block alert) - Result: 1 Piglin hears you → alerts 5 nearby Piglins → coordinated group attack

Debug Options

```yaml debug: audio-logging: false range-logging: false detection-logging: false warden-logging: false sculk-logging: false peaceful-logging: false environmental-logging: false group-alert-logging: false ```

Technical Details

NEW: If hostile detected, alert nearby allies 1. Audio packet received → Decode Opus → Calculate dB 2. NEW: If hostile detected, alert nearby allies 3. Check category threshold → Calculate effective range 4. Probability-based detection → Natural behavior check 5. Execute action (Attack/Look/Flee/Follow) 6. NEW: If hostile detected, alert nearby allies

Formulas: ``` Effective Range = Config Range × Biome Mult × Time Mult × (1.0 + (dB - Threshold) / 25.0) Capped: 0.5× to 2.5×

Detection Probability = (1 - normalized_distance)^falloff_curve 100% at ≤ min-range, 0% at ≥ max-range

Mob Alerts = Dynamic (1-5 based on distance, closer = more alerts) ```

API Usage

```java @EventHandler public void onVoiceDetected(VoiceDetectedEvent event) { Player player = event.getPlayer(); double decibels = event.getDecibels(); // Custom logic }

// Access config ConfigManager config = plugin.getConfigManager(); double threshold = config.getHostileVolumeThresholdDb(); boolean biomeMods = config.isBiomeModifiersEnabled();

// New utility classes Biome biome = location.getBlock().getBiome(); double rangeMultiplier = BiomeModifier.getRangeMultiplier(biome); boolean isNight = TimeModifier.isNight(world); boolean isSocial = MobGroupAlert.isSocialMob(EntityType.ZOMBIE); ```

Building

```bash git clone https://github.com/yourusername/SimpleVoiceMechanics.git cd SimpleVoiceMechanics mvn clean package ```

License

MIT License

Credits

- Audio calculation adapted from Simple Voice Chat (henkelmax) - Built for Paper - SimpleVoiceChat API - Environmental acoustics inspired by real-world sound propagation

ADS