-
Notifications
You must be signed in to change notification settings - Fork 22
Advanced Scripts
Nathan Glover edited this page Mar 9, 2018
·
13 revisions
When a placeholder script is called, the player that is passed to the Javascript-Expansion is also passed to the placeholder script. This player can be accessed with BukkitPlayer. After receiving, you can access all of the player methods included in the Spigot API.
Here is an example that will return the player's name and their health.
var player = BukkitPlayer;
function playerNameHealth() {
var name = player.getDisplayName();
var health = player.getHealth();
return name + " has " + health + " health!";
}
playerNameHealth();Produces: 