Difference between revisions of "Turtle.drop"

From ComputerCraft Wiki
Jump to: navigation, search
(Minecraft 1.5 changed how furnaces work, so some clarification on changes)
(Changing int to number)
Line 2: Line 2:
 
{{Function
 
{{Function
 
|name=turtle.drop
 
|name=turtle.drop
|args=[<nowiki></nowiki>{{type|int}} count]
+
|args=[<nowiki></nowiki>{{type|number}} count]
 
|returns={{type|boolean}} true if an item was dropped; false otherwise.
 
|returns={{type|boolean}} true if an item was dropped; false otherwise.
 
|api=turtle
 
|api=turtle

Revision as of 11:33, 18 July 2013


Grid Redstone.png  Function turtle.drop
Drops all items in the selected slot, or if count is specified, drops that many items.

If the space in front of the turtle does not contain a chest, the items are dropped into that space. If the space in front of the turtle contains a chest, the items are dropped into that chest. The items will be placed in the first available slot, starting at the top left, moving right and then down.

turtle.dropUp and turtle.dropDown are also available, and useful for loading furnaces; dropDown when above the furnace will load the top slot for smelting.

Before Minecraft 1.5/ComputerCraft 1.51, dropUp would load the bottom (fuel) slot for furnaces, since the hopper-related changes, fuel is loaded into the sides, and the output slot is available on the bottom (using turtle.suckUp)
Syntax turtle.drop([number count])
Returns boolean true if an item was dropped; false otherwise.
Part of ComputerCraft
API turtle

Examples

Grid paper.png  Example
Drops all items in the first available slot.
Code
turtle.drop()