Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- === Save Nice Greg Metadata to File ===
- local sensor = peripheral.find("plethora:sensor")
- if not sensor then
- print("❌ No Plethora sensor module found.")
- return
- end
- local radius = 8
- local entities = sensor.sense(radius)
- local file = fs.open("nicegreg_metadata.txt", "w")
- file.writeLine("=== Nice Greg Metadata Dump ===\n")
- local found = false
- for _, e in ipairs(entities) do
- if e.name == "Villager" and e.id then
- local success, meta = pcall(sensor.getMetaByID, e.id)
- if success and meta then
- for k, v in pairs(meta) do
- file.writeLine(k .. ": " .. textutils.serialize(v))
- end
- found = true
- break
- end
- end
- end
- file.close()
- if found then
- print("✅ Metadata written to nicegreg_metadata.txt")
- print("📝 Use 'edit nicegreg_metadata.txt' to view it.")
- else
- print("❌ No villager metadata found.")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement