getPlayerPos: Get player position

Description Usage Arguments Details Value See Also 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).

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.

Value

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

See Also

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

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 Jan. 21, 2021, 7:23 p.m.