BlockInventory
Namespace Mc.Scripting.Inventories · Kind class (sealed)
public sealed class BlockInventory : EngineInventoryThe 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.
Properties
Section titled “Properties”| Member | Description |
|---|---|
BlockPos Position { get; } |
The block position. |
World World { get; } |
The dimension. |
Position
Section titled “Position”public BlockPos Position { get; }The block position.
public World World { get; }The dimension.
Methods
Section titled “Methods”| 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.