Posted 18 August 2013 - 05:55 AM
Valid with Minecraft 1.6.1
Recently Minecraft has updated to allow for a new type of command.
This command is
/playsound <sound> <player> [x y z] [volume] [velocity] [minimum volume]
Don't worry about all of the parameters just yet. Let's start at the VERY beginning.
You will want a command block, the id is 137. Use the command /give 'yourname' 137
Now you should have the command block, when you right click on the placed block you are able to enter the desired command.
Let's suppose you want to creep out one of your friends. As all good friends do.
We want to find a good creepy sound to play.
I've got an Idea! Why not use a creeper sound!
Good suggestion, lets go find that file.
Your sounds folder will be in your .minecraft/ directory under /assets/sounds/
From here you can see a folder called random which contains the sound we desire.
Lets use minecraft/assets/sounds/random/fuse which sounds like a creeper nearly exploding!
The <sound> parameter is filled with the file path separating directories with a period "."
Our parameter will be
random.fuse
To target your friend we will use the call of
@p[name=Reububble]
Reububble is the name of your friend! ;)/>
To position the sound we will use the [x y z] coords of
~1 ~0 ~0
This will be 1 x coordinate away from Reububble's position! The ~ signs indicate relative position
We want the [Volume]to be LOUD so we set this value to the highest possible,
2
rather than the lowest value, 0 and not any number in between.
I like a creepy LOW sounding fuse, so we use the lowest pitch, and the slowest [velocity]
0
rather than the higher pitches ranging up to 2 maximum.
I don't mind what the [minimum volume] is, so I'll leave it.
Now we have the command
/playsound random.fuse @p[name=Reububble] ~1 ~0 ~0 2 0
Attach the command block up to a trip-wire or other redstone wires, and let Reububble become freaked out by the invisible creeper!
——————————————
CUSTOM SOUNDS
It is possible, all you need to do is have your sound in .ogg format, which is supported by many audio softwares such as audacity. So you can convert from mp3 using this software.
The tricky part is replacing the sounds which already exist, as this is the only way it can be implemented.
You need to create a resource pack or replace a current resource pack sound folder. The name you use in the replacement should be the same as the name of the sound you are replacing, and remember this means you cannot listen to that sound normally anymore, and whenever the sound would normally be heard, you will hear the new sound instead.
Watch a short youtube video explaining how this is achieved!
Thanks, please send me any questions, comments, concerns, theories, queries, or death threats you may have!
EDIT: this is good code
Recently Minecraft has updated to allow for a new type of command.
This command is
/playsound <sound> <player> [x y z] [volume] [velocity] [minimum volume]
Don't worry about all of the parameters just yet. Let's start at the VERY beginning.
You will want a command block, the id is 137. Use the command /give 'yourname' 137
Now you should have the command block, when you right click on the placed block you are able to enter the desired command.
Let's suppose you want to creep out one of your friends. As all good friends do.
We want to find a good creepy sound to play.
I've got an Idea! Why not use a creeper sound!
Good suggestion, lets go find that file.
Your sounds folder will be in your .minecraft/ directory under /assets/sounds/
From here you can see a folder called random which contains the sound we desire.
Lets use minecraft/assets/sounds/random/fuse which sounds like a creeper nearly exploding!
The <sound> parameter is filled with the file path separating directories with a period "."
Our parameter will be
random.fuse
To target your friend we will use the call of
@p[name=Reububble]
Reububble is the name of your friend! ;)/>
To position the sound we will use the [x y z] coords of
~1 ~0 ~0
This will be 1 x coordinate away from Reububble's position! The ~ signs indicate relative position
We want the [Volume]to be LOUD so we set this value to the highest possible,
2
rather than the lowest value, 0 and not any number in between.
I like a creepy LOW sounding fuse, so we use the lowest pitch, and the slowest [velocity]
0
rather than the higher pitches ranging up to 2 maximum.
I don't mind what the [minimum volume] is, so I'll leave it.
Now we have the command
/playsound random.fuse @p[name=Reububble] ~1 ~0 ~0 2 0
Attach the command block up to a trip-wire or other redstone wires, and let Reububble become freaked out by the invisible creeper!
——————————————
CUSTOM SOUNDS
It is possible, all you need to do is have your sound in .ogg format, which is supported by many audio softwares such as audacity. So you can convert from mp3 using this software.
The tricky part is replacing the sounds which already exist, as this is the only way it can be implemented.
You need to create a resource pack or replace a current resource pack sound folder. The name you use in the replacement should be the same as the name of the sound you are replacing, and remember this means you cannot listen to that sound normally anymore, and whenever the sound would normally be heard, you will hear the new sound instead.
Watch a short youtube video explaining how this is achieved!
Thanks, please send me any questions, comments, concerns, theories, queries, or death threats you may have!
EDIT: this is good code
args = {...}
for i,side in ipairs(rs.getSides()) do
if peripheral.getType(side) == 'command' then
man=peripheral.wrap(side)
break
end
end
local params = ''
for i=1,#args do
params = params..' '..args[i]
end
man.setCommand('/playsound'..params)
print('current command is : '..man.getCommand())
man.runCommand()
And those are the 3 functions available, along with the peripheral name. Make sure the command peripheral is enabled in config