99 lines
1.9 KiB
Markdown
99 lines
1.9 KiB
Markdown
# IScriptPlayer.stopSound
|
|
|
|
[← IScriptPlayer](index.md) · [← Master](../../wiki.md)
|
|
|
|
Parça 8/11 · [önceki](stopSound-7.md) · [sonraki](stopSound-9.md)
|
|
|
|
void setHunger(int value)
|
|
|
|
getHunger
|
|
|
|
int getHunger()
|
|
|
|
setSaturation
|
|
|
|
void setSaturation(float value)
|
|
|
|
getSaturation
|
|
|
|
float getSaturation()
|
|
|
|
playSound
|
|
|
|
default void playSound(java.lang.String event,
|
|
double x,
|
|
double y,
|
|
double z)
|
|
|
|
Play a sound event only to this player.
|
|
|
|
For all possible sound event IDs, please refer to either /playsound command, or script editor's sound picker.
|
|
|
|
var player = c.getSubject();
|
|
var pos = player.getPosition();
|
|
|
|
player.playSound("minecraft:entity.pig.ambient", pos.x, pos.y, pos.z);
|
|
|
|
|
|
playSound
|
|
|
|
void playSound(java.lang.String event,
|
|
java.lang.String soundCategory,
|
|
double x,
|
|
double y,
|
|
double z)
|
|
|
|
Play a sound event only to this player at specific sound channel.
|
|
|
|
var player = c.getSubject();
|
|
var pos = player.getPosition();
|
|
|
|
player.playSound("minecraft:entity.pig.ambient", "voice", pos.x, pos.y, pos.z);
|
|
|
|
|
|
playSound
|
|
|
|
void playSound(java.lang.String event,
|
|
java.lang.String soundCategory,
|
|
double x,
|
|
double y,
|
|
double z,
|
|
float volume,
|
|
float pitch)
|
|
|
|
Play a sound event only to this player with volume and pitch at specific channel.
|
|
|
|
var player = c.getSubject();
|
|
var pos = player.getPosition();
|
|
|
|
player.playSound("minecraft:entity.pig.ambient", "voice", pos.x, pos.y, pos.z, 1.0, 0.8);
|
|
|
|
|
|
playSound
|
|
|
|
void playSound(java.lang.String event,
|
|
double x,
|
|
double y,
|
|
double z,
|
|
|
|
|
|
|
|
float volume,
|
|
float pitch)
|
|
|
|
Play a sound event only to this player with volume and pitch.
|
|
|
|
var player = c.getSubject();
|
|
var pos = player.getPosition();
|
|
|
|
player.playSound("minecraft:entity.pig.ambient", pos.x, pos.y, pos.z, 1.0, 0.8);
|
|
|
|
|
|
stopAllSounds
|
|
|
|
default void stopAllSounds()
|
|
|
|
Stop all playing sound events for this player.
|
|
|
|
c.getWorld().stopAllSounds();
|