getPlayerPos: Get player position

Description Usage Arguments Value Examples

View source: R/getPlayerPos.R

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

1
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.

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
mc_connect()
getPlayerPos()
getPlayerPos(tile = TRUE)

example_entity <- getPlayerIds()[1]
getPlayerPos(example_entity)

## End(Not run)

ropenscilabs/miner documentation built on March 20, 2018, 8:52 p.m.