mlard811

Untitled

Jan 10th, 2026 (edited)
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.09 KB | None | 0 0
  1. -- Wrap the Inventory Manager (NOT the chest)
  2. -- It usually appears as "inventoryManager_0"
  3. local invMgr = peripheral.find("inventory_Manager")
  4.  
  5. if not invMgr then
  6.     print("No Inventory Manager found!")
  7.     return
  8. end
  9.  
  10. -- Define what we are looking for
  11. local targetKey = "apotheosis:rarity"
  12. local targetValue = "apotheosis:epic"
  13.  
  14. -- Get list of all items with FULL data
  15. -- Unlike standard chests, this block reads everything
  16. print("Scanning...")
  17. local items = invMgr.getItems()
  18.  
  19. for slot, item in pairs(items) do
  20.     if item.nbt then
  21.         -- Check the tag
  22.         if item.nbt[targetKey] == targetValue then
  23.             print("Found Epic Item in slot " .. item.slot)
  24.            
  25.             -- Move it to the chest below/above/etc
  26.             -- pushItems(targetInventory, slot, count)
  27.             -- Note: You need to know the direction of the DESTINATION chest relative to the Inventory Manager
  28.             -- Directions: "up", "down", "north", "south", "east", "west"
  29.            
  30.             invMgr.pushItems("up", item.slot, 64)
  31.         end
  32.     end
  33. end
  34.  
  35. print("Done.")
Advertisement
Add Comment
Please, Sign In to add comment