Mechanics
Other WikisDonate
  • Home
  • Examples
  • Placeholders
  • ⚙️Mechanics
    • Action Bar
    • Boss Bar
    • Command
    • Custom Sound
    • Damage
    • Drop Item
    • Fake Item
    • Firework
    • Flinch
    • Ignite
    • Leap
    • Lightning
    • Message
    • Particle
    • Potion
    • Push
    • Sculk Bloom
    • Sculk Shriek
    • Sound
    • Title
    • Warden Disturbance
  • 🎯Targeters
    • ServerPlayers
    • Shapes
      • Box
      • Scatter
    • Source
    • Target
    • World
  • ❔Conditions
    • Biome
    • Custom Biome
    • Entity Type
    • Gliding
    • Has Permission
    • InCone
    • Light Level
    • Material Category
    • On Ground
    • Range
    • Riding
    • Sneaking
    • Sprinting
  • 🔌Integrations
    • 🌊GeyserMC
    • 🌎MechanicsEverywhere
    • 👽MythicMobs
    • 🔫WeaponMechanics
Powered by GitBook
On this page
  1. Conditions

Range

Last updated 1 year ago

The range condition controls how far away from the source the mechanic can occur. This can be used by WeaponMechanics to control sound dropoff, so sounds further from the source sound further away.

Argument
Description
Default Value

min

The minimum distance (in blocks).

0

max

The maximum distance (in blocks).

None

Mechanics:
  - "CustomSound{sound=shoot.ak47, volume=8, noise=0.05, listenerConditions=[Range{max=40}]}"
  - "CustomSound{sound=shoot.ak47far, volume=8, noise=0.05, listenerConditions=[Range{min=40, max=80}]}"
  - "CustomSound{sound=shoot.ak47veryfar, volume=8, noise=0.05, listenerConditions=[Range{min=80}]}"

This example plays the shoot.ak47 sound from the resource pack's . The sound can be heard from the range [0, 40) blocks. For players [40, 80) blocks away, they hear the shoot.ak47far sound instead. For players more than 80 blocks away, they hear the shoot.ak47veryfar sound.

❔
sounds.json