Readonly BetadimensionDimension that the entity is currently within.
ReadonlyidUnique identifier of the player. This identifier is intended to be consistent across loads of a world instance. No meaning should be inferred from the value and structure of this unique identifier - do not parse or interpret it.
BetaisTrue if the player is currently using a sneaking movement.
ReadonlylevelReadonly BetalocationCurrent location of the player.
ReadonlynameName of the player.
BetanameOptional name tag of the player.
Readonly BetaonContains methods for manipulating the on-screen display of a Player.
Readonly BetascoreboardReturns a scoreboard identity that represents this entity.
BetaselectedManages the selected slot in the player's hotbar.
Optional ReadonlyspawnReadonly BetatargetRetrieves or sets an entity that is used as the target of AI-related behaviors, like attacking. For players, which don't use any AI semantics, this property does not do anything.
ReadonlytotalReadonlytypeUnique identifier of the type of the entity - for example, 'minecraft:player'.
ReadonlyxpBetaType of effect to add to the entity.
Amount of time, in ticks, for the effect to apply.
Optionalamplifier: numberOptional amplification of the effect to apply.
OptionalshowParticles: booleanBetaAmount of damage to apply.
Optionalsource: EntityDamageSourceAdditional information around the source of damage that can apply to the player.
BetaOptionaluseEffects: booleanWhether to show any visual effects connected to the extinguishing.
BetaThe identifier of the component (e.g., 'minecraft:rideable') to retrieve. If no namespace prefix is specified, 'minecraft:' is assumed. If the component is not present on the entity, undefined is returned.
BetaBetaEffect object for the specified effect, or undefined if the effect is not present.
BetaOptionaloptions: PlayAnimationOptionsBetaIdentifier of the sound to play.
OptionalsoundOptions: SoundOptionsAdditional optional options for the sound.
Command to run. Note that command strings should not start with slash.
For commands that return data, returns a JSON structure with command response values.
BetaThe message to be displayed.
This method can throw if the provided RawMessage is
in an invalid format. For example, if an empty name string
is provided to score.
// Displays "Apple or Coal"
let rawMessage = {
translate: "accessibility.list.or.two",
with: { rawtext: [{ translate: "item.apple.name" }, { translate: "item.coal.name" }] },
};
player.sendMessage(rawMessage);
BetaLength of time to set the player on fire.
OptionaluseEffects: booleanBetaName of the entity type event to trigger. If a namespace is not specified, minecraft: is assumed.
Represents a player within the world.