Learn R Programming

miner (version 0.2.2)

getPlayerPos: Get player position

Description

Get entity position. The default is to get the position of the first player spawned in the game, but the positions of other players can be gotten using the player_id argument.

Usage

getPlayerPos(player_id = NULL, tile = FALSE)

Arguments

player_id

Integer giving the ID of a player. You can find IDs of all current players using getPlayerIds().

tile

Logical value specifying whether to truncate the output position to an integer (i.e., the location of the tile on which the player is positioned).

Value

A numeric vector of length three giving the position (x, y, and z) of the requested player.

Details

x is east/west with east being the positive direction. y is up/down with up being the positive direction, and z is north/south with south being the positive direction.

See Also

setPlayerPos(), getPlayerRotation(), getPlayerPitch(), and getPlayerDirection()

Examples

Run this code
# NOT RUN {
mc_connect()
getPlayerPos()
getPlayerPos(tile = TRUE)

example_entity <- getPlayerIds()[1]
getPlayerPos(example_entity)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab