IBlock
Represents a block in the world. This can be used to interact with the block (e.g.: dig, use) or block location (e.g.: place at).
Last updated
Represents a block in the world. This can be used to interact with the block (e.g.: dig, use) or block location (e.g.: place at).
Last updated
Returns the Minecraft Block ID of the block. References: https://minecraft-ids.grahamedgecombe.com/
Returns the Metadata of the block as a byte (0-255).
Returns the location of the block.
Returns block entity data (e.g.: sign text) for blocks that have it, otherwise null is returned. The returned type is IBlockEntity data which by it self has a Type property, which further specifies the entity data type (e.g.: sign). A full list of BlockEntity types can be found here.
Attempts to move the bot onto this block. This is a wrapper function for Player.MoveTo, for more information check that.
Attempts to move the bot into the specified range of this block. You must specify the max distance that we can be from this block to still be considered in range. This is a wrapper function for Player.MoveToRange, for more information check that.
Attempts to move the bot to a location that it can interact with this block from. The function considers the visibility and bot's reach. This is a wrapper function for Player.MoveToInteractionRange, for more information check that.
Returns true if this bot is standing on the given block, otherwise false.
Returns true if there is an entity that is standing on the block, otherwise false. If the output is true then the out parameter entities will contain a list of entities that are on the block. Note: this does not include this bot's entity.
Returns True if the block is within the interaction range (around 5 blocks) of the bot, otherwise false.
Returns the faces (sides) that the bot can see from the current location of this block. This will be at most 3 faces.
Returns the faces (sides) of this block that the bot could see from the given eye position. Eye position for the player is feetPosition + 1.65
. This will be at most 3 faces.
Returns the faces of this block that can be placed on (i.e.: don't have a block already attached to it).
Returns true if the bot would have direct line-of-sight to this block at a given eye position, otherwise false. Eye position for the player is feetPosition + 1.65
.
Wrapper function for IsVisibleFrom where IsVisibleFrom gets called with the bot's current eye position.
Returns true if mining this block would harm us in any way, otherwise false. By default this only considers the current bot instance, however the parameter regardOtherBots can enable checks for other bots safety as well. Note: This accounts for things such as lava flowing into us, sand falling ontop of us, us falling down a cave, and almost any scenario where it would harm us.
Returns true if the block will damage the player if we are near it or stand on it, otherwise false. Note: Examples include Lava, Cactus, Magma Block, etc.
Returns true if the block is solid, otherwise false. Note: Examples include stone, dirt, wooden planks, etc.
Returns true if the block is a liquid (water or lava), otherwise false.
Returns true if the block is mineable, otherwise false. Note: This does not account for tool inequality such as mining obsidian with iron pickaxes, this is just for if the block will ever be mineable such as mining water, bedrock, void, etc.
Returns true if the block is an Air block (empty), otherwise false.
Returns true if the block is transparent, otherwise false. Note: Examples include torches, rails, signs, pressure plates, etc.
Returns true if there are any objects in the path that can slow the bot down, harm it, or get it stuck. Note: This includes things like slime blocks, mob heads, lava, fences, etc.
Right clicks on the given block. This will consider visibility of the faces (sides) and will rotate the bots head to face the correct face (side), however it will not move the bot to the block (that is up to the developer to do).
Attempts to break this block. You can optionally specify the face (side) that will be used to dig the block. This does rotate the bots head to the appropriate block's face. If no face data is specified and no visible face is found then it will default to breaking the block using the Top (+Y) face.
The function returns Task<IDigAction>
which completes once the block is broken or instantly if the dig action was invalid (e.g.: attempting to break bedrock). The variables cancelled
and/or completed
can be used to determine the dig actions outcome.
Hits (left clicks) the given block. This will consider visibility of the faces (sides) and will rotate the bots head to face the correct face (side), however it will not move the bot to the block (that is up to the developer to do).
Looks at the given block. If no parameter is provided then the bot will look at the center of the block, however optionally you can specify the face (side) of the block to look at. Note: you can find a list of the faces and their corresponding information here.
Smoothly (slowly, per multiple ticks) looks at the given block. If no parameter is provided then the bot will look at the center of the block, however optionally you can specify the face (side) of the block to look at. You should await for this function to complete, as the rotation time is dynamic. You can optionally specify the look speed, however it is recommended to leave it as 'auto'.
Attempts to place a block that the bot is currently holding (does not validate if the bot is holding a block, that is up to the developer) at this location. This is done by getting the nearby block faces and checking whether we can place on them. This does consider the visibility of faces. If no visible face is found then false is returned, otherwise true. Note: this does not check whether the server cancelled the block placement (removed the placed block), nor does this function move the player to the range of the block (that is up to developer to do).
Attempts to place a block that the bot is currently holding by right clicking on this block's specified face (side). The visibility of a face is not verified. Note: this function does not move the player to the range of the block (that is up to developer to do). You can find a list of the faces and their corresponding information here.
Methods
GetId
GetMetadata
GetLocation
GetBlockEntityData
MoveTo
MoveToRange
MoveToInteractionRange
IsBotStandingOn
IsEntityStandingOn
IsInteractiveRange
GetVisibleFaces
GetVisibleFacesFrom
GetPlaceableFaces
IsInvisible
IsInvisibleFrom
IsSafeToMine
IsBlockDangerous
IsSolid
IsLiquid
IsMineable
IsAir
IsTransparent
IsUndesirableForPath
Use
Dig
Hit
LookAt
LookAtSmooth
PlaceOn
PlaceAt