Quick question. I have my fueling function, but I wanted to have the turtle to check it's other inventory slots for coal before it shuts off if it's designated "fuel" slow runs out. I was thinking of using the "turtle.getItemDetail()" and then using a boolean to check if the slot has an item with the name "minecraft:coal". How would I go about checking if the returned name information matches "minecraft:coal"?
Last question, I promise
0
Last Question: Checking if an item is [blank]
Started by Doobliheim, Nov 24 2015 11:28 PM
turtle lua
2 replies to this topic
#1
Posted 24 November 2015 - 11:28 PM
#2
Posted 24 November 2015 - 11:33 PM
local x = "minecraft:iron" if(x == "minecraft:coal") then --# Do stuff end local y = (x == "minecraft:coal") if(y) then --#Do stuff end
#3
Posted 24 November 2015 - 11:38 PM
You may be better off using turtle.refuel(0). This doesn't actually refuel the turtle, but it still returns true if the currently selected slot contains a valid fuel unit, or false if it does not.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users