Gameplay Mechanics - Sylsatra/attract_to_sound GitHub Wiki
The Attract to Sound mod transforms how mobs interact with players and the environment by introducing intelligent sound-based AI, stealth, and group behaviors. Below, you’ll find a detailed breakdown of each mechanic—emphasizing how the world around you (blocks, lighting, weather) and what you wear or hold (armor, items, potions, enchantments) can either conceal you or make you a beacon for hostile mobs.
-
Player Actions Produce Noises:
- Walking, running, sneaking, jumping, crouch-sprinting.
- Breaking or placing blocks (different materials generate different volumes).
- Opening/closing doors, chests, barrels, and other containers.
- Melee attacks, arrow firing, potion splash, and other combat sounds.
- TNT explosions, fire charges, bucket fills/empties, and environmental noises (e.g., minecart collisions).
-
Each Sound Has Two Key Properties:
- Range (how many blocks away a mob can hear it).
- Weight (how “loud” or “urgent” it is—higher weight = more likely to override quieter noises).
-
Raycast Method:
- Whenever a sound occurs, a virtual “ray” is traced from the source to each nearby mob.
- At every block along that ray, the mod checks for muffling blocks in a small cube (size configured by
mufflingAreaRadius
).
-
Muffling Categories & Their Effects:
- Wool (default: moderate dampening)
- Solid Blocks (stone, metal, reinforced concrete; default: heavy dampening)
- Non-Solid Blocks (doors, trapdoors, gates; default: light dampening)
- Thin Blocks (fences, iron bars; default: very light dampening)
- Liquid Blocks (water, lava; default: moderate dampening)
- Air (Empty Space) (slight attenuation to simulate dispersion)
-
Customizable Muffling:
- Add any modded block IDs to
customWoolBlocks
,customSolidBlocks
,customNonSolidBlocks
,customThinBlocks
, orcustomLiquidBlocks
. - Tweak each category’s “muffling factor” in the config to make wool quieter or solid blocks less effective, etc.
- Add any modded block IDs to
-
Result:
- If the raycast encounters enough muffling blocks (or the same block multiple times), a sound’s range and weight diminish.
- Once either falls to zero, that mob can no longer hear it—effectively “soundproofed” by walls, floors, or bespoke stealth corridors.
-
Soundproof Rooms & Hidden Corridors:
- Surround your base or tunnel with several layers of high-muffling blocks (e.g., thick wool walls framed by reinforced concrete) to almost entirely nullify footsteps and block placements.
- Increase your
mufflingAreaRadius
(in the config) if you want adjacent blocks to count, making corner-cutting more realistic.
-
One-Way Halls:
- Use alternating layers of heavy mufflers (stone, concrete) and light mufflers (wool, doors) to create hallways where mobs can’t hear your approach until you’re right on top of them—perfect for traps or surprise attacks.
-
Underground Lairs:
- Embed your living quarters under thick walls of earth and stone. Even stray zombie groans or skeleton rattles from above will be significantly muffled.
-
Standing (Default) vs. Sneaking vs. Crawling:
- Standing Detection Range: Typically up to ~32 blocks (configurable).
- Sneaking (Crouched) Range: Reduced (e.g., ~16 blocks).
- Crawling (Sneak + Forward) Range: Lowest possible (e.g., ~4 blocks).
- Mechanic: Each tick, mobs calculate if you’re within their current perception range based on your stance. Crawling directly on a matching block can drop this even further.
-
Practical Tip:
- Drop to a crawl (sneak + forward) whenever you need maximum stealth in enemy territory. Even a single matching block beneath you can make you nearly invisible to mobs.
-
Full Armor Set:
- Choose four identical armor IDs (e.g., a set of dyed leather helmets/chestplates/leggings/boots).
- If you wear exactly those four pieces, mobs multiply their base detection range by
fullArmorStealthBonus
(for example, 0.85 = 15% harder to spot). - Partial sets give no benefit unless you enable partial matching in the config.
-
Config Snippet Example:
camouflageArmorItems = [ "minecraft:leather_helmet", "minecraft:leather_chestplate", "minecraft:leather_leggings", "minecraft:leather_boots" ] requireFullSetForCamouflageBonus = true fullArmorStealthBonus = 0.85
-
Practical Tip:
- Craft a cheap set of leather armor, dye it to match your environment (forest green, desert tan), and equip it before venturing into hostile territory.
-
Defining Camouflage Sets:
-
In the config, each entry in
camouflageSets
looks like:"<hexColor>;<helmetID>;<chestplateID>;<leggingsID>;<bootsID>;<blockID_1>;<blockID_2>;..."
-
For example:
"00FF00;minecraft:leather_helmet;minecraft:leather_chestplate;minecraft:leather_leggings;minecraft:leather_boots;minecraft:green_wool;minecraft:grass_block"
-
Must wear all four matching leather pieces (hex color “00FF00” = bright green).
-
Stand adjacent (up to 6 blocks: north, south, east, west, above, below) to any of the listed blocks (green wool or grass block) for camouflage.
-
-
Stealth Scaling:
- Each matching armor piece has its own “effectiveness weight” (e.g., helmet 0.25, chestplate 0.25, leggings 0.25, boots 0.25).
- Each adjacent matching block adds even more weight (e.g.,
camouflageBlockMatchWeight = 1.0
per block). - The system sums these weights (capped at 1.0). That sum is used to interpolate between “base detection range” and “camouflage detection range” for your current stance.
- Quadratic Scaling: The more blocks you stand on/near, the disproportionately stronger your stealth (six matching blocks ≈ near-max stealth).
-
Partial Matching:
- If
allowPartialBonusIfFullSetRequired = true
, you gain a fraction of the full camouflage for wearing just some armor pieces or standing near fewer blocks. - Example: Wearing two matching leather pieces + standing on one matching block might grant ≈30–40% of maximum stealth, instead of nothing.
- If
-
Distance Penalty:
- If
camouflageDistanceScaling = true
, your camouflage effect decays with distance. - At
camouflageDistanceMax
(default: ~32 blocks), you might be only 50% as stealthy as you are up close.
- If
-
Practical Tip:
- To infiltrate a jungle temple, dye leather armor moss-green and stand atop jungle leaves, vines, or grass. Guard patrols will often pass you by without noticing.
- Utilize the mob's FOV to move around with ease.
- Hit the mob from outside its FOV to deal 20% increased damage.
-
Neutral Light Level (Default: 7):
-
If ambient light (block light + sky light) equals 7, your light-based visibility is neutral—no bonus or penalty.
-
Above 7: For each +1 light level, mobs multiply your detection range by
(1 + lightLevelSensitivity)
(default: 0.1).- Example: At light = 10 (sunlit area), detection range = base × (1 + 2 × 0.1) = base × 1.2.
-
Below 8: For each –1 light level, mobs multiply by
(1 – lightLevelSensitivity)
.- Example: At light = 6 (dim cave), detection range = base × (1 – 2 × 0.1) = base × 0.8.
-
Capped between
minLightFactor
(default: 0.5) andmaxLightFactor
(default: 1.5).
-
-
Practical Tip:
- Move through darkened corridors or build with low-light blocks (e.g., soul sand, blackstone) to reduce ambient light. This makes you harder to spot—especially at night.
-
Rain Stealth Factor:
- If the world is raining, mobs multiply your detection range by
rainStealthFactor
(default: 0.8 → 20% easier to hide).
- If the world is raining, mobs multiply your detection range by
-
Thunderstorm Stealth Factor:
- If a thunderstorm is active, mobs multiply detection range by
thunderStealthFactor
(default: 0.6 → 40% stealth).
- If a thunderstorm is active, mobs multiply detection range by
-
Mechanic:
- Rain and thunder create ambient noise and visual obstruction, making players harder to see and hear.
-
Practical Tip:
- Plan raids, mining, or sneaky base expansions during rainstorms to exploit the extra concealment. Just don’t get struck by lightning!
-
Enable Environmental Camouflage (
enableEnvironmentalCamouflage = true
):- The mod samples the colors of blocks around your eye height (horizontal radius =
envColorSampleRadius
, vertical fromenvColorSampleYOffsetStart
toenvColorSampleYOffsetEnd
—defaults = 5, –1, +1). - It compares those block colors to your dyed leather armor color (or any custom armor colors defined in
customArmorColors
). - If the color “distance” (RGB difference) ≤
environmentalCamouflageColorMatchThreshold
(default: 10), you earn a fraction of maximum stealth (up toenvironmentalCamouflageMaxEffectiveness
, default: 0.8).
- The mod samples the colors of blocks around your eye height (horizontal radius =
-
Mismatch Penalty:
- If your armor color doesn’t match the surrounding terrain (color distance >
environmentalMismatchThreshold
), andenableEnvironmentalMismatchPenalty = true
, mobs multiply your detection range byenvironmentalMismatchPenaltyFactor
(default: 1.2 → 20% easier to spot).
- If your armor color doesn’t match the surrounding terrain (color distance >
-
Practical Tip:
- Dye your armor to match biome-specific colors (e.g., tan in deserts, white in snowy taigas, orange in mesas). Stand near sand, terracotta to blend into the desert.
-
Enable Held-Item Penalty (
enableHeldItemPenalty = true
):- If you are holding any non-empty item (sword, pickaxe, torch, block, etc.), mobs multiply your detection range by
heldItemPenaltyFactor
(default: 1.1 → 10% easier to spot).
- If you are holding any non-empty item (sword, pickaxe, torch, block, etc.), mobs multiply your detection range by
-
Mechanic:
- This simulates how brandishing weapons or torches makes you more visible and “audibly active” (item swing sounds, lighter flicks).
-
Practical Tip:
- Drop to your inventory and hold nothing when creeping near a hushed spawn of Creepers.
-
Enable Enchantment Penalty (
enableEnchantmentPenalty = true
):-
If any piece of your equipped armor or your held item has a visible enchantment glint (and does not haveana “enchantment concealment” enchant), mobs multiply detection range by:
-
armorEnchantmentPenaltyFactor
(default: 1.15) per enchanted armor piece. -
heldItemEnchantmentPenaltyFactor
(default: 1.15) if your held item is enchanted.
-
-
These stack multiplicatively: 2 enchanted armor pieces = 1.15 × 1.15 ≈ 1.3225 (≈32% easier to spot).
-
-
Concealment Enchantment (Optional):
- If a “Concealment” enchantment is applied to an armor piece, it negates the enchantment penalty for that piece.
-
Practical Tip:
- Before sneaking into a Witch’s hut, remove or unequip your enchanted gear—or at least apply a Concealment enchant (if available) to avoid the penalty.
-
Invisibility Stealth Factor (
invisibilityStealthFactor = 0.1
):- If you have the vanilla Invisibility status, mobs multiply your detection range by this factor (e.g., 0.1 = 90% stealth).
- All other factors (light, movement, armor) still apply on top of this reduction.
-
Practical Tip:
- The classic “water-bucket+invisibility” trick lets you swim through Guardian spawns or sneak around with near-complete invisibility—just watch out for “held-item” penalty if you accidentally hold nothing important.
-
Group Formation:
- When a mob detects a sound, it either investigates alone or joins a nearby group within
leaderGroupRadius
(default: 64 blocks). - Each group elects a Leader and designates Followers. If
edgeMobSmartBehavior = true
, certain Followers become Edge Mobs (scouts).
- When a mob detects a sound, it either investigates alone or joins a nearby group within
-
Smart Edge AI (Scout & Relay):
- Edge Mobs investigate peripheral sounds first. If they fail to return, the Leader assumes it’s important and calls the entire group.
-
Tactical Considerations:
- Isolate Targets: Lure a single zombie away from its pack (by firing a quiet arrow or sneaking near a muffling block) instead of alerting an entire horde.
- Distract & Sneak: Throw a snowball (low weight, low range) behind a lone creeper, then rush past it while it investigates quietly—avoid drawing other nearby mobs.
-
Silent Infiltration:
- Equip a fully dyed leather set that matches your base walls (e.g., cobblestone gray).
- Build your base interior with alternating layers of wool and stone.
- Move crouch-crawl on wool pathways to minimize sound. Mobs outside will struggle to detect either sound or sight.
-
Rainy Night Raid:
- Wait for a thunderstorm (thunder = 40% extra stealth; rain = 20% extra).
- Wear minimal gear (no held tools, no enchantments).
- Sneak-crawl along pools of water or leaf blocks (environmental color match).
- Smash through a single wool block to enter an enemy’s fortified hideout—your footsteps remain muffled, and mobs may not notice until you stand directly in front of them.
-
Ambush Trap:
- Build a hallway behind a dual-layer door system: an outer door of solid blocks (e.g., reinforced concrete) and an inner door of wool.
- Stand behind the outer door. When a mob enters, it breaks the inner door (quiet if wool), then your hidden tripwire/arrow dispenser springs without alerting nearby patrolling mobs (the explosion is heavily muffled by the outer concrete).
-
Voice Lure Diversion:
- Group up with friends in multiplayer.
- One player stands downwind, whispering to lure creepers to a vantage point.
- The rest of the team sneaks around the opposite side, using full camouflage sets and crawls on matching blocks to remain hidden.
- When the creeper arrives, detonate TNT at range (explosion is still heard but only briefly—if you’ve built thick wool buffers, the blast radius is contained).
-
Optimize Your Armor & Blocks:
- Always dye your leather armor to blend with the biome or build.
- Place at least one matching block beneath any “stealth corridor” (grass block in plains, moss block in jungles, sand in deserts).
- Enable partial camouflage for flexible stealth without requiring a perfect 6-block adjacency.
-
Leverage Light & Weather:
- Time your raids for nighttime rainstorms (max stealth).
- Build enclosed corridors with low‐light sources (e.g., soul lanterns) to maintain dim, yet safe, visibility.
-
Watch Your Gear:
- Avoid holding noisy items (shovels, swords) when sneaking—drop them into a chest or switch to a piece of wool.
- Remove enchantments or use a “Concealment” enchant to bypass the glint penalty when you absolutely must wear diamond armor.
-
Use Potions Strategically:
- A quick Slowness II brew can make you almost invisible in tight spaces.
- Invisibility potions are extremely powerful—but remember that walking into water or attacking will break the effect (use crouch-crawling on slippery surfaces).
-
Soundproof Smartly:
- Layer high-muffling blocks (stone, reinforced concrete) behind moderate ones (wool, glass) to create multi-stage sound barriers.
- Use narrow passages of wool to muffle arrow shots or TNT while still allowing you to hear approaching mobs faintly.
-
Manage Group AI:
- Draw a lone zombie out with a single-snowball toss rather than firing a bow (snowball = weight 1, arrow = weight 5).
- If you have access to TacZ Guns, attach suppressors to reduce decibels by up to 70 dB—shoot quietly through wool‐lined walls without alerting the entire dungeon.
Ready to push your stealth to the next level? Dive into the [Configuration Guide] to fine-tune every variable—blocks, armor weights, sound thresholds, and more—and become a master of unseen mobility in a world that now truly listens.