Skip to content

Block Reader

Picture

Image of the Block Reader block

This block is able to read data about any blocks or tile entities in front of it.


Peripheral Name Interfaces with Has events Introduced in
blockReader Blocks No 0.7r


Functions

getBlockName

getBlockName() -> string

Returns the registry name of the block (ex. minecraft:dirt)

1
2
3
local reader = peripheral.find("blockReader")

print("There is a " .. read.getBlockName() .. " in front.")

getBlockData

getBlockData() -> table | nil

Returns the block data of the block if block is a tile entity.

1
2
3
4
5
6
local reader = peripheral.find("blockReader")

--Prints the contents of the data
for k, v in ipairs(reader.getBlockData()) do 
    print(k, v)
end

Changelog/Trivia

0.7r
Added the Block Reader peripheral.