Skip to content

Zig: Blocks

BlockAt

Zig
1
2
3
4
5
6
7
pub const BlockAt = struct {
    dim_id: i32,
    pos_x: i32,
    pos_y: i32,
    pos_z: i32,
    // ...
};

One block cell of a dimension.

BlockAt.at

Zig
pub fn at(at_dim: i32, at_x: i32, at_y: i32, at_z: i32) BlockAt
  • Parameters:
    • at_dim : i32
    • at_x : i32
    • at_y : i32
    • at_z : i32
  • Return type: BlockAt

BlockAt.isAir

Zig
pub fn isAir(self: BlockAt) core.Error!bool

PIER_BPROP_IS_AIR: Block::isAir

BlockAt.data

Zig
pub fn data(self: BlockAt) core.Error!f64

PIER_BPROP_DATA: Block::getData (legacy data value)

BlockAt.blockItemId

Zig
pub fn blockItemId(self: BlockAt) core.Error!f64

PIER_BPROP_BLOCK_ITEM_ID: Block::getBlockItemId

BlockAt.isCraftingBlock

Zig
pub fn isCraftingBlock(self: BlockAt) core.Error!bool

PIER_BPROP_IS_CRAFTING_BLOCK: Block::isCraftingBlock

BlockAt.isInteractiveBlock

Zig
pub fn isInteractiveBlock(self: BlockAt) core.Error!bool

PIER_BPROP_IS_INTERACTIVE_BLOCK: Block::isInteractiveBlock

BlockAt.hasBlockEntity

Zig
pub fn hasBlockEntity(self: BlockAt) core.Error!bool

PIER_BPROP_HAS_BLOCK_ENTITY: BlockSource::getBlockEntity(pos) != null

BlockAt.light

Zig
pub fn light(self: BlockAt) core.Error!f64

PIER_BPROP_LIGHT: Block::getLight

BlockAt.lightEmission

Zig
pub fn lightEmission(self: BlockAt) core.Error!f64

PIER_BPROP_LIGHT_EMISSION: Block::getLightEmission

BlockAt.destroySpeed

Zig
pub fn destroySpeed(self: BlockAt) core.Error!f64

PIER_BPROP_DESTROY_SPEED: Block::getDestroySpeed

BlockAt.explosionResistance

Zig
pub fn explosionResistance(self: BlockAt) core.Error!f64

PIER_BPROP_EXPLOSION_RESISTANCE: Block::getExplosionResistance

BlockAt.friction

Zig
pub fn friction(self: BlockAt) core.Error!f64

PIER_BPROP_FRICTION: Block::getFriction

BlockAt.isContainer

Zig
pub fn isContainer(self: BlockAt) core.Error!bool

PIER_BPROP_IS_CONTAINER: Block::isContainerBlock

BlockAt.isDoor

Zig
pub fn isDoor(self: BlockAt) core.Error!bool

PIER_BPROP_IS_DOOR: unsupported since BDS 1.26.40: BlockType::isDoorBlock is gone

BlockAt.isFence

Zig
pub fn isFence(self: BlockAt) core.Error!bool

PIER_BPROP_IS_FENCE: Block::isFenceBlock

BlockAt.isRail

Zig
pub fn isRail(self: BlockAt) core.Error!bool

PIER_BPROP_IS_RAIL: Block::isRailBlock

BlockAt.isSlab

Zig
pub fn isSlab(self: BlockAt) core.Error!bool

PIER_BPROP_IS_SLAB: Block::isSlabBlock

BlockAt.isStair

Zig
pub fn isStair(self: BlockAt) core.Error!bool

PIER_BPROP_IS_STAIR: unsupported since BDS 1.26.40: BlockType::isStairBlock is gone

BlockAt.isWall

Zig
pub fn isWall(self: BlockAt) core.Error!bool

PIER_BPROP_IS_WALL: Block::isWallBlock

BlockAt.isCrop

Zig
pub fn isCrop(self: BlockAt) core.Error!bool

PIER_BPROP_IS_CROP: Block::isCropBlock

BlockAt.isUnbreakable

Zig
pub fn isUnbreakable(self: BlockAt) core.Error!bool

PIER_BPROP_IS_UNBREAKABLE: Block::isUnbreakable

BlockAt.redstoneSignal

Zig
pub fn redstoneSignal(self: BlockAt) core.Error!f64

PIER_BPROP_REDSTONE_SIGNAL: Block::getDirectSignal

BlockAt.comparatorSignal

Zig
pub fn comparatorSignal(self: BlockAt) core.Error!f64

PIER_BPROP_COMPARATOR_SIGNAL: Block::getComparatorSignal

BlockAt.isSignalSource

Zig
pub fn isSignalSource(self: BlockAt) core.Error!bool

PIER_BPROP_IS_SIGNAL_SOURCE: Block::isSignalSource

BlockAt.variant

Zig
pub fn variant(self: BlockAt) core.Error!f64

PIER_BPROP_VARIANT: Block::getVariant

BlockAt.burnOdds

Zig
pub fn burnOdds(self: BlockAt) core.Error!f64

PIER_BPROP_BURN_ODDS: Block::getBurnOdds

BlockAt.flameOdds

Zig
pub fn flameOdds(self: BlockAt) core.Error!f64

PIER_BPROP_FLAME_ODDS: Block::getFlameOdds

BlockAt.bounciness

Zig
pub fn bounciness(self: BlockAt) core.Error!f64

