1.9 KiB
IScriptPlayer.stopSound
inventory.setStack(0, item);
getEnderChest
IScriptInventory getEnderChest()
Get player's ender chest inventory.
// Assuming that c.getSubject() is a player var inventory = c.getSubject().getEnderChest(); var item = mappet.createItem("minecraft:diamond_sword");
// This will change the first slot in player's ender chest to a diamond sword inventory.setStack(0, item);
executeCommand
void executeCommand(java.lang.String command)
Executes a command as a player.
function main(c) { c.getSubject().executeCommand("/kill"); }
Specified by: executeCommand in interface IScriptEntity
setSpawnPoint
void setSpawnPoint(double x, double y, double z)
Sets the player's spawn point.
c.getSubject().setSpawnPoint(0, 0, 0);
getSpawnPoint
ScriptVector getSpawnPoint()
Gets the player's spawn point.
var spawnPoint = c.getSubject().getSpawnPoint(); c.send("Spawn point: " + spawnPoint.x + ", " + spawnPoint.y + ", " + spawnPoint.z);
isFlying
boolean isFlying()
Returns if the player is flying.
function main(c) { c.send("Is the player flying? " + c.getSubject().isFlying()); }
getWalkSpeed
float getWalkSpeed()
Returns if the walk speed of the player.
function main(c) { c.send("The walk speed of the player is: " + c.getSubject().getWalkSpeed()); }
setFlyingEnabled
void setFlyingEnabled(boolean enabled)
Allows the player to fly in whatever game mode they're in.
c.getSubject().setFlyingEnabled(true);
Parameters: enabled - Whether the player can fly or not.
getFlySpeed
float getFlySpeed()
Returns if the flight speed of the player.
function main(c) { c.send("The flight speed of the player is: " + c.getSubject().getFlySpeed()); }