Ambient Sound Zone
Play ambient sound in a region
An ambient sound zone plays a sound when a player enters a protection region or WorldGuard region, and stops it when the player leaves. The sound is played once: it is not repeated while the player stays in the zone, and there is no fade. Minecraft cannot change the volume of a sound that is already playing, so fadeIn and fadeOut are kept but unused. If multiple zones overlap, the one with the highest priority takes precedence.
フィールド
| フィールド | 型 | デフォルト | 説明 |
|---|---|---|---|
protectionRegionId | String | — | The protection region ID where the ambient sound plays (primary). Use the ID of a region_definition entry. |
worldGuardRegionId | String | — | WorldGuard region name (optional fallback, read only when protectionRegionId is empty). Needs the WorldGuard plugin. |
sound | Var<Sound> | EMPTY | The sound to play in this zone |
layer | AudioLayer | AMBIENT | The audio layer to use値:MASTERMUSICAMBIENTSFXVOICE |
zoneVolume | Var<Float> | 1.0 | Volume multiplier for this zone (0.0 to 1.0), applied on top of the player's layer volume |
fadeIn | Duration | ofSeconds(2) | Minecraft cannot change the volume of a sound that is already playing, so this field does not produce a progressive fade; the sound starts at its full volume. |
fadeOut | Duration | ofSeconds(2) | Minecraft cannot change the volume of a sound that is already playing, so this field does not produce a progressive fade; the sound is stopped at once when the player leaves. |
looping | Boolean | true | Not implemented yet: the sound is played once and is not repeated, whatever this value is |
priority | Int | 0 | Priority when multiple zones overlap (higher wins) |
How to use it
Set protectionRegionId to the entry ID of a region created with the Protection extension. The zone starts when the player moves into the region and stops when they leave it. If several zones match, the one with the highest priority wins. worldGuardRegionId is used when protectionRegionId is empty and needs the WorldGuard plugin; zoneVolume multiplies the volume on top of the player's layer volume.
fadeIn and fadeOut have no effect: Minecraft cannot change the volume of a sound that is already playing, so the sound starts at its full volume and stops at once when the player leaves. looping is not implemented either: the sound is played once and is not repeated, so choose a sound long enough for the zone.