118 lines
1.9 KiB
Markdown
118 lines
1.9 KiB
Markdown
# IScriptPlayer.stopSound
|
|
|
|
[← IScriptPlayer](index.md) · [← Master](../../wiki.md)
|
|
|
|
Parça 4/11 · [önceki](stopSound-3.md) · [sonraki](stopSound-5.md)
|
|
|
|
|
|
|
|
setWalkSpeed
|
|
|
|
void setWalkSpeed(float speed)
|
|
|
|
Set the walk speed of the player.
|
|
|
|
|
|
|
|
function main(c)
|
|
{
|
|
c.getSubject().setWalkSpeed(0.5);
|
|
}
|
|
|
|
|
|
setFlySpeed
|
|
|
|
void setFlySpeed(float speed)
|
|
|
|
Set the flight speed of the player.
|
|
|
|
function main(c)
|
|
{
|
|
c.getSubject().setFlySpeed(0.5);
|
|
}
|
|
|
|
|
|
resetFlySpeed
|
|
|
|
void resetFlySpeed()
|
|
|
|
Reset the flight speed of the player.
|
|
|
|
function main(c)
|
|
{
|
|
c.getSubject().resetFlySpeed();
|
|
}
|
|
|
|
|
|
resetWalkSpeed
|
|
|
|
void resetWalkSpeed()
|
|
|
|
Reset the walking speed of the player.
|
|
|
|
function main(c)
|
|
{
|
|
c.getSubject().resetWalkSpeed();
|
|
}
|
|
|
|
|
|
getCooldown
|
|
|
|
float getCooldown(int inventorySlot)
|
|
|
|
Get cooldown of a particular inventory index of the player.
|
|
|
|
function main(c)
|
|
{
|
|
var player = c.getSubject();
|
|
var cooldown = player.getCooldown(40); // tip: 40 is the offhand slot
|
|
|
|
c.send(The held item cooldown " + ((1 - cooldown) * 100) + " percent expired.");
|
|
}
|
|
|
|
|
|
getCooldown
|
|
|
|
float getCooldown(IScriptItemStack item)
|
|
|
|
Get cooldown of a particular inventory index of the player.
|
|
|
|
function main(c)
|
|
{
|
|
var player = c.getSubject();
|
|
var item = mappet.createItem("minecraft:diamond_sword");
|
|
var cooldown = player.getCooldown(item);
|
|
|
|
c.send(The held item cooldown " + ((1 - cooldown) * 100) + " percent expired.");
|
|
}
|
|
|
|
|
|
setCooldown
|
|
|
|
void setCooldown(int inventorySlot,
|
|
|
|
|
|
|
|
int ticks)
|
|
|
|
Set cooldown of a particular inventory index of the player.
|
|
|
|
function main(c)
|
|
{
|
|
var player = c.getSubject();
|
|
|
|
player.setCooldown(player.getHotbarIndex(), 100); // tip: 40 is the offhand slot
|
|
}
|
|
|
|
|
|
setCooldown
|
|
|
|
void setCooldown(IScriptItemStack item,
|
|
int ticks)
|
|
|
|
Set cooldown for given item.
|
|
|
|
function main(c)
|
|
{
|
|
var player = c.getSubject();
|