Advertisement
Guest User

test

a guest
Jun 25th, 2025
13
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.50 KB | None | 0 0
  1. -- listChests.lua
  2.  
  3. -- Get all peripheral names
  4. local names = { peripheral.find("minecraft:chest") }
  5.  
  6. -- Filter for those matching "minecraft:chest"
  7. local chestNames = {}
  8. for _, peripheral in ipairs(names) do
  9.       table.insert(chestNames, peripheral)
  10. end
  11.  
  12. -- Print results
  13. if #chestNames == 0 then
  14.   print("❌ No peripherals found")
  15. else
  16.   print("🔍 Found the following peripherals")
  17.   for i, name in ipairs(chestNames) do
  18.     print(string.format("%d) %s", i, name.size()))
  19.   end
  20. end
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement