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:
native | The builtin commands API, without any generated command helper functions |
---|---|
async | A 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. |
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.
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
Execute a specific command.
Parameters
- commandstring The command to execute.
Returns
- boolean Whether the command executed successfully.
- { string... } The output of this command, as a list of lines.
- 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.
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
- commandstring The command to execute.
Returns
- 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 all available commands which the computer has permission to execute.
Parameters
- ...string The sub-command to complete.
Mining Turtle 1.7
Returns
- { string... } A list of all available commands
Get the position of the current command computer.
Returns
- number This computer's x position.
- number This computer's y position.
- number This computer's z position.
See also
Mining Turtle Commands Logdotzip
- gps.locate To get the position of a non-command computer.
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
- minXnumber The start x coordinate of the range to query.
- minYnumber The start y coordinate of the range to query.
- minZnumber The start z coordinate of the range to query.
- maxXnumber The end x coordinate of the range to query.
- maxYnumber The end y coordinate of the range to query.
- maxZnumber The end z coordinate of the range to query.
Returns
- { 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.
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
- xnumber The x position of the block to query.
- ynumber The y position of the block to query.
- znumber The z position of the block to query.
Returns
- table The given block's information.
Throws
Advanced Mining Turtle Commands
If the coordinates are not within the world, or are not currently loaded.