Mining Turtle Commands



The commands API allows your system to directly execute Minecraftcommands and gather data from the results.

Turtle actions are defined by an API, a set of specific action commands to put the turtle in motion. Simple tasks may be written to make the Turtle dig a shaft, place torches and ladders, dig tunnels and bridges across lava and so much more, the possibilities of use are endless. We hope the Player will enjoy this remarkable utility companion. Minecraft One command block Mining turtles in minecraft!!! 1.9) Minecraft Command Block. MINING Turtle in Minecraft?! Minecraft Command.

While one may use commands.exec directly to execute a command, thecommands API also provides helper methods to execute every command. Forinstance, commands.say('Hi!') is equivalent to commands.exec('say Hi!').

commands.async provides a similar interface to execute asynchronouscommands. commands.async.say('Hi!') is equivalent tocommands.execAsync('Hi!').

Usage

  • Set the block above this computer to stone:

Mining turtle commands bedrock edition
nativeThe builtin commands API, without any generated command helper functions
asyncA table containing asynchronous wrappers for all commands.
exec(command)Execute a specific command.
execAsync(command)Asynchronously execute a command.
list(...)List all available commands which the computer has permission to execute.
getBlockPosition()Get the position of the current command computer.
getBlockInfos(minX, minY, minZ, maxX, maxY, maxZ)Get information about a range of blocks.
getBlockInfo(x, y, z)Get some basic information about a block.
nativeSource

The builtin commands API, without any generated command helper functions

This may be useful if a built-in function (such as commands.list) has beenoverwritten by a command.

asyncSource

A table containing asynchronous wrappers for all commands.

As with commands.execAsync, this returns the 'task id' of the enqueuedcommand.

Usage

  • Asynchronously sets the block above the computer to stone.

See also

Mining Turtle Commands Minecraft

exec(command)Source

Execute a specific command.

Parameters

  1. commandstring The command to execute.

Returns

  1. boolean Whether the command executed successfully.
  2. { string... } The output of this command, as a list of lines.
  3. number | nil The number of 'affected' objects, or nil if the command failed. The definition of this varies from command to command.

Usage

  • Set the block above the command computer to stone.

execAsync(command)Source

Asynchronously execute a command.

Unlike exec, this will immediately return, instead of waiting for the command to execute. This allows you to run multiple commands at the same time.

When this command has finished executing, it will queue a task_complete event containing the result of executing this command (what exec would return).

Parameters

Commands
  1. commandstring The command to execute.

Returns

  1. number The 'task id'. When this command has been executed, it will queue a task_complete event with a matching id.

Usage

  • Asynchronously sets the block above the computer to stone.

See also

  • parallel One may also use the parallel API to run multiple commands at once.
list(...)Source

List all available commands which the computer has permission to execute.

Parameters

  1. ...string The sub-command to complete.

Mining Turtle 1.7

Returns

  1. { string... } A list of all available commands
getBlockPosition()Source

Get the position of the current command computer.

Returns

  1. number This computer's x position.
  2. number This computer's y position.
  3. number This computer's z position.

See also

Mining Turtle Commands Logdotzip

  • gps.locate To get the position of a non-command computer.
getBlockInfos(minX, minY, minZ, maxX, maxY, maxZ)Source

Get information about a range of blocks.

This returns the same information as getBlockInfo, just for multiple blocks at once.

Blocks are traversed by ascending y level, followed by z and x - the returned table may be indexed using x + z*width + y*depth*depth.

Parameters

  1. minXnumber The start x coordinate of the range to query.
  2. minYnumber The start y coordinate of the range to query.
  3. minZnumber The start z coordinate of the range to query.
  4. maxXnumber The end x coordinate of the range to query.
  5. maxYnumber The end y coordinate of the range to query.
  6. maxZnumber The end z coordinate of the range to query.
Commands

Returns

  1. { table... } A list of information about each block.

Throws

  • If the coordinates are not within the world.

  • If trying to get information about more than 4096 blocks.

getBlockInfo(x, y, z)Source

Get some basic information about a block.

Mining Turtle Commands Bedrock Edition

The returned table contains the current name, metadata and block state (as with turtle.inspect). If there is a tile entity for that block, its NBT will also be returned.

Parameters

  1. xnumber The x position of the block to query.
  2. ynumber The y position of the block to query.
  3. znumber The z position of the block to query.

Returns

  1. table The given block's information.

Throws

Advanced Mining Turtle Commands

  • If the coordinates are not within the world, or are not currently loaded.