Player
The player, you, can create actions and change things about yourself with code. You can do things like make a new chat command or change your location. You can also respond to events that happen to you.
Reference
player.say("Hi!");
player.teleport(pos(0,0,0));
player.position();
player.name();
player.onItemInteracted(IRON_SHOVEL, function () {
})
player.onChat("jump", function () {
});
player.runChatCommand("jump");
player.runChatCommandWithArguments("jump", "10");
player.onDied(() => {
});
player.onTravelled(TravelMethod.Walk, () => {
});
player.onArrowShot(() => {
});
Advanced
player.execute("say Hi!");
player.tell(mobs.target(LOCAL_PLAYER), "Hi!");
player.onTellCommand("jump", () => {
});
player.onTeleported(() => {
});