Advertisement
CelticCoder

TurtleRefuel

Sep 24th, 2023 (edited)
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.39 KB | None | 0 0
  1.  
  2. function refuelWithLava()
  3.   for slot = 1, 16 do
  4.     turtle.select(slot)  
  5.     local item = turtle.getItemDetail()  
  6.  
  7.     if item and item.name == "minecraft:lava_bucket" then
  8.       if turtle.refuel() then
  9.         print("Refueled with a lava bucket.")
  10.       else
  11.         print("Error: Could not refuel with a lava bucket.")
  12.       end
  13.     end
  14.   end
  15. end
  16.  
  17. refuelWithLava()
  18. turtle.select(1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement