Advertisement
DonnyKerstens

GetTorchIndex

Nov 25th, 2020 (edited)
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. function getTorchIndex()
  2. for slot = 1, 16, 1 do
  3. local item = turtle.getItemDetail(slot)
  4. if(item ~= nil) then
  5. if(item["name"] == "minecraft:torch") then
  6. return slot
  7. end
  8. end
  9. end
  10. return nil
  11. end
  12.  
  13. print(getTorchIndex())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement