Java Reference
In-Depth Information
public void
playerStuffCommand(MessageReceiver caller,
String[]
parameters) {
if
(caller
instanceof
Player) {
Player me = (Player)caller;
String
msg =
"Your display name is "
+ me.getDisplayName();
me.chat(msg);
me.getWorld().setRaining(true);
me.getWorld().setRainTime(100);
// 5 secs
float
exp = me.getExperience();
int
food = me.getHunger();
float
health = me.getHealth();
Location loc = me.getLocation();
me.chat(
"Your experience points are "
+ exp);
me.chat(
"food is "
+ food);
me.chat(
"health is "
+ health);
me.chat(
"you are at "
+ printLoc(loc));
me.chat(
"water falls from the sky "
);
}
}
}
Install that now:
$
cd Desktop
$
cd code/PlayerStuff
$
./build.sh
Restart your server and reconnect your Minecraft client.
What happens when you type the command
"/whoami"
from the Minecraft client?
Here's what I get: