Class:apiName(Parameters) | Return | Description |
Block:isSolidBlock(x, y, z: number) | ErrorCode.OK, isSolid: boolean | Check if it is a solid block |
Block:isLiquidBlock(x, y, z: number) | ErrorCode.OK, isLiquid: boolean | Check if it is a liquid block |
Block:isAirBlock(x, y, z: number) | ErrorCode.OK, isAir: boolean | Check if it is an air block |
Block:getBlockID(x, y, z: number) | ErrorCode.OK, id: number | Get the block ID at the specified location |
Block:setBlockAll(x, y, z: number, blockid: number, data: number) | ErrorCode.OK | Set block data and update + notify |
Block:getBlockData(x, y, z: number) | ErrorCode.OK, data: number | Get block data |
Block:destroyBlock(x, y, z: number, dropitem: boolean) | ErrorCode.OK | Destroy the block with an option to drop items (default false, not drop) |
Block:placeBlock(blockid: number, x, y, z: number, face: number, color: number) | ErrorCode.OK | Place the block |
Block:replaceBlock(blockid: number, x, y, z: number, face: number, color: number) | ErrorCode.OK | Replace the block |
Block:setBlockAllForUpdate(x, y, z: number, blockid: number) | ErrorCode.OK | Set block data to notify surrounding blocks |
Block:setBlockAllForNotify(x, y, z: number, blockid: number) | ErrorCode.OK | Set block data to update the current position block |
Block:setBlockSettingAttState(blockid: number, attrtype: BLOCKATTR_ENABLE, switch: boolean) | ErrorCode.OK | Set the block's attribute status |
Block:getBlockSettingAttState(blockid: number, attrtype: BLOCKATTR_ENABLE) | ErrorCode.OK, switch: boolean | Get the block's attribute status |
Block:getBlockSwitchStatus(pos: table{x, y, z}) | ErrorCode.OK, isactive: boolean | Get the switch state of the functional block |
Block:setBlockSwitchStatus(pos: table{x, y, z}, isactive: boolean) | ErrorCode.OK | Set the switch state of the functional block |
Block:getBlockDataByDir(blockid: number, dir: number) | ErrorCode.OK, data: number | Get the block data value based on the direction |
Block:getBlockPowerStatus(pos: table{x, y, z}) | ErrorCode.OK, isactive: boolean | Get the power-on state of the block |
Block:randomBlockID() | ErrorCode.OK, blockid: number | Get a random block ID |
Block:GetBlockDefName(blockid: number) | ErrorCode.OK, name: string | Get the name of the block |
Block:GetBlockDefDesc(blockid: number) | ErrorCode.OK, desc: string | Get the description of the block |
Block:GetBlockFacade(blockid: number) | ErrorCode.OK, faced: number | Get the appearance of the block |
Block:PlayAct(x, y, z: number, animid: number, playmode: number) | ErrorCode.OK | Play the animation for the miniature cube |
Block:ReplaceBluePrint(x, y, z: number, blueprint: string, angle: number, mirror: boolean, placeMode: boolean) | ErrorCode.OK | Place the blueprint at the specified location |