Skip to content

BlockInventory

Namespace Mc.Scripting.Inventories · Kind class (sealed)

public sealed class BlockInventory : EngineInventory

The inventory of a block entity by position: chests, trapped chests, barrels, furnaces, blast furnaces, smokers, hoppers, droppers, dispensers, brewing stands and shulker boxes. A double chest is two inventories of 27 slots (one per half). The handle holds a position, not the block entity: it is empty when the block goes away.

Member Description
BlockPos Position { get; } The block position.
World World { get; } The dimension.
public BlockPos Position { get; }

The block position.

public World World { get; }

The dimension.

Member Description
static BlockInventory? At(World world, BlockPos pos) The inventory of the block entity at a position.
public static BlockInventory? At(World world, BlockPos pos)

The inventory of the block entity at a position.

Parameters

Name Type Description
world World The dimension.
pos BlockPos The block position.

Returns BlockInventory?: The inventory, or null when the chunk is not loaded or the block has no inventory.

BlockPos · EngineInventory · World