Inventory Transactions

Inventory transactions are a system used to group changes to inventories, dropped items or other item stack locations. This system is used to provide a coherent view of activity in inventories caused by players, and to prevent cheating or creating/destroying items in multiplayer races.

Validation

A standard inventory transaction is valid when the following conditions are met:

Inventory actions

An inventory action describes a single change to an item stack involved in the transaction. It has two primary components:

A transaction is composed of an unordered set of inventory actions. The system is explicitly designed not to care about ordering, so your plugin should also not depend on any ordering.

Inventory action types

There are several types of inventory actions which provide different methods of modifying the balance of a transaction.

Slot change

A standard change in an inventory or container, e.g. a chest. The target location is a specific slot number in the inventory. To be valid, the input item for this action type must match the item in the inventory at the point of validation.

Drop item

An item stack dropped into the world as an entity. This has no validation criteria other than the usual transaction balancing requirements.

Creative inventory

An item stack being created or destroyed. This action type is only legal when the source player is in creative mode (and the item must exist in the creative inventory when creating items).