Protected constructorReadonly Beta dimensionDimension that the entity is currently within.
This property can throw when used.
Readonly Beta headLocation of the center of the head component of the player.
This property can throw when used.
Readonly idUnique 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.
This property can throw when used.
Beta isTrue if the player is currently using a sneaking movement.
Readonly levelReadonly Beta locationCurrent location of the player.
This property can throw when used.
Readonly nameName of the player.
This property can throw when used.
Beta nameOptional name tag of the player.
Readonly Beta onContains methods for manipulating the on-screen display of a Player.
Readonly Beta rotationMain rotation of the entity.
This property can throw when used.
Readonly Beta scoreboardReturns a scoreboard identity that represents this entity.
This property can throw when used.
Beta selectedManages the selected slot in the player's hotbar.
Readonly Beta targetRetrieves 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.
This property can throw when used.
Readonly totalReadonly typeUnique identifier of the type of the entity - for example, 'minecraft:player'.
This property can throw when used.
Readonly Beta velocityCurrent speed of the player across X, Y, and Z dimensions.
This property can throw when used.
Readonly Beta viewDirection that the player is looking, from their head.
This property can throw when used.
Readonly xpBeta
Type of effect to add to the entity.
Amount of time, in ticks, for the effect to apply.
Optional amplifier: numberOptional amplification of the effect to apply.
Optional showParticles: booleanAdds an effect, like poison, to the entity.
This function can throw errors.
Optional source: EntityDamageSourceBeta
Optional options: BlockRaycastOptionsReturns the first intersecting block from the direction that this player is looking at.
This function can throw errors.
Beta
The 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.
Gets a component (that represents additional capabilities) for an entity.
Beta
Returns all components that are both present on this entity and supported by the API.
Beta
Returns the value for the property, or undefined if the property has not been set.
Returns a property value.
This function can throw errors.
Beta
Effect object for the specified effect, or undefined if the effect is not present.
Returns the effect for the specified EffectType on the entity, or undefined if the effect is not present.
This function can throw errors.
Beta
Optional options: EntityRaycastOptionsReturns a potential set of entities from the direction that this player is looking at.
This function can throw errors.
Beta
Identifier of the sound to play.
Optional soundOptions: SoundOptionsAdditional optional options for the sound.
Plays a sound that only this particular player can hear.
This function can throw errors.
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.
Runs a particular command asynchronously from the context of this entity. Note that there is a maximum queue of 128 asynchronous commands that can be run in a given tick.
This function can throw errors.
Beta
X/Y/Z components of the velocity.
Sets a velocity for the entity to move with.
This function can throw errors.
Beta
Specifies the cooldown category to retrieve the current cooldown for.
Duration in ticks of the item cooldown.
Sets the item cooldown time for a particular cooldown category.
This function can throw errors.
Beta
Sends a message that is displayed on the connected client for this player.
This function can throw errors.
Beta
Name of the entity type event to trigger. If a namespace is not specified, minecraft: is assumed.
Triggers an entity type event. For every entity, a number of events are defined in an entities' definition for key entity behaviors; for example, creepers have a minecraft:start_exploding type event.
This function can throw errors.
Represents a player within the world.