← Back to Index

InventoryTransactionPacket (30)

Inventory Transaction. Sent for item interaction UI depending on if ItemStackNetManager is enabled as well as when the player uses items in gameplay. See ComplexInventoryTransaction::Type for more details.
Field Name Type Field Index Description
Legacy Request ID (Required) ItemStackLegacyRequestId 0 Used when ItemStackNetManager is enabled. Identifies a legacy client item request. Negative, even values are valid. Zero indicates no legacy request.

ItemStackLegacyRequestId

Field Name Type Field Index Description
ID (Required) varint32 0 Raw Id (32 bit signed)
Legacy Set Item Slots array<LegacySetSlot> 1 Only present when Legacy Request ID is valid. Lists the open containers and their slot indices the client is requesting changes for.

LegacySetSlot (Array Item)

Field Name Type Field Index Description
Container Enum (Required) varuint8 0 The container enum name identifying which container slot set this belongs to.
Enum Values:
Index Value
0 AnvilInputContainer
1 AnvilMaterialContainer
2 AnvilResultPreviewContainer
3 SmithingTableInputContainer
4 SmithingTableMaterialContainer
5 SmithingTableResultPreviewContainer
6 ArmorContainer
7 LevelEntityContainer
8 BeaconPaymentContainer
9 BrewingStandInputContainer
10 BrewingStandResultContainer
11 BrewingStandFuelContainer
12 CombinedHotbarAndInventoryContainer
13 CraftingInputContainer
14 CraftingOutputPreviewContainer
15 RecipeConstructionContainer
16 RecipeNatureContainer
17 RecipeItemsContainer
18 RecipeFoodContainer
19 RecipeBlocksContainer
20 RecipeFurnaceItemsContainer
21 RecipeSearchContainer
22 RecipeSearchBarContainer
23 RecipeEquipmentContainer
24 RecipeBookContainer
25 EnchantingInputContainer
26 EnchantingMaterialContainer
27 FurnaceFuelContainer
28 FurnaceIngredientContainer
29 FurnaceResultContainer
30 HorseEquipContainer
31 HotbarContainer
32 InventoryContainer
33 ShulkerBoxContainer
34 TradeIngredient1Container
35 TradeIngredient2Container
36 TradeResultPreviewContainer
37 OffhandContainer
38 CompoundCreatorInput
39 CompoundCreatorOutputPreview
40 ElementConstructorOutputPreview
41 MaterialReducerInput
42 MaterialReducerOutput
43 LabTableInput
44 LoomInputContainer
45 LoomDyeContainer
46 LoomMaterialContainer
47 LoomResultPreviewContainer
48 BlastFurnaceIngredientContainer
49 SmokerIngredientContainer
50 Trade2Ingredient1Container
51 Trade2Ingredient2Container
52 Trade2ResultPreviewContainer
53 GrindstoneInputContainer
54 GrindstoneAdditionalContainer
55 GrindstoneResultPreviewContainer
56 StonecutterInputContainer
57 StonecutterResultPreviewContainer
58 CartographyInputContainer
59 CartographyAdditionalContainer
60 CartographyResultPreviewContainer
61 BarrelContainer
62 CursorContainer
63 CreatedOutputContainer
64 SmithingTableTemplateContainer
65 CrafterLevelEntityContainer
66 DynamicContainer
Slots (Required) array<uint8> 1 List of inventory slot indices within the given container.
Transaction (Required) oneOf 2 The inventory transaction. The variant index encodes ComplexInventoryTransaction::Type (0=Normal, 1=Mismatch, 2=ItemUse, 3=ItemUseOnActor, 4=ItemRelease), matching the legacy wire format discriminator.
oneOf<NormalTransactionData, InventoryMismatchData, ItemUseInventoryTransaction, ItemUseOnActorInventoryTransaction, ItemReleaseInventoryTransaction>:
Control Value [uint32] Type Details
0 NormalTransactionData -
1 InventoryMismatchData -
2 ItemUseInventoryTransaction -
3 ItemUseOnActorInventoryTransaction -
4 ItemReleaseInventoryTransaction -
NormalTransactionData (Variant 0)
Field Name Type Field Index Description
Actions (Required) InventoryTransaction 0 Base inventory actions. Lists the slot changes making up this Normal (container UI) transaction.

InventoryTransaction

Field Name Type Field Index Description
Actions (Required) array<InventoryAction> 0 List of inventory slot changes. Each action describes which container slot is changing and what the item descriptor transitions from and to.

InventoryAction (Array Item)

Field Name Type Field Index Description
Source (Required) InventorySource 0 The inventory source identifying which container this action targets.

InventorySource

Field Name Type Field Index Description
Source Type (Required) varuint32 0 The inventory source type.
Enum Values:
Index Value
0 Container Inventory
1 Global Inventory
2 World Interaction
3 Creative Inventory
4 Non Implemented Feature TODO
Container ID varint8 1 Container window ID. Present only for ContainerInventory and NonImplementedFeatureTODO source types.
Bit Flags varuint32 2 Source flags. Present only for WorldInteraction source type.
Enum Values:
Index Value
0 No Flag
1 World Interaction Random
Slot (Required) varuint32 1 The slot index within the source container.
From Item (Required) NetworkItemStackDescriptor 2 The item descriptor representing the state of the slot before this action.
To Item (Required) NetworkItemStackDescriptor 3 The item descriptor representing the desired state of the slot after this action.
InventoryMismatchData (Variant 1)
Field Name Type Field Index Description
Actions (Required) InventoryTransaction 0 Base inventory actions. Lists the slot changes making up this server-to-client rejection transaction.

InventoryTransaction

Field Name Type Field Index Description
Actions (Required) array<InventoryAction> 0 List of inventory slot changes. Each action describes which container slot is changing and what the item descriptor transitions from and to.

InventoryAction (Array Item)

Field Name Type Field Index Description
Source (Required) InventorySource 0 The inventory source identifying which container this action targets.

InventorySource

Field Name Type Field Index Description
Source Type (Required) varuint32 0 The inventory source type.
Enum Values:
Index Value
0 Container Inventory
1 Global Inventory
2 World Interaction
3 Creative Inventory
4 Non Implemented Feature TODO
Container ID varint8 1 Container window ID. Present only for ContainerInventory and NonImplementedFeatureTODO source types.
Bit Flags varuint32 2 Source flags. Present only for WorldInteraction source type.
Enum Values:
Index Value
0 No Flag
1 World Interaction Random
Slot (Required) varuint32 1 The slot index within the source container.
From Item (Required) NetworkItemStackDescriptor 2 The item descriptor representing the state of the slot before this action.
To Item (Required) NetworkItemStackDescriptor 3 The item descriptor representing the desired state of the slot after this action.
ItemUseInventoryTransaction (Variant 2)
Field Name Type Field Index Description
Actions (Required) InventoryTransaction 0 Base inventory actions. Lists the inventory slot changes associated with this transaction.

InventoryTransaction

Field Name Type Field Index Description
Actions (Required) array<InventoryAction> 0 List of inventory slot changes. Each action describes which container slot is changing and what the item descriptor transitions from and to.

InventoryAction (Array Item)

Field Name Type Field Index Description
Source (Required) InventorySource 0 The inventory source identifying which container this action targets.

InventorySource

Field Name Type Field Index Description
Source Type (Required) varuint32 0 The inventory source type.
Enum Values:
Index Value
0 Container Inventory
1 Global Inventory
2 World Interaction
3 Creative Inventory
4 Non Implemented Feature TODO
Container ID varint8 1 Container window ID. Present only for ContainerInventory and NonImplementedFeatureTODO source types.
Bit Flags varuint32 2 Source flags. Present only for WorldInteraction source type.
Enum Values:
Index Value
0 No Flag
1 World Interaction Random
Slot (Required) varuint32 1 The slot index within the source container.
From Item (Required) NetworkItemStackDescriptor 2 The item descriptor representing the state of the slot before this action.
To Item (Required) NetworkItemStackDescriptor 3 The item descriptor representing the desired state of the slot after this action.
Action Type (Required) varint32 1 The type of item use action performed.
Enum Values:
Index Value
0 Place
1 Use
2 Destroy
3 Use As Attack
Trigger Type (Required) varuint8 2 PlayerInput if a direct result of the player's initial button input. SimulationTick if the player is holding down input from a previous tick.
Enum Values:
Index Value
0 Unknown
1 Player Input
2 Simulation Tick
Position (Required) BlockPos 3 The position of the target block.

BlockPos

Field Name Type Field Index Description
X (Required) varint32 0
Y (Required) varint32 1
Z (Required) varint32 2
Face (Required) varuint8 4 The face of the target block that was clicked.
Slot (Required) varint32 5 The inventory slot of the item being used.
Item (Required) NetworkItemStackDescriptor 6 The item stack descriptor of the item being used.
From Position (Required) Vec3 7 The player's position when this transaction was sent.

Vec3

Field Name Type Field Index Description
X (Required) float 0
Y (Required) float 1
Z (Required) float 2
Click Position (Required) Vec3 8 The position within the target block face that was clicked.

Vec3

Field Name Type Field Index Description
X (Required) float 0
Y (Required) float 1
Z (Required) float 2
Target Block Id (Required) varuint32 9 The runtime block state ID of the target block.
Client Interact Prediction (Required) uint8 10 Whether the client predicted the interaction would succeed.
Enum Values:
Index Value
0 Failure
1 Success
Client Cooldown State (Required) uint8 11 Whether the item is currently on cooldown on the client.
Enum Values:
Index Value
0 Off
1 On
ItemUseOnActorInventoryTransaction (Variant 3)
Field Name Type Field Index Description
Actions (Required) InventoryTransaction 0 Base inventory actions. Lists the inventory slot changes associated with this transaction.

InventoryTransaction

Field Name Type Field Index Description
Actions (Required) array<InventoryAction> 0 List of inventory slot changes. Each action describes which container slot is changing and what the item descriptor transitions from and to.

InventoryAction (Array Item)

Field Name Type Field Index Description
Source (Required) InventorySource 0 The inventory source identifying which container this action targets.

InventorySource

Field Name Type Field Index Description
Source Type (Required) varuint32 0 The inventory source type.
Enum Values:
Index Value
0 Container Inventory
1 Global Inventory
2 World Interaction
3 Creative Inventory
4 Non Implemented Feature TODO
Container ID varint8 1 Container window ID. Present only for ContainerInventory and NonImplementedFeatureTODO source types.
Bit Flags varuint32 2 Source flags. Present only for WorldInteraction source type.
Enum Values:
Index Value
0 No Flag
1 World Interaction Random
Slot (Required) varuint32 1 The slot index within the source container.
From Item (Required) NetworkItemStackDescriptor 2 The item descriptor representing the state of the slot before this action.
To Item (Required) NetworkItemStackDescriptor 3 The item descriptor representing the desired state of the slot after this action.
Runtime Id (Required) ActorRuntimeID 1 The runtime ID of the actor being interacted with or attacked.

ActorRuntimeID

Field Name Type Field Index Description
Actor Runtime ID (Required) varuint64 0
Action Type (Required) varint32 2 Interact: right-click on actor. Attack: left-click or trident spin attack.
Enum Values:
Index Value
0 Interact
1 Attack
2 Item Interact
Slot (Required) varint32 3 The inventory slot of the item being used on the actor.
Item (Required) NetworkItemStackDescriptor 4 The item stack descriptor of the item being used on the actor.
From Position (Required) Vec3 5 The player's position when this transaction was sent.

Vec3

Field Name Type Field Index Description
X (Required) float 0
Y (Required) float 1
Z (Required) float 2
Hit Position (Required) Vec3 6 The position on the actor that was clicked.

Vec3

Field Name Type Field Index Description
X (Required) float 0
Y (Required) float 1
Z (Required) float 2
ItemReleaseInventoryTransaction (Variant 4)
Field Name Type Field Index Description
Actions (Required) InventoryTransaction 0 Base inventory actions. Lists the inventory slot changes associated with this transaction.

InventoryTransaction

Field Name Type Field Index Description
Actions (Required) array<InventoryAction> 0 List of inventory slot changes. Each action describes which container slot is changing and what the item descriptor transitions from and to.

InventoryAction (Array Item)

Field Name Type Field Index Description
Source (Required) InventorySource 0 The inventory source identifying which container this action targets.

InventorySource

Field Name Type Field Index Description
Source Type (Required) varuint32 0 The inventory source type.
Enum Values:
Index Value
0 Container Inventory
1 Global Inventory
2 World Interaction
3 Creative Inventory
4 Non Implemented Feature TODO
Container ID varint8 1 Container window ID. Present only for ContainerInventory and NonImplementedFeatureTODO source types.
Bit Flags varuint32 2 Source flags. Present only for WorldInteraction source type.
Enum Values:
Index Value
0 No Flag
1 World Interaction Random
Slot (Required) varuint32 1 The slot index within the source container.
From Item (Required) NetworkItemStackDescriptor 2 The item descriptor representing the state of the slot before this action.
To Item (Required) NetworkItemStackDescriptor 3 The item descriptor representing the desired state of the slot after this action.
Action Type (Required) varint32 1 Release: firing a bow or releasing a held item. Use: finishing charging a crossbow.
Enum Values:
Index Value
0 Release
1 Use
Slot (Required) varint32 2 The inventory slot of the item being released.
Item (Required) NetworkItemStackDescriptor 3 The item stack descriptor of the item being released.
From Position (Required) Vec3 4 The player's position when this transaction was sent.

Vec3

Field Name Type Field Index Description
X (Required) float 0
Y (Required) float 1
Z (Required) float 2