Beta
The location of the machine.
The ID of the item slot element.
Optionalamount: number
The amount of items to remove. Defaults to the whole stack. Asking for more than the slot holds is not an error; the rest of the stack is returned. To take this many items or none at all, pass the same number as MachineSlotItemExpectOptions.expectMinAmount.
Optionaloptions: MachineSlotItemExpectOptions
Conditions the slot must meet.
What was removed, or undefined if the slot was empty or did not
meet options.
Prefer this over reading a slot and writing it back: the whole read-modify-write happens inside Bedrock Energistics Core, so a player can't take the item out in between and end up holding a copy of it.
Throws a PublicError of type PublicErrorType.NotFound if there is no block at the given location, including when that location's chunk is not loaded.
Throws a PublicError of type PublicErrorType.NotRegistered if the block is not registered as a machine.
Throws a PublicError of type PublicErrorType.InvalidArgument if the element is not an item slot, or if amount is not a positive integer.
Throws a PublicError of type PublicErrorType.InvalidState if this package has not been initialized (see init).
Removes items from a machine item slot.