Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- listChests.lua
- -- Get all peripheral names
- local names = { peripheral.find("minecraft:chest") }
- -- Filter for those matching "minecraft:chest"
- local chestNames = {}
- for _, peripheral in ipairs(names) do
- table.insert(chestNames, peripheral)
- end
- -- Print results
- if #chestNames == 0 then
- print("â No peripherals found")
- else
- print("ð Found the following peripherals")
- for i, name in ipairs(chestNames) do
- print(string.format("%d) %s", i, name.size()))
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement