FAQ - Sylsatra/attract_to_sound GitHub Wiki

❓ Frequently Asked Questions (FAQ)

Find answers to the most common questions about Attract to Sound. If you need further assistance, consult the Configuration Guide or open an issue on GitHub.


Q: Which mods does Attract to Sound integrate with?

A: Out of the box, Attract to Sound supports several popular mods (and datapacks). You can enable each integration in the configuration file (soundattract-common.toml). As of the latest version, the supported integrations are:

If you install any other mod that registers sounds or custom entities, simply whitelist its sound IDs under soundIdWhitelist or add its entity IDs to attractedEntities—Attract to Sound will pick them up automatically. See [Configuration](./Configuration) for full details.


Q: How do I enable or disable a specific integration?

A: All integrations are controlled by boolean toggles in your config:

  • Simple Voice Chat:

    enableVoiceChatIntegration = true   # Set to false to disable voice chat detection
  • TacZ Guns:

    enableTaczIntegration = true        # Set to false to disable all TacZ sound events
  • Scorched Guns / Musket Mod / MrCrayfish’s Gun Mod: These do not have a single boolean toggle. Instead, you add their sound IDs to soundIdWhitelist and rawSoundDefaults. To effectively “disable” them, simply remove or comment out those entries.

  • Parcool:

    parcoolAnimatorSounds = []          # An empty list disables Parcool‐based sound events

Any integration change requires a full Minecraft restart to take effect—reloading configs or resource packs is not sufficient.


Q: How do I add a custom mod’s sounds or mobs?

A:

  1. Custom Sounds

    • Open the mod’s JAR (e.g., modid-<version>.jar) and locate assets/<modid>/sounds.json. Note each "sound_event" name (e.g., "custommod:alert_bell").

    • In soundattract-common.toml under [COMMON.soundProperties], add:

      soundIdWhitelist = [
        "custommod:alert_bell",
        ... other IDs ...
      ]
      
      rawSoundDefaults = [
        "custommod:alert_bell:40.0:10.0",    # 40-block range, weight 10.0
        ... other sound entries ...
      ]
    • Save and restart Minecraft.

  2. Custom Mobs

    • Find the entity’s registry name (e.g., otherside:shadow_stalker).

    • In [COMMON.mobAI]attractedEntities, add that ID:

      attractedEntities = [
        "minecraft:zombie",
        "alexsmobs:grizzly_bear",
        "otherside:shadow_stalker"
      ]
    • If you need to override how that mob hears specific sounds or sees the player, define a Mob Profile under specialMobProfilesRaw. Example:

      specialMobProfilesRaw = [
        # Shadow Stalker: hears player.hurt from farther away
        "ShadowStalker;otherside:shadow_stalker;;minecraft:entity.player.hurt:80.0:3.0;standing:90.0,sneaking:45.0,crawling:25.0"
      ]

Q: How do I fine-tune camouflage and stealth?

A: The stealth system is highly configurable. Important settings live under [COMMON.stealth]:

  1. Armor‐Only Camouflage (Simple)

    • Define a four-piece set in camouflageArmorItems.

    • Example:

      camouflageArmorItems = [
        "minecraft:leather_helmet",
        "minecraft:leather_chestplate",
        "minecraft:leather_leggings",
        "minecraft:leather_boots"
      ]
      requireFullSetForCamouflageBonus = true
      fullArmorStealthBonus = 0.85      # 15% stealth multiplier
  2. Armor + Block Camouflage (Advanced)

    • List full camouflage sets in camouflageSets:

      camouflageSets = [
        "00FF00;minecraft:leather_helmet;
                minecraft:leather_chestplate;
                minecraft:leather_leggings;
                minecraft:leather_boots;
                minecraft:green_wool;
                minecraft:grass_block"
      ]
      allowPartialBonusIfFullSetRequired = false
      camouflageDistanceScaling = true
      camouflageDistanceMax = 32.0
      camouflageDistanceMinEffectiveness = 0.5
    • Adjust piece/block weights (camouflageArmorPieceWeight, camouflageBlockMatchWeight) to control how strongly each matching item or block contributes.

  3. Environmental Camouflage

    • Enable sampling of nearby block colors (e.g., walking through a snow biome wearing white wool).

      enableEnvironmentalCamouflage = true
      environmentalCamouflageMaxEffectiveness = 0.8
      environmentalCamouflageColorMatchThreshold = 10
      envColorSampleRadius = 5
      envColorSampleYOffsetStart = -1
      envColorSampleYOffsetEnd   = 1
      enableEnvironmentalMismatchPenalty = true
      environmentalMismatchPenaltyFactor = 1.2
      environmentalMismatchThreshold = 20
    • This makes dyed leather that matches biome colors grant extra stealth.

  4. Movement & Potion Effects

    • Movement Penalty: movementStealthPenalty (default 1.2) applies if your horizontal speed ≥ movementThreshold (default 0.003).
    • Stationary Bonus: stationaryStealthBonusFactor (default 0.8) applies if speed is below threshold.
    • Invisibility Potion: invisibilityStealthFactor (default 0.1) reduces detection by 90%.
  5. Light & Weather

    • Light Level:

      • neutralLightLevel (default 8) is the “no bonus/penalty” threshold.
      • lightLevelSensitivity (default 0.1) multiplies detection range per extra/missing light level.
      • minLightFactor/maxLightFactor (defaults 0.5/1.5) cap the multipliers.
    • Rain & Thunder:

      • rainStealthFactor (default 0.8) applies during rain.
      • thunderStealthFactor (default 0.6) applies during thunderstorms.

