Advertisement
TechManDylan

SoulFarmer

May 30th, 2025 (edited)
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.91 KB | None | 0 0
  1. -- Function to find Soul Sand in inventory
  2. local function findSoulSandSlot()
  3.     for slot = 1, 16 do
  4.         local item = turtle.getItemDetail(slot)
  5.         if item and item.name == "minecraft:soul_sand" then
  6.             return slot
  7.         end
  8.     end
  9.     return nil
  10. end
  11.  
  12. -- Main loop
  13. while true do
  14.     -- Break Soulless Sand if it's in front
  15.     local success, data = turtle.inspect()
  16.     if success and data.name == "forbidden_arcanus:soulless_sand" then
  17.         print("Breaking Soulless Sand...")
  18.         turtle.dig()
  19.     end
  20.  
  21.     -- Attempt to place Soul Sand
  22.     local slot = findSoulSandSlot()
  23.     if slot then
  24.         turtle.select(slot)
  25.         if turtle.place() then
  26.             print("Placed Soul Sand.")
  27.         else
  28.             print("Failed to place Soul Sand.")
  29.         end
  30.     else
  31.         print("No Soul Sand in inventory.")
  32.     end
  33.  
  34.     sleep(1) -- changed from 2 to 1 second
  35. end
  36.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement