commands.getBlockPosition

From ComputerCraft Wiki
Revision as of 12:14, 14 August 2015 by Smiley43210 (Talk | contribs) (Changed "MineCraft" to "Minecraft")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Grid Redstone.png  Function commands.getBlockPosition
Available only to Command Computers, returns the Minecraft world co-ordinates of the computer running the command.
Syntax commands.getBlockPosition()
Returns number x, number y, number z
Part of ComputerCraft
API commands

Examples

Grid paper.png  Example
Prints the coordinates of the Command Computer running the function.
Code
local x, y, z = commands.getBlockPosition()

print( "Command Computer's position:" )
print("X: ", x)
print("Y: ", y)
print("Z: ", z)


Grid disk.png Commands API Functions
commands.exec - commands.execAsync - commands.list - commands.getBlockPosition - commands.getBlockInfo - commands.getBlockInfos