After modifying any of these values, save the file and restart Minecraft to see the changes.


Q: My sound or mob IDs aren’t working—what should I check?

A:

  1. Correct modid: Prefix

    • Always include the mod’s ID before the colon (e.g., musketmod:musket_fire, not musket_fire).
    • Inspect the mod’s sounds.json (inside the JAR’s assets/<modid>/sounds.json) to confirm the exact event name.
  2. Typo & Case Sensitivity

    • Minecraft resource names are case‐sensitive. A missing uppercase vs. lowercase will cause Attract to Sound to ignore the entry.
  3. Whitelist + Defaults

    • If you want mobs to respond to a custom sound, it must appear in soundIdWhitelist.

    • Then, to actually adjust its behavior, add it to rawSoundDefaults (or a Mob Profile).

    • Example:

      soundIdWhitelist = [
        "custommod:alarm_bell"
      ]
      rawSoundDefaults = [
        "custommod:alarm_bell:40.0:10.0"
      ]
  4. Integration‐Specific Notes

    • TacZ Guns & Suffuse: Ensure the Suffuse datapack is in your world’s datapacks/ folder—otherwise, TacZ JSONs (which define "decibels") won’t load, and Attract to Sound cannot parse weapon loudness.
    • Parcool Animator: Use the full Java class path for the animation (e.g., com.mymod.animator.DiveAnim) and a valid modid:sound_event for the sound.
  5. Restart Required

    • All config changes require a full restart of Minecraft. Merely using /reload will not re‐register new sound or mob ID lists.

Q: How do I manage performance (TPS) when too many sound events occur?

A:

  1. Adjust Scan Rates

    • In [COMMON.general]:

      scanCooldownTicks = 50       # Increase from default 25 to reduce scan frequency
      maxSoundsTracked   = 8       # Lower from 10 to track fewer simultaneous sounds
    • This slows how often each mob checks for new sounds and limits how many active sounds each mob can juggle.

  2. Reduce Group AI Overhead

    • In [COMMON.mobAI]:

      maxGroupSize       = 32      # Reduce group sizes from default 64 to lighten CPU load
      groupAssignInterval = 300    # Increase from 200 ticks so groups re‐evaluate less often
      edgeMobSmartBehavior = false # Turning off smart edge AI cuts down on extra raycasts
  3. Limit Muffling Complexity

    • In [COMMON.muffling]:

      enableBlockMuffling      = true
      mufflingAreaRadius       = 0  # Only check the exact ray path, not surrounding cubes
      maxMufflingBlocksToCheck = 20 # Lower from default 50 to stop scanning too many blocks
    • Smaller mufflingAreaRadius (0 or 1) cuts the number of block checks per sound raycast.

  4. World‐Load Settings

    • If your server has many custom mods with frequent sound events (guns, machines), consider upping scanCooldownTicks further or temporarily disabling certain integrations when large battles are underway.

Q: How do Mob Profiles work, and when should I use them?

A: Mob Profiles let you override default behaviors for specific entities—often needed if a mod adds a new “boss” or “elite variant.” Each profile is a string with five semicolon‐separated parts:

"profileName;mobId;nbtMatcher;soundOverrides;detectionOverrides"
  1. profileName: A human‐readable label (e.g., AlphaZombie, BossSkeleton).
  2. mobId: The entity’s registry name (e.g., minecraft:zombie, alienmod:shadow_stalker).
  3. nbtMatcher: Optional NBT filter in JSON form (e.g., "{IsAlpha:1b}"). Leave blank if not needed.
  4. soundOverrides: Comma‐separated entries "soundId:range:weight". Only these sounds apply to this mob.
  5. detectionOverrides: Comma‐separated entries "stanceName:rangeValue" (e.g., standing:80.0,sneaking:40.0,crawling:20.0).

