Learn R Programming

miner (version 0.2.2)

setPlayerPos: Change player position

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

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

Run this code
# 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)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab