Skip to content

Instantly share code, notes, and snippets.

@Darthfett
Forked from andrewrk/readme.md
Last active December 11, 2015 02:09
Show Gist options
  • Save Darthfett/4528503 to your computer and use it in GitHub Desktop.
Save Darthfett/4528503 to your computer and use it in GitHub Desktop.

Proposed Digging API, first pass

event "diggingCompleted"

Fires when the block you were digging has broken.

block.isDiggable

Whether the block is diggable. This returns false for air, water, lava, etc.

bot.activateItem()

Activate the held item. This action is pressing down right-click for the item.

bot.deactivateItem()

Deactivate the held item. This action is releasing right-click for the held item.

bot.placeBlock(point, faceVector)

Place the currently equipped block.

bot.activateBlock(block)

Activate a block. Use the default right-click option for the given block (e.g. open chests, furnaces, change delay of a repeater, etc).

bot.startDigging(block)

Begin digging into a block with the currently equipped item. When you finally break through the block, you get a "diggingCompleted" event. Until the 2nd pass is implemented, there is no way to stop digging.

bot.targetDigBlock

If you are currently digging, this is the Block that you are digging. If you are not currently digging, this is null.

2nd pass. Add ability to predict how long things will take to dig so we can add these api functions:

event "diggingAborted"

Fires when digging has been cancelled.

bot.stopDigging()

Stops digging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment