Bedrock Energistics Core
    Preparing search index...

    Interface MachineSlotItemExpectOptionsBeta

    Conditions that a machine item slot must currently meet for an operation to apply. Each is only checked if given, and every condition that applies must hold; an empty object applies unconditionally.

    Use these to make a read-modify-write safe when the operations that do it for you don't fit. Anything you read from a slot may already be out of date by the time your write reaches Bedrock Energistics Core - the player has had ticks in which to change it - so state what you expected to be there and handle the operation reporting that it didn't apply.

    interface MachineSlotItemExpectOptions {
        expectAmount?: number;
        expectMaxAmount?: number;
        expectMinAmount?: number;
        expectType?: string;
    }
    Index
    expectAmount?: number

    Exactly how many items the slot must hold. Use 0 to require an empty slot.

    Takes precedence over MachineSlotItemExpectOptions.expectMinAmount and MachineSlotItemExpectOptions.expectMaxAmount, which are not checked at all when this is given.

    expectMaxAmount?: number

    The most items the slot may hold. Ignored if MachineSlotItemExpectOptions.expectAmount is given.

    expectMinAmount?: number

    The fewest items the slot may hold. Ignored if MachineSlotItemExpectOptions.expectAmount is given.

    Passing the same number as takeMachineSlotItem's amount consumes that many items or none at all, since the take only applies when the slot can cover it in full.

    expectType?: string

    The item type the slot must hold.