Skip to content

Instructions

Ivaynn edited this page Apr 26, 2025 · 5 revisions

This is the "Edit" page of a turtle's menu. It provides an intuitive user interface that allows you to create your own programs by clicking the text in chat.

The buttons at the top of this page let you change the current page, remove, cut, copy and paste the selected line, move it up or down and toggle a Numpad (that can be seen in the bottom right corner).

Clicking the line number of the selected line toggles a breakpoint for that line, changing the line number's color to red (line 6 of this image). When running a program, the turtle pauses before running a line with a breakpoint.


The instructions available are listed here, and more details about each one and how to use it can be found below the list.

Name Parameters Description
move direction Move one block
turn direction Turn
mine direction Mine block
attack direction Damage entities
harvest direction Break and replant fully grown crops
use item, direction Use item from inventory (or equipped tool)
insert item, direction Insert items in a container
take item, direction Take items from a container
drop item Drop items from inventory
grab item Pick up dropped items
if item / block / counter, ... If the condition is true, run the next line. If not, skip it
unless item / block / counter, ... Has the opposite result of "if"
line operation, line Continue running the program from the selected line
counter name, operation, type, value Do operations with integers, each "name" has one "value"
comment text Comment line, used to organize programs
wait - Do nothing for one action
fuel item, count Convert items from inventory into fuel
pause - Pause the Turtle, can be resumed from this point
stop - Stop the Turtle
remove - Remove Turtle and drop all items

Move

Move one block in the selected direction. If the turtle's "Auto Mine" option is enabled, the turtle will mine any blocks that would prevent it from moving. If the turtle can't move in the selected direction, this generates an error.

Parameter Arguments
direction forward, back, up, down

Examples:

1 | move forward
2 | move back

Turn

Turn in the selected direction.

Parameter Arguments
direction left, right

Examples:

1 | turn left
2 | turn right

Mine

Mine the block in the selected direction, collecting the dropped items into the turtle's inventory. If the inventory is full, this generates an error. If the turtle's "Pause On Error" option is disabled, the items will be dropped on the ground and the turtle will continue.

This instruction uses the tool currently equipped by the turtle and applies enchantments such as Fortune or Silk Touch.

Parameter Arguments
direction forward, up, down

Examples:

1 | mine forward
2 | mine down

Attack

Damage entities in the selected direction. If the turtle's "Damage Players" option is enabled, it can also damage players.

This instruction uses the tool currently equipped by the turtle and applies enchantments such as Sharpness, Smite, Bane of Arthropods and Fire Aspect.

Parameter Arguments
direction forward, up, down

Examples:

1 | attack forward
2 | attack up

Harvest

If the block in the selected direction is a fully grown crop (wheat, carrots, potatoes, ...), the turtle runs "mine" and "use" to break and replant the crop. This instruction generates errors if the block isn't a crop or if the turtle doesn't have the required item to replant in its inventory.

Parameter Arguments
direction forward, up, down

Examples:

1 | harvest forward
2 | harvest down

Use

Use an item from the turtle's inventory or its equipped tool in the selected direction. This instruction generates errors if the item is not in the turtle's inventory or if it can't be used. Please note that non-block items may not be supported and block items ignore block states.

Parameter Arguments
item <item id>, tool
direction forward, up, down

Examples:

1 | use tool forward
2 | use minecraft:stone down
3 | use minecraft:arrow forward
4 | use minecraft:shulker_box forward

Insert

Insert items from the turtle's inventory into a container (chest, trapped chest, barrel, shulker box, dropper, dispenser or hopper). If there isn't enough space, the remaining items stay on the turtle's inventory.

Parameter Arguments
item <item id>, all
direction forward, up, down

Examples:

1 | insert all forward
2 | insert minecraft:diamond down

Take

Take items from a container (chest, trapped chest, barrel, shulker box, dropper, dispenser or hopper) into the turtle's inventory. If there isn't enough space, the remaining items stay on the container.

Parameter Arguments
item <item id>, all
direction forward, up, down

Examples:

1 | take all forward
2 | take minecraft:diamond down

Drop

Drop items with the selected ID from the turtle's inventory.

Parameter Arguments
item <item id>, all

Examples:

1 | drop all
2 | drop minecraft:diamond

Grab

Pick up dropped items with the selected ID in a radius of 5 blocks.

Parameter Arguments
item <item id>, all

Examples:

1 | grab all
2 | grab minecraft:diamond

If

Checks a specified condition. If the condition is true, the turtle will execute the next line. If the condition is false, the turtle will skip the next line.

  • The condition "if item" checks if the specified item is in the turtle's inventory.

  • The condition "if block" checks if the block in the selected direction drops the specified item when mined with silk touch. Buckets of water, lava and powder snow can be used to check for their respective fluids.

  • The condition "if counter" compares the value of a counter with another counter or with a fixed value.

Condition Parameter Arguments
item item <item id>, all
block block <item id>, air
direction forward, back, left, right, up, down
counter name <name>
operation =, <, <=, >, >=
type value, counter
value/counter <int> / <name>

Examples:

1 | if item minecraft:diamond
2 | if block minecraft:stone forward
3 | if counter test1 <= value 8
4 | if counter test2 > counter test1 

Unless

This instruction is the same as if, but has the opposite result.

Examples:

1 | unless item all
2 | unless counter test3 = value 2

Line

This instruction makes the program jump to other lines. This can be combined with if to create loops with exit conditions, allowing users to create much more complex programs.

This instruction uses line numbers as arguments, that's why those are included in every example of this wiki. If this sends the program to a line greater than its length, the turtle stops.

The operation set is absolute while add and remove are relative to the current line.

Parameter Arguments
operation set, add, remove
line <int>

Examples:

1 | line add 1
2 | line set 3
3 | line remove 2

Counter

This instruction creates counters (integer variables). These are unique to each turtle and can be used to store information, do operations, count steps, etc.

You can see a list of counters in the "Counters" page of a turtle's menu. Counters are cleared when a turtle restarts if its "Clear Counters" option is enabled. If an undefined counter is used, it assumes value 0.

To set the counter's <name> argument, you can use:

  • Any item (it uses the item ID)
  • A renamed item (it uses the item's name)
  • A book and quill (it uses the text on the first page)

Counters can do operations (similar to scoreboards) with values from different sources:

  • value - a specified integer
  • counter - another counter's value
  • pos - the turtle's position or rotation (x, y, z, r)
  • fuel - the current fuel level
  • random - a random number between 1 and the specified value
Parameter Arguments
name <name>
operation =, +=, -=, *=, /=, %=, <, >
type value, counter, pos, fuel, random
value <int> / <name> / x, y, z, r

Examples:

1 | counter test1 = value -4
2 | counter test2 *= counter test1
3 | counter test3 = pos z
4 | counter test4 = fuel
5 | counter test5 = random 3

Comment

A simple comment line, used to organize programs. It gets skipped when running the program. By default the comment text is empty and can be used as an empty line. Comment lines can't have breakpoints.

To change the comment text, hold a Book and Quill with the comment text written on the first page (this also works for counter names).

Parameter Arguments
comment text

Examples:

1 | : This is a comment
2 | : 

Fuel

Makes the turtle consume fuel items from its inventory. Count must be greater than zero.

Parameter Arguments
item any, coal, charcoal, coal_block, blaze_rod, lava_bucket
count <int>

Examples:

1 | fuel any 1
2 | fuel blaze_rod 5

Other Instructions

The instructions wait, pause, stop and remove don't require any extra information.

Clone this wiki locally