TwistedDoor

inspect_front

Jan 20th, 2022 (edited)
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. local block_exists, block_data_table = turtle.inspect()
  2. if block_exists then
  3. -- Prints out something like this:
  4. -- {
  5. -- name = "minecraft:wheat",
  6. -- state = { age = 2, },
  7. -- }
  8. print(textutils.serialize(block_data_table))
  9. -- Prints "minecraft:wheat"
  10. print(data["name"])
  11. -- Prints 2
  12. print(textutils.serialize(block_data_table["state"]["age"]))
  13. else
  14. print("No block in front of the turtle")
  15. end
Advertisement
Add Comment
Please, Sign In to add comment