Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local reader = peripheral.find("blockReader")
- local nbtStorage = peripheral.find("nbtStorage")
- print(textutils.serialize(nbtStorage.read()))
- local function getFilter()
- local data = reader.getBlockData()
- for k, v in pairs(data) do
- print(k, v)
- end
- return data
- end
- local function generateJson(value)
- local baseJson =
- {
- Items =
- {
- {
- id = "productivebees:upgrade_filter",
- tag = {
- productivebees_allowed_bees = {
- value,
- },
- },
- Count = 1,
- Slot = 0,
- },
- },
- ForgeCaps = {},
- }
- return textutils.serializeJSON(baseJson)
- end
- local newValue = generateJson("productivebees:zombie")
- local pass, err = nbtStorage.writeJson(newValue)
- print(pass, err)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement