Editing
MinecraftCommands
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== playsound === {{/infobox |playsound |op |1.6.1|1.6.1-pre }} Plays a sound. ;Syntax : <code>playsound <''sound''> <''source''> <''player''> [''x''] [''y''] [''z''] [''volume''] [''pitch''] [''minimumVolume'']</code> ;Arguments : ''sound'' :: Specifies the sound to play. Must be a sound event defined in [[Sounds.json#Sound events|sounds.json]] (for example, <code>mob.pig.say</code>). :: A sound event may be affiliated with multiple sounds, and the sound which is actually produced will be chosen at random from them, modified by their "weight", just as the game normally would. For example, the <code>mob.pig.say</code> sound event will play one of several pig sounds at random, because the event has multiple sounds associated with it. ::[[Resource pack]]s may add their own events to sounds.json; the command will successfully play these. File names are ''not'' used by this command; it strictly uses the events defined in sounds.json (which may not even be similar to the original file names and paths), and thus a resource pack adding new sound files must define events for them (this is not necessary when replacing old sounds which are already in defined events). : ''source'' :: Specifies which category in the music & sound options the sound falls under. Must be <code>master</code>, <code>music</code>, <code>record</code>, <code>weather</code>, <code>block</code>, <code>hostile</code>, <code>neutral</code>, <code>player</code>, <code>ambient</code>, or <code>voice</code>. : ''player'' :: Specifies the sound's target. Must be a player name or a [[#Target selectors|target selector]].<!-- 1.8 note: cannot target non-players, even with @e --> : ''x y z'' (optional) :: Specifies the position to play the sounds from. May use [[#Tilde notation|tilde notation]] to specify a position relative to the target(s). : ''volume'' (optional) :: Specifies the distance that the sound can be heard. Must be at least 0.0. For values less than 1.0, the sound will be quieter and have a smaller sphere within which it may be heard. For values greater than 1.0, the sound will not actually grow louder, but its audible range (a 16-block radius at 1.0) will be multiplied by ''volume''. There will always be a gradual falloff to silence based on distance from the center of the sphere. : ''pitch'' (optional) :: Specifies the pitch of the sound. Must be between 0.0 and 2.0 (inclusive), and values less than 0.5 are equivalent to 0.5. Values lower than 1.0 lower the pitch and increase the duration; values greater than 1.0 raise the pitch and reduce the duration. The pitch value is a multiplier applied to the frequency, so if a value between 0.5 and 1.0 (inclusive) is doubled, the pitch will be an octave higher. (If you're a musician wishing to convert other intervals to pitch values, see [[Note block#Usage]], but be aware that 1.0 won't be Fβ― for all sound effects.) If not specified, defaults to 1.0. : ''minimumVolume'' (optional) :: Specifies the volume for targets outside the sound's normal audible sphere. If a target is outside the normal sphere, the sound will instead be centered some short distance from the target (less than four blocks away), and <code>''minimumVolume''</code> will determine its volume. Must be between 0.0 and 1.0 (inclusive). ;Result : Fails if the arguments are not specified correctly, if ''player'' fails to resolve to one or more online players, or if the targets are unable to hear the sound from where it is played. : On success, plays a sound for the targeted players. <!-- please retain double newline above for section differentiation -->
Summary:
Please note that all contributions to Hegemon Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Hegemon Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
Edit source
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information