77 lines
1.9 KiB
Markdown
77 lines
1.9 KiB
Markdown
# IScriptWorld.testForBlock
|
|
|
|
[← IScriptWorld](index.md) · [← Master](../../wiki.md)
|
|
|
|
Parça 9/16 · [önceki](testForBlock-8.md) · [sonraki](testForBlock-10.md)
|
|
|
|
c.getWorld().stopAllSounds();
|
|
|
|
|
|
stopSound
|
|
|
|
default void stopSound(java.lang.String event)
|
|
|
|
Stop specific sound event for every player.
|
|
|
|
c.getWorld().stopSound("minecraft:entity.pig.ambient");
|
|
|
|
|
|
stopSound
|
|
|
|
void stopSound(java.lang.String event,
|
|
java.lang.String category)
|
|
|
|
Stop specific sound event in given sound category for every player.
|
|
|
|
For list of sound categories, type into chat /playsound minecraft:entity.pig.ambient, press space, and press Tab key. The list of sounds categories will be displayed.
|
|
|
|
c.getWorld().stopSound("minecraft:entity.pig.ambient", "master");
|
|
|
|
|
|
dropItemStack
|
|
|
|
default IScriptEntityItem dropItemStack(IScriptItemStack stack,
|
|
double x,
|
|
double y,
|
|
double z)
|
|
|
|
Drop item stack at given XYZ position with no velocity applied.
|
|
|
|
var item = mappet.createItem("minecraft:diamond_hoe");
|
|
var pos = c.getSubject().getPosition();
|
|
|
|
c.getWorld().dropItemStack(item, pos.x, pos.y + 3, pos.z);
|
|
|
|
|
|
dropItemStack
|
|
|
|
IScriptEntityItem dropItemStack(IScriptItemStack stack,
|
|
double x,
|
|
double y,
|
|
double z,
|
|
double mx,
|
|
double my,
|
|
double mz)
|
|
|
|
Drop an item stack at given XYZ position in this world with desired velocity.
|
|
|
|
var item = mappet.createItem("minecraft:diamond_hoe");
|
|
var pos = c.getSubject().getPosition();
|
|
|
|
c.getWorld().dropItemStack(item, pos.x, pos.y + 3, pos.z, 0, 1, 0);
|
|
|
|
|
|
explode
|
|
|
|
default void explode(double x,
|
|
double y,
|
|
double z,
|
|
float distance)
|
|
|
|
Make an explosion in this world at given coordinates, and distance that destroys blocks, damages entities but not places fire. See explode(IScriptEntity, double, double, double,
|
|
float, boolean, boolean) for more thorough definition of arguments.
|
|
|
|
function main(c)
|
|
{
|
|
var s = c.getSubject();
|