Integrations - Sylsatra/attract_to_sound GitHub Wiki

🔗 Integrations

The Attract to Sound mod supports seamless integration with several popular mods (and datapacks) that introduce guns, muskets, animations, and voice chat. Below you’ll find instructions and example configurations for each integration—complete with the correct CurseForge URLs and modid: prefixes. Wherever you see example sound IDs (e.g. musketmod:musket_fire), replace them with the actual IDs used by your version of the mod.


🗣️ Simple Voice Chat Integration

  • Mod & Download: Simple Voice Chat (modid: simplevoicechat)

  • What it does:

    • Allows mobs to detect and respond to your actual in-game voice.
    • Whispering (low volume) produces a short-range sound event, while normal talking produces a longer range.
  • How to enable:

    1. Download and install Simple Voice Chat (simplevoicechat-<version>.jar) into your mods/ folder.

    2. In config/soundattract-common.toml, add or update:

      # ── Simple Voice Chat Integration ──
      enableVoiceChatIntegration = true
      voiceChatWhisperRange   = 8     # mobs hear whispers up to  8 blocks
      voiceChatNormalRange    = 24    # mobs hear normal chat up to 24 blocks
      voiceChatWeight         = 12.0  # “intensity” of voice events

      Note: No explicit sound IDs are required—Attract to Sound automatically listens for simplevoicechat:voice events under the hood.

  • Gameplay Tips:

    • Stealth: Whisper to coordinate with teammates without alerting nearby mobs.
    • Tactics: Use your voice to lure a zombie away from your base, or bait creepers into a funnel trap.