PIER_BPROP_BOUNCINESS: Block::getBounciness

BlockAt.isSolid

Zig
pub fn isSolid(self: BlockAt) core.Error!bool

PIER_BPROP_IS_SOLID: Block::isSolid

BlockAt.requiresTool

Zig
pub fn requiresTool(self: BlockAt) core.Error!f64

PIER_BPROP_REQUIRES_TOOL: Block::requiresCorrectToolForDrops

BlockAt.typeName

Zig
pub fn typeName(self: BlockAt, allocator: std.mem.Allocator) core.Error![]u8

PIER_BSTR_TYPE_NAME: Block::getTypeName

  • Parameters:
    • allocator : std.mem.Allocator
  • Return type: core.Error![]u8
  • Slots: block_get_str

BlockAt.snbt

Zig
pub fn snbt(self: BlockAt, allocator: std.mem.Allocator) core.Error![]u8

PIER_BSTR_SNBT: Block::mSerializationId β†’ SNBT {name,states,version}

  • Parameters:
    • allocator : std.mem.Allocator
  • Return type: core.Error![]u8
  • Slots: block_get_str

BlockAt.descriptionId

Zig
pub fn descriptionId(self: BlockAt, allocator: std.mem.Allocator) core.Error![]u8

PIER_BSTR_DESCRIPTION_ID: Block::getDescriptionId

  • Parameters:
    • allocator : std.mem.Allocator
  • Return type: core.Error![]u8
  • Slots: block_get_str

BlockAt.debugString

Zig
pub fn debugString(self: BlockAt, allocator: std.mem.Allocator) core.Error![]u8

PIER_BSTR_DEBUG_STRING: Block::toDebugString

  • Parameters:
    • allocator : std.mem.Allocator
  • Return type: core.Error![]u8
  • Slots: block_get_str

BlockAt.tags

Zig
pub fn tags(self: BlockAt, allocator: std.mem.Allocator) core.Error![]u8

PIER_BSTR_TAGS: Block::mTags β†’ SNBT string list ["a","b"]

  • Parameters:
    • allocator : std.mem.Allocator
  • Return type: core.Error![]u8
  • Slots: block_get_str

BlockAt.state

Zig
pub fn state(self: BlockAt, allocator: std.mem.Allocator) core.Error![]u8

PIER_BSTR_STATE: SNBT {state_name:value,…} all block states

  • Parameters:
    • allocator : std.mem.Allocator
  • Return type: core.Error![]u8
  • Slots: block_get_str

BlockAt.collisionShape

Zig
pub fn collisionShape(self: BlockAt, allocator: std.mem.Allocator) core.Error![]u8

PIER_BSTR_COLLISION_SHAPE: SNBT [{min:[x,y,z],max:[x,y,z]},…]

  • Parameters:
    • allocator : std.mem.Allocator
  • Return type: core.Error![]u8
  • Slots: block_get_str

BlockAt.outlineShape

Zig
pub fn outlineShape(self: BlockAt, allocator: std.mem.Allocator) core.Error![]u8

PIER_BSTR_OUTLINE_SHAPE: SNBT [{min,max}] render outline

  • Parameters:
    • allocator : std.mem.Allocator
  • Return type: core.Error![]u8
  • Slots: block_get_str

BlockAt.displayName

Zig
pub fn displayName(self: BlockAt, allocator: std.mem.Allocator) core.Error![]u8

PIER_BSTR_DISPLAY_NAME: Block::getDisplayName

  • Parameters:
    • allocator : std.mem.Allocator
  • Return type: core.Error![]u8
  • Slots: block_get_str

BlockAt.hasTag

Zig
pub fn hasTag(self: BlockAt, allocator: std.mem.Allocator, s_arg: []const u8) core.Error![]u8

PIER_BACT_HAS_TAG: sarg=tag β†’ out "0"/"1" Block::hasTag

The output, when the verb has one, is returned; abi.h names each argument.

  • Parameters:
    • allocator : std.mem.Allocator
    • s_arg : []const u8
  • Return type: core.Error![]u8
  • Slots: block_action

BlockAt.getState

Zig
pub fn getState(self: BlockAt, allocator: std.mem.Allocator, s_arg: []const u8) core.Error![]u8

PIER_BACT_GET_STATE: sarg=state name β†’ out value string Block::getState

The output, when the verb has one, is returned; abi.h names each argument.

  • Parameters:
    • allocator : std.mem.Allocator
    • s_arg : []const u8
  • Return type: core.Error![]u8
  • Slots: block_action

BlockAt.popResource

Zig
pub fn popResource(self: BlockAt, allocator: std.mem.Allocator, s_arg: []const u8) core.Error![]u8

PIER_BACT_POP_RESOURCE: sarg=item SNBT β†’ pop resource at pos Block::popResource

The output, when the verb has one, is returned; abi.h names each argument.

  • Parameters:
    • allocator : std.mem.Allocator
    • s_arg : []const u8
  • Return type: core.Error![]u8
  • Slots: block_action

BlockAt.asItem

Zig
pub fn asItem(self: BlockAt, allocator: std.mem.Allocator, s_arg: []const u8) core.Error![]u8

PIER_BACT_AS_ITEM: β†’ out item SNBT Block::asItemInstance

The output, when the verb has one, is returned; abi.h names each argument.

  • Parameters:
    • allocator : std.mem.Allocator
    • s_arg : []const u8
  • Return type: core.Error![]u8
  • Slots: block_action