From ComputerCraft Wiki
Revision as of 07:59, 4 August 2020 by Magiczocker (Talk | contribs)

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

Grid Redstone.png  Function turtle.inspectUp
Returns the ID string and metadata of the block above the Turtle in a table format: { name = "modname:blockname", metadata = 0 }.
Syntax turtle.inspectUp()
Returns boolean success, table data/string error message
Part of ComputerCraft
API turtle


Grid paper.png  Example
If there is a block above the turtle, prints it's name and metadata.
local success, data = turtle.inspectUp()

if success then
  print("Block name: ", data.name)
  print("Block metadata: ", data.metadata)

Additional Notes

  • Returns false when there is nothing (air) above the Turtle.

See also