🔫 TacZ Guns Integration

  • Mod & Download: TacZ Guns (modid: tacz) [Suffuse – Gunsmoke](https://www.curseforge.com/minecraft/customization/suffuse-gunsmoke) datapack (needed for TacZ JSONs)

  • What it does:

    • Integrates TacZ’s detailed gun sounds so that each shot and reload becomes a “decibel” sound event that attracts mobs.
    • Each weapon, ammo type, and attachment can be tuned for loudness and muffling.
  • Prerequisites:

    1. TacZ Guns Mod (place tacz-<version>.jar in your mods/ folder).

    2. Suffuse – Gunsmoke Datapack (place the downloaded suffuse_gunsmoke.zip or folder into your world’s datapacks/ directory).

      • Suffuse is required so that TacZ’s weapon/attachment JSON definitions (including their "decibels" fields) load correctly.
  • How to enable: In soundattract-common.toml, add or update:

    # ── TacZ Guns Integration ──
    enableTaczIntegration = true
    
    # Detection ranges (in blocks) and base “weight” (sound intensity) for shooting & reloading
    taczShootRange   = 48.0  # mobs hear unsuppressed gunshots up to 48 blocks
    taczShootWeight  = 24.0  # base “intensity” for a normal gunshot
    
    taczReloadRange  = 16.0  # mobs hear reloads up to 16 blocks
    taczReloadWeight = 8.0   # “intensity” for a reload event
    
    # Per-weapon decibel values (must match <modid:weapon_id> from TacZ JSON)
    # Format: "tacz:<weapon_id>;<decibel_value>"
    # TacZ’s JSONs (via Suffuse) define each gun’s “decibels” naturally; you can override or add new entries here.
    taczGunShootDecibels = [
      "tacz:ak47;158.9",         # AK-47 fire sound = 158.9 dB
      "tacz:deserteagle;154.3",  # Desert Eagle fire sound = 154.3 dB
      "tacz:mp5;145.0"           # MP5 fire sound = 145.0 dB
    ]
    
    # Attachment-based decibel reductions
    # Format: "tacz:<attachment_id>;<decibel_reduction>"
    # E.g., a suppressor reduces base decibels by 35.
    taczAttachmentReductions = [
      "tacz:suppressor;35",      # suppressor → -35 dB
      "tacz:flash_hider;15"      # flash hider → -15 dB
    ]
    
    # Default decibel reduction if an attachment isn’t explicitly listed above
    taczAttachmentReductionDefault = 10.0
  • How It Works Internally:

    1. Suffuse reads the TacZ JSON files at world-load time, parsing each gun’s "decibels" property.
    2. When you fire a gun in-game (e.g., tacz:ak47), Attract to Sound uses that decibel value (158.9) to compute a “sound weight.”
    3. If you have a suppressor (tacz:suppressor) attached, it subtracts 35 dB, then recalculates the final weight.
    4. A mob’s AI sees this as a sound event with the configured taczShootRange and resulting weight (higher weights attract from farther away).
  • Gameplay Tips:

    • Suppressors Are King: A suppressor (–35 dB) can cut your effective aggro radius dramatically—ideal for stealth sniping.
    • Ammo Matters: TacZ often includes multiple ammo types (supersonic vs. subsonic rounds). Subsonic rounds normally have a lower "decibels" field—test and choose the quietest ammo for CQB.
    • Reload Timing: Reloading is still audible (default weight 8.0). If you’re near a wall or inside a muffling corridor, the reload may be entirely masked.

🧱 Scorched Guns Integration

  • Mod & Download: Scorched Guns (modid: scorchedguns)

  • What it does:

    • Adds a variety of futuristic and rustic firearms. Each shot, reload, and even magazine ejection can become a separate sound event that attracts mobs.
    • Unlike TacZ, Scorched Guns does not require a datapack; you simply point Attract to Sound at its sound events.
  • How to enable:

    1. Download and install Scorched Guns (scorchedguns-<version>.jar) into your mods/ folder.

    2. In soundattract-common.toml, add entries to capture Scorched Guns’ firing and reloading sounds:

      # ── Scorched Guns Integration ──
      
      # Raw sound defaults (include any Scorched Guns sound IDs you want mobs to hear)
      soundIdWhitelist = [
        "minecraft:block.lever.click",
        "scorchedguns:weapon.pistol.fire",         # example pistol fire
        "scorchedguns:weapon.rifle.fire",          # example rifle fire
        "scorchedguns:weapon.pistol.reload"        # example pistol reload
      ]
      
      rawSoundDefaults = [
        "scorchedguns:weapon.pistol.fire:40.0:10.0",    # pistol fire → 40-block range, weight 10.0
        "scorchedguns:weapon.rifle.fire:60.0:20.0",     # rifle fire  → 60-block range, weight 20.0
        "scorchedguns:weapon.pistol.reload:15.0:5.0"    # reload       → 15-block range, weight 5.0
      ]

      Tip: Use soundIdWhitelist to ensure Attract to Sound recognizes each scorchedguns:… event. Then define its range/weight in rawSoundDefaults.

  • Gameplay Tips:

    • Mix & Match: Scorched Guns has dozens of weapons—pick the quietest “semi-auto” pistol for stealth runs (e.g., weight 10.0, range 40).
    • Suppressors: Some Scorched Guns weapons support suppressor attachments (look for the scorchedguns:attachment.suppressor sound or JSON). Add them to your rawSoundDefaults with lower weights to simulate muffling.

🔥 Ewewukek’s Musket Mod Integration

  • Mod & Download: Ewewukek’s Musket Mod (modid: musketmod)

  • What it does:

    • Adds black-powder muskets, flintlocks, and cannons. These have distinctive “blast” and “reload” sounds that can attract mobs realistically.
  • How to enable:

    1. Download and install Ewewukek’s Musket Mod (musketmod-<version>.jar) into your mods/ folder.

    2. In soundattract-common.toml, add Musket Mod sound IDs:

      # ── Ewewukek’s Musket Mod Integration ──
      
      soundIdWhitelist = [
        "musketmod:musket_fire",       # firing a musket
        "musketmod:musket_reload",     # reloading a musket
        "musketmod:flintlock_fire",    # flintlock pistol shot
        "musketmod:flintlock_reload"   # flintlock reload
      ]
      
      rawSoundDefaults = [
        "musketmod:musket_fire:50.0:18.0",      # musket shot → 50-block range, weight 18.0
        "musketmod:musket_reload:20.0:5.0",     # reload         → 20-block range, weight 5.0
        "musketmod:flintlock_fire:40.0:15.0",   # flintlock shot → 40-block range, weight 15.0
        "musketmod:flintlock_reload:15.0:4.0"   # reload         → 15-block range, weight 4.0
      ]

      Note: These IDs (musketmod:musket_fire, etc.) are examples. If the mod’s JSON uses different names (check /assets/musketmod/sounds.json), adjust accordingly.

  • Gameplay Tips:

    • Black Powder Danger: Muskets produce a loud, booming blast (weight ~18.0). Use thick wool walls or underground firing ports to muffle the shot.
    • Cannon Barrages: If you fire a cannon indoors, expect every nearby creeper, skeleton, and zombie to come running—plan accordingly.

  • Mod & Download: MrCrayfish’s Gun Mod (Unofficial) (modid: gunmod or sometimes mrcrayfishgunmod)

  • What it does:

    • Adds modern firearms (handguns, rifles, shotguns) with their own firing, reloading, and trumpet-click sounds.
    • Can be integrated via Attract to Sound’s raw sound system.
  • How to enable:

    1. Download and install MrCrayfish’s Gun Mod (gunmod-<version>.jar) into your mods/ folder.

    2. In soundattract-common.toml, add these (example) IDs:

      # ── MrCrayfish’s Gun Mod Integration ──
      
      soundIdWhitelist = [
        "gunmod:handgun_fire",      # sample handgun fire
        "gunmod:handgun_reload",    # sample handgun reload
        "gunmod:rifle_fire",        # sample rifle fire
        "gunmod:rifle_reload"       # sample rifle reload
      ]
      
      rawSoundDefaults = [
        "gunmod:handgun_fire:35.0:12.0",    # handgun shot → 35-block range, weight 12.0
        "gunmod:handgun_reload:12.0:4.0",   # reload        → 12-block range, weight 4.0
        "gunmod:rifle_fire:60.0:22.0",      # rifle         → 60-block range, weight 22.0
        "gunmod:rifle_reload:18.0:6.0"      # reload        → 18-block range, weight 6.0
      ]

      IMPORTANT: The actual sound event names can differ—inspect data/gunmod/sounds.json inside the JAR (use a ZIP tool) to get the correct gunmod:<sound_name> entries.

  • Gameplay Tips:

    • Suppressor Mods: If you install a suppressor attachment add-on, note its sound ID and add it to rawSoundDefaults with a lower weight to simulate muffling.
    • Burst vs. Semi-Auto: Some firearms have “burst” or “auto” modes—each shot in burst mode may trigger multiple sound events. If you want to quiet them, create custom muffler sequences in your config.

🏃 Parcool Animator Integration

  • Mod & Download: Parcool (modid: parcool)

  • What it does:

    • When you perform a custom Parcool animation (e.g., dashing, rolling, wall-running), Attract to Sound can register those animations as distinct sound events—letting mobs “hear” your agile movements.
  • How to enable:

    1. Download and install Parcool (parcool-<version>.jar) into your mods/ folder.

    2. In soundattract-common.toml, add entries to parcoolAnimatorSounds. Example:

      # ── Parcool Animator Sounds ──
      # Format: "CompleteJavaClassPath;soundId;range;weight;volume;pitch"
      parcoolAnimatorSounds = [
        "com.mymod.animator.DiveAnim;com.mymod:sound.player_dive;20.0;8.0;1.0;1.0",
        "com.mymod.animator.RollAnim;com.mymod:sound.player_roll;12.0;4.0;0.8;1.2"
      ]
      • Example fields explained:

        1. Java Class Path: com.mymod.animator.DiveAnim (the Parcool animation class).
        2. soundId: Must be a valid modid:sound_event (e.g., com.mymod:sound.player_dive).
        3. range: How many blocks away mobs can hear that “dive.”
        4. weight: How urgent/loud that “dive” is (higher = more likely to trigger multiple mobs).
        5. volume/pitch: Standard Minecraft sound parameters (leave at 1.0;1.0 for default).
  • Gameplay Tips:

    • Use a loud ground-slam animation (e.g., parcool:slam) to draw zombies off your flank while you rush the front lines.
    • Perform a quiet roll (small range, low weight) to dodge a skeleton arrow without alerting a nearby creeper.

⚙️ Custom & Other Mod Integrations

In addition to the firearms and voice/animation mods above, Attract to Sound can integrate with any mod that registers sounds, entities, or animations—provided you know their modid: prefixes and sound event names.

A. Adding Custom Sound IDs (Any Mod)

  1. Locate the Mod’s Sound JSON:

    • Open the mod’s JAR with a ZIP tool and browse to assets/<modid>/sounds.json.
    • Note the exact "sound_event" names (e.g., "supermod:alarm_bell", "techmod:machine_start").
  2. Whitelist the Sound ID: In soundattract-common.toml, under [COMMON.soundProperties]:

    soundIdWhitelist = [
      "minecraft:block.lever.click",
      "supermod:alarm_bell",       # example from “SuperMod”
      "techmod:machine_start"
    ]
  3. Assign Range & Weight: Add the same ID to rawSoundDefaults (or a per-mob profile) to give it a custom range/weight:

    rawSoundDefaults = [
      "supermod:alarm_bell:40.0:12.0",    # 40-block range, weight 12.0
      "techmod:machine_start:30.0:8.0"    # 30-block range, weight 8.0
    ]

B. Adding Custom Entity (Mob) IDs

  • If you want a mod’s custom mob (e.g., "alienmod:space_zombie") to react to sounds, simply add its ID under [COMMON.mobAI]attractedEntities:

    attractedEntities = [
      "minecraft:zombie",
      "alexsmobs:grizzly_bear",
      "alienmod:space_zombie"
    ]

C. Per-Mob Profiles (Advanced Overrides)

  • Define a “Mob Profile” in specialMobProfilesRaw to customize how a mod’s entity behaves. Example for a custom mob:

    specialMobProfilesRaw = [
      # Space Zombie: hears player.hurt from farther away and has better sight
      "SpaceZombie;alienmod:space_zombie;;minecraft:entity.player.hurt:70.0:3.0;standing:80.0,sneaking:40.0,crawling:20.0"
    ]
    • This only applies to alienmod:space_zombie.
    • You can also include an NBT matcher (e.g., "{IsElite:1b}") between the second and third semicolons.

Troubleshooting & Quick Checks

  1. Incorrect Link Errors?

    • Double-check that the mod’s JAR is present in mods/ and matches the modid: prefix you used.
    • Use /debug sound (or /playsound <modid:sound> <player>) to verify the sound event exists.
  2. TacZ Guns & Suffuse Issues:

    • Ensure the Suffuse – Gunsmoke datapack is installed in your world’s datapacks/ folder and loads without JSON errors (/reload can show parsing problems).
    • If TacZ decibels aren’t registering, open the TacZ JAR, navigate to its data/tacz/recipes (or data/tacz/sounds) folder, and confirm its JSONs define "decibels" correctly.
  3. No Mobs Reacting to Scorched Guns/Musket Shots?

    • Confirm you added each modid:sound_event to both soundIdWhitelist and rawSoundDefaults.
    • Check the mod’s sounds.json (inside its JAR) for the exact event names—they are case‐sensitive.
  4. Performance Consideration:

    • If you enable multiple gun integrations simultaneously (TacZ, Scorched Guns, Musket Mod, Gun Mod), you may generate many overlapping sound events.
    • Increase [COMMON.general] → scanCooldownTicks (e.g., from 25 → 50) and/or reduce maxSoundsTracked to prevent TPS drops.

Reminder: For detailed configuration of every parameter (ranges, weights, muffling blocks, camouflage, etc.), see the Configuration Guide. If you still run into trouble, check the FAQ or open an issue on GitHub.

⚠️ **GitHub.com Fallback** ⚠️