Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Block Type Reader for Tweaked.cc ComputerCraft
- -- This script tests the block directly above the computer.
- -- Function to get block information above the computer
- function getBlockAbove()
- local block = peripheral.wrap("top")
- if block and block.getBlockData then
- return block.getBlockData()
- end
- return nil
- end
- -- Main program
- blockInfo = getBlockAbove()
- if not blockInfo then
- print("No block detected above or unable to retrieve block information.")
- else
- print("Block Information:")
- print(" Name: " .. (blockInfo.name or "Unknown"))
- print(" Tags: ")
- for tag, _ in pairs(blockInfo.tags or {}) do
- print(" - " .. tag)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement