Skip to content

Blocks

Section notes in abi.h

Β§D blocks & block entities

Block: state get/set, collision shape (dedicated fns)

Slots

block_get_num

C
bool (*block_get_num)(int32_t dim, int32_t x, int32_t y, int32_t z, int32_t prop, double* out);

block_get_str

C
bool (*block_get_str)(int32_t dim, int32_t x, int32_t y, int32_t z, int32_t prop, void* ctx, PierStrSink sink);

block_action

C
bool (*block_action)(
    int32_t dim,
    int32_t x,
    int32_t y,
    int32_t z,
    int32_t action,
    PierStr sarg,
    void* ctx,
    PierStrSink out
);

block_entity_snbt

C
bool (*block_entity_snbt)(int32_t dim, int32_t x, int32_t y, int32_t z, void* ctx, PierStrSink sink);

BlockActor::save (with default SaveContext) as SNBT; false if none there.

  • Call: api->block_entity_snbt(dim, x, y, z, ctx, sink)
  • Parameters:
    • dim : int32_t
    • x : int32_t
    • y : int32_t
    • z : int32_t
    • ctx : void*
    • sink : PierStrSink
  • Return type: bool
  • Section of abi.h: Β§D blocks & block entities
  • Position in the table: slot 42, counting from 0
  • Callers in each binding:

block_get_state

C
bool (*block_get_state)(int32_t dim, int32_t x, int32_t y, int32_t z, PierStr state_name, void* ctx,
                        PierStrSink sink);
  • Call: api->block_get_state(dim, x, y, z, state_name, ctx, sink)
  • Parameters:
    • dim : int32_t
    • x : int32_t
    • y : int32_t
    • z : int32_t
    • state_name : PierStr
    • ctx : void*
    • sink : PierStrSink
  • Return type: bool
  • Section of abi.h: Block: state get/set, collision shape (dedicated fns)
  • Position in the table: slot 122, counting from 0
  • Callers in each binding:

block_set_state

C
bool (*block_set_state)(int32_t dim, int32_t x, int32_t y, int32_t z, PierStr state_name, PierStr value);
  • Call: api->block_set_state(dim, x, y, z, state_name, value)
  • Parameters:
    • dim : int32_t
    • x : int32_t
    • y : int32_t
    • z : int32_t
    • state_name : PierStr
    • value : PierStr
  • Return type: bool
  • Section of abi.h: Block: state get/set, collision shape (dedicated fns)
  • Position in the table: slot 123, counting from 0
  • Callers in each binding:

block_get_collision_shape

C
bool (*block_get_collision_shape)(int32_t dim, int32_t x, int32_t y, int32_t z, void* ctx, PierStrSink sink);
  • Call: api->block_get_collision_shape(dim, x, y, z, ctx, sink)
  • Parameters:
    • dim : int32_t
    • x : int32_t
    • y : int32_t
    • z : int32_t
    • ctx : void*
    • sink : PierStrSink
  • Return type: bool
  • Section of abi.h: Block: state get/set, collision shape (dedicated fns)
  • Position in the table: slot 124, counting from 0
  • Callers in each binding:

PierBlockNumProp

block_get_num keys.

Name Value Description
PIER_BPROP_IS_AIR 0 Block::isAir
PIER_BPROP_DATA 1 Block::getData (legacy data value)
PIER_BPROP_BLOCK_ITEM_ID 2 Block::getBlockItemId
PIER_BPROP_IS_CRAFTING_BLOCK 3 Block::isCraftingBlock
PIER_BPROP_IS_INTERACTIVE_BLOCK 4 Block::isInteractiveBlock
PIER_BPROP_HAS_BLOCK_ENTITY 5 BlockSource::getBlockEntity(pos) != null
PIER_BPROP_LIGHT 6 Block::getLight
PIER_BPROP_LIGHT_EMISSION 7 Block::getLightEmission
PIER_BPROP_DESTROY_SPEED 8 Block::getDestroySpeed
PIER_BPROP_EXPLOSION_RESISTANCE 9 Block::getExplosionResistance
PIER_BPROP_FRICTION 10 Block::getFriction
PIER_BPROP_IS_CONTAINER 11 Block::isContainerBlock
PIER_BPROP_IS_DOOR 12 the current engine version gives no value for this constant: unsupported since BDS 1.26.40: BlockType::isDoorBlock is gone
PIER_BPROP_IS_FENCE 13 Block::isFenceBlock
PIER_BPROP_IS_RAIL 14 Block::isRailBlock
PIER_BPROP_IS_SLAB 15 Block::isSlabBlock
PIER_BPROP_IS_STAIR 16 the current engine version gives no value for this constant: unsupported since BDS 1.26.40: BlockType::isStairBlock is gone
PIER_BPROP_IS_WALL 17 Block::isWallBlock
PIER_BPROP_IS_CROP 18 Block::isCropBlock
PIER_BPROP_IS_UNBREAKABLE 19 Block::isUnbreakable
PIER_BPROP_REDSTONE_SIGNAL 20 Block::getDirectSignal
PIER_BPROP_COMPARATOR_SIGNAL 21 Block::getComparatorSignal
PIER_BPROP_IS_SIGNAL_SOURCE 22 Block::isSignalSource
PIER_BPROP_VARIANT 23 Block::getVariant
PIER_BPROP_BURN_ODDS 24 Block::getBurnOdds
PIER_BPROP_FLAME_ODDS 25 Block::getFlameOdds
PIER_BPROP_BOUNCINESS 26 Block::getBounciness
PIER_BPROP_IS_SOLID 27 Block::isSolid
PIER_BPROP_REQUIRES_TOOL 28 Block::requiresCorrectToolForDrops

PierBlockStrProp

block_get_str keys.

Name Value Description
PIER_BSTR_TYPE_NAME 0 Block::getTypeName
PIER_BSTR_SNBT 1 Block::mSerializationId β†’ SNBT
PIER_BSTR_DESCRIPTION_ID 2 Block::getDescriptionId
PIER_BSTR_DEBUG_STRING 3 Block::toDebugString
PIER_BSTR_TAGS 4 Block::mTags β†’ SNBT string list ["a","b"]
PIER_BSTR_STATE 5 SNBT {state_name:value,…} all block states
PIER_BSTR_COLLISION_SHAPE 6 SNBT [{min:[x,y,z],max:[x,y,z]},…]
PIER_BSTR_OUTLINE_SHAPE 7 SNBT [{min,max}] render outline
PIER_BSTR_DISPLAY_NAME 8 Block::getDisplayName

PierBlockAction

block_action verbs.

Name Value Description
PIER_BACT_HAS_TAG 0 sarg=tag β†’ out "0"/"1" Block::hasTag
PIER_BACT_GET_STATE 1 sarg=state name β†’ out value string Block::getState
PIER_BACT_POP_RESOURCE 2 sarg=item SNBT β†’ pop resource at pos Block::popResource
PIER_BACT_AS_ITEM 3 β†’ out item SNBT Block::asItemInstance