Example:

specialMobProfilesRaw = [
  # Elite Skeleton: hears player.hurt at 70 blocks (weight 3.0), extended sight ranges
  "EliteSkeleton;minecraft:skeleton;{IsElite:1b};minecraft:entity.player.hurt:70.0:3.0;
    standing:90.0,sneaking:45.0,crawling:25.0"
]
  • Only targets skeletons whose NBT includes IsElite:1b.
  • Replaces default hearing of entity.player.hurt with a 70‐block range (weight 3.0).
  • Overrides detection ranges for each stance.

Use Mob Profiles when:

  • You want a mod’s “boss” or “elite” variant to be more perceptive or less sensitive to certain sounds.
  • You need to tune a custom entity’s behavior without affecting all other mobs of that type.
  • Example: A “StealthPiglin” that only hears barrel‐open sounds, ignoring everything else.

Q: Does Attract to Sound work on multiplayer servers?

A: Yes. All the logic (sound detection, stealth checks, group AI) runs server‐side. The client has no control over how mobs hear you. To ensure consistent behavior:

  1. Install the same soundattract-<version>.jar on both client and server (Forge or Fabric).
  2. Use a single soundattract-common.toml on the server; it is authoritative. Clients cannot override it.
  3. If using Per‐world datapacks for TacZ (Suffuse), make sure the server’s world has the datapack installed.

Q: What performance impact does the mod have?

A: Attract to Sound is designed with performance in mind. Key optimizations include:

  • Scan Cooldown Scaling: Mobs reduce scan frequency automatically when server TPS drops below minTpsForScanCooldown.
  • Raycast Caching: When enableRaycastCache = true, repeated line‐of‐sight checks to the same target are cached briefly.
  • Configurable Limits: You can throttle group AI, reduce muffling complexity, and limit the number of tracked sounds.

That said, if you enable all integrations (multiple gun mods, Parcool animations, voice chat), you may see extra CPU usage during heavy combat or large mob fights. Use the tuning tips above to keep TPS stable.


Q: How do I reload the config without restarting Minecraft?

A: Unfortunately, nearly all Attract to Sound settings require a full Minecraft restart to re‐register lists of mobs, sounds, or integrations. However:

  • Changing camouflage weights, movement penalties, or light/weather factors under [COMMON.stealth] may be picked up by /reload on some servers (but not guaranteed).
  • Always test after /reload. If changes do not apply, restart the game.

Q: Where can I report bugs, request features, or ask for help?

A:

When reporting issues, please include:

  1. The full soundattract-common.toml (or relevant sections).
  2. A list of installed mods and their versions.
  3. A clear description of what you expected vs. what actually happened (logs or screenshots help).

Q: Can I include Attract to Sound in my modpack or distribution?

A: Yes! You are free to include Attract to Sound in any modpack, distribution, or private server, provided you follow the license (MIT). If you distribute, please link back to the original CurseForge or GitHub page so users can easily find updates and documentation.


Q: My changes aren’t working—how can I troubleshoot?

A:

  1. Check for Syntax Errors:

    • Even a missing comma or an extra space in soundattract-common.toml can break parsing.
    • Use a TOML validator (e.g., https://www.toml-lint.com/) to catch formatting issues.
  2. Review the Latest Log:

    • Open logs/latest.log after startup. Look for lines containing SoundAttract or [AttractToSound]—they often show warnings if the config has invalid IDs or malformed lines.
  3. Verify Mod Versions & IDs:

    • Make sure the mod JAR’s modid matches what you used in the config (e.g., if Scorched Guns updated from scorchedgunsscorched_guns, update your entries).
    • Use /debug sound or /playsound <modid:sound_event> <player> in-game to confirm the sound event exists.
  4. Restart Always:

    • After editing soundattract-common.toml, fully close and reopen Minecraft. Config reloads alone will not pick up new entity or sound lists.
  5. Test Minimal Setup:

    • Temporarily remove all extra integrations (voice chat, guns, Parcool) and test with only vanilla sounds (e.g., footsteps, block breaks). Verify mobs hear vanilla sounds correctly before re‐adding integrations one at a time.

For more detailed examples, advanced tuning, and in‐depth explanations, refer to the [Configuration Guide](./Configuration). If you still have questions, open an issue on GitHub or ask in the mod’s Discord community. Good luck—and may your footsteps stay silent!

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