Play Sound - MoSadie/EffectMC GitHub Wiki
Description
Play a sound with the ability to set options about how and where the sound is heard from.
To find a sound name I would recommend using auto-complete when typing out the /playsound
command to find the name of a sound.
You can use sounds from the minecraft
namespace as well as any other custom sounds provided by resource packs.
Configuration Options
- Title (optional): An optional title to display on the key. Customize location and font using the T icon to the right of the text box.
- Minecraft IP (required): The address that the EffectMC mod is running on. (Example:
http://localhost:3000
) - Sound (required): The name of the sound to play. (ex. entity.ghast.ambient) Namespaces defaults to
minecraft
but can be specified. An easy way to find the sound name is in a single player world using/playsound
. - Volume: The volume of the sound, from 0% to 100%.
- Pitch: The pitch of the sound, from 0 to 2. Default is 1.
- Category: The Category slider to use when changing volume in-game. Does NOT have to match the sound at all. (ex. Creeper hissing in Music works just fine.)
- Repeat: If enabled, repeats the sound until the Stop Sound effect or the
/stopsound
command is used. (Note/stopsound
can only be run by OPs and command blocks, so be aware. Relogging or muting the sound category will stop the sound as well.) - Repeat Delay: If Repeat is enabled, configures how often to start the sound. (Note: Does not stop the previous sound, will happily overlap.)
- Attenuation Type: Configure if the sound gets quieter as the player leaves the sound's position (
Linear
), or if the sound should always stay a constant volume, no matter the distance (None
). - X, Y, Z: Configure the coordinates of the sound. Can be either relative or absolute.
- Position Type: Set if the position from X, Y, and Z is a relative or absolute position.
- Global: If set, the position of the player does not matter and the sound will always be heard as if standing at the origin looking north. If this is enabled, the sound can even be heard if triggered on a different screen, like the main menu.
Example Configuration
This configuration is for the Ghast ambient sound a few blocks away from the player when triggered.
In-Game Experience
YouTube video:
Advanced: HTTP Request Information
- Method: GET
- Endpoint:
/playsound
- Parameters:
device
: Device ID (String)sound
: The resouce location of the sound to play. (String)category
: The category to play the sound in. Accepted values:MASTER
,MUSIC
,RECORD
,WEATHER
,BLOCK
,HOSTILE
,NEUTRAL
,PLAYER
,AMBIENT
,VOICE
(String)volume
: Accepted values: 0.0 to 1.0 (Float)pitch
: Accepted values: 0.0 to 2.0 (Float)repeat
: Accepted values:true
,false
(Defaults tofalse
on invalid value) (Boolean)repeatDelay
: (Integer)attenuationType
: Accepted values:NONE
,LINEAR
(String)x
: (Integer)y
: (Integer)z
: (Integer)relative
: Accepted values:true
,false
(Defaults tofalse
on invalid value) (Boolean)global
: Accepted values:true
,false
(Defaults tofalse
on invalid value) (Boolean)