96 lines
1.9 KiB
Markdown
96 lines
1.9 KiB
Markdown
# IScriptPlayer.stopSound
|
|
|
|
[← IScriptPlayer](index.md) · [← Master](../../wiki.md)
|
|
|
|
Parça 5/11 · [önceki](stopSound-4.md) · [sonraki](stopSound-6.md)
|
|
|
|
var item = mappet.createItem("minecraft:diamond_sword");
|
|
|
|
player.setCooldown(item, 100);
|
|
}
|
|
|
|
|
|
resetCooldown
|
|
|
|
void resetCooldown(int inventorySlot)
|
|
|
|
Reset cooldown for given item.
|
|
|
|
function main(c)
|
|
{
|
|
var player = c.getSubject();
|
|
|
|
player.resetCooldown(player.getMainItemInventoryIndex()); // tip: 40 is the offhand slot
|
|
}
|
|
|
|
|
|
resetCooldown
|
|
|
|
void resetCooldown(IScriptItemStack item)
|
|
|
|
Reset cooldown of a particular inventory index of the player.
|
|
|
|
function main(c)
|
|
{
|
|
var player = c.getSubject();
|
|
var item = mappet.createItem("minecraft:diamond_sword");
|
|
|
|
player.resetCooldown(item);
|
|
}
|
|
|
|
|
|
getHotbarIndex
|
|
|
|
int getHotbarIndex()
|
|
|
|
Get the inventory index of main item. Useful for e.g. main hand's cooldown methods.
|
|
|
|
function main(c)
|
|
{
|
|
var player = c.getSubject();
|
|
|
|
player.setCooldown(player.getHotbarIndex(), 100); //tip: 40 is the offhand slot
|
|
}
|
|
|
|
|
|
setHotbarIndex
|
|
|
|
void setHotbarIndex(int slot)
|
|
|
|
Set forcefully player's current hotbar inventory index. Acceptable values are 0 - 8.
|
|
|
|
send
|
|
|
|
|
|
|
|
void send(java.lang.String message)
|
|
|
|
Send a message to this player.
|
|
|
|
// Assuming that c.getSubject() is a player
|
|
c.send("I love all my players equally.");
|
|
c.getSubject().send("...but between you and me, you're my favorite player ;)");
|
|
|
|
|
|
sendRaw
|
|
|
|
void sendRaw(INBT message)
|
|
|
|
Send a message to this player using text component (like /tellraw command).
|
|
|
|
var message = mappet.createCompound();
|
|
|
|
message.setString("text", "This message displays an item...");
|
|
message.setString("color", "gold");
|
|
message.setNBT("hoverEvent",'{action:"show_item",value:"{id:\\"minecraft:diamond_hoe\\",Count:1b}"}');
|
|
|
|
c.getSubject().sendRaw(message);
|
|
|
|
|
|
getSkin
|
|
|
|
java.lang.String getSkin()
|
|
|
|
Get player's skin.
|
|
|