commands.getBlockPosition

From ComputerCraft
Jump to navigation Jump to search

commands.getBlockPosition
Function
Syntax
commands.getBlockPosition()
Returns number x number y number z
API commands
Source CC:Tweaked (source)

Return the location of the running Command Computer.

ExampleExampleGet the Position
Get the Position of the Computer and print it
Code
local x, y, z = commands.getBlockPosition()
print("X:"..x.." Y:"..y.." Z:"..z)
Output
X:10 Y:100 Z:50