if turtle.getItemCount(14) > 1 then
turtle.select([slot you store chest in])
local chestPlaced = turtle.place()
while not chestPlaced do
print("can't put down chest")
if turtle.detect() then
print("block in front, trying to dig it")
turtle.dig()
else
print("no block in front, maybe a mob?")
turtle.attack()
end
chestPlaced = turtle.place()
end
if chestPlaced then
for i = 2, 14 do
turtle.select(i)
turtle.drop()
end
turtle.select([slot you store chest in])
turtle.dig()
else
print("couldn't place chest")
end
end