setPlayerPos: Change player position

Description Usage Arguments Value Examples

View source: R/setPlayerPos.R

Description

Move player to position (x,y,z). The default is to move the first player who was spawned in the Minecraft world, but other players can also be moved using the player_id argument. If the tile argument is set to TRUE, the player will be moved to the position specified by truncating the specified x, y, and z to integers.

Usage

1
setPlayerPos(x, y, z, player_id = NULL, tile = FALSE)

Arguments

x

A numeric string with north/south position

y

A numeric string with height

z

A numeric string with east/west position

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

None.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
mc_connect()
p <- getPlayerPos()
setPlayerPos(mc, 0, p + 5, 0)

example_entity <- getPlayerIds()[1]
getPlayerPos(example_entity)
setPlayerPos(0, p, 0, example_entity)
getPlayerPos(example_entity)

## End(Not run)

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