How to setup audio in WorldGuard regions
You can use WorldGuard to create regions that can be used to play music in. This is useful if you want to play music in a specific area, setup shows or create an ambient music system. This article will go over all our region commands and how to use them.
Please note that this feature obliviously requires WorldGuard to be installed on your server.
To create a region you need to use the
/oa region create <regionName> <media> command.
This will link a region to a specific media file. This means that when a player enters the region, the media will start playing and when they leave it will stop.
The region name has to be the same as the WorldGuard region name. If you want to create a region called
spawn you need to have a WorldGuard region called
spawn as well.
By default, overlapping regions will stack. This means that if you have 2 regions on one location, and both have music, both will play at the same time. You can enable priority support within the OpenAudioMc config, at which point the region with the highest priority will play.
(regions are stored per-world, and we support the
__global__ region name to target an entire world with the lowest priority)
(the create command also accepts an optional third argument to set the volume while its being created)
An example of a region command would be:
/oa region create spawn https://soundcloud.com/creide13/a-kings-request-cutscene.
To remove music from a region you need to use the
/oa region delete <regionName> command.
This will remove the region from the region list and stop any music that is playing in that region. Note that the actual WorldGuard region will not be deleted.
Regions have a few properties that can be edited. These properties are:
To edit a region you need to use the
/oa region edit <regionName> <property> <value> command.
An example of an edit command would be:
/oa region edit spawn volume 50 or
/oa region edit spawn fade 5.
You can also use a GUI to edit regions, this can be done by using the
/oa region gui command.
You can use regions to create temporary regions that will synchronized play music for a specific amount of time. This is useful if you want to create a show or play music for a specific duration.
To create a temp region you need to use the
/oa region temp <regionName> <media> <duration in seconds> command, where the duration is the amount of time the music will play for.