← Packet index

Packet 30

InventoryTransactionPacket

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.

Packet datagramWire order
HeaderID 30varuint
0Legacy Request IDItemStackLegacyRequestId · variable
1Legacy Set Item Slotsarray<LegacySetSlot> · variable
2TransactiononeOf<NormalTransactionData, InventoryMismatchData, ItemUseInventoryTransaction, ItemUseOnActorInventoryTransaction, ItemReleaseInventoryTransaction> · variable

Serialized fields

3 top-level fields
  1. 0Legacy Request IDUsed when ItemStackNetManager is enabled. Identifies a legacy client item request. Negative, even values are valid. Zero indicates no legacy request.ItemStackLegacyRequestId
    1. 0IDRaw Id (32 bit signed)Compressionvarint32
  2. 1Legacy Set Item SlotsoptionalOnly present when Legacy Request ID is valid. Lists the open containers and their slot indices the client is requesting changes for.LegacySetSlotas array<LegacySetSlot>
    1. 0Container EnumThe container enum name identifying which container slot set this belongs to.CompressionEnum-as-ValueContainerEnumNameas uint8
      1. 0AnvilInputContainer
      2. 1AnvilMaterialContainer
      3. 2AnvilResultPreviewContainer
      4. 3SmithingTableInputContainer
      5. 4SmithingTableMaterialContainer
      6. 5SmithingTableResultPreviewContainer
      7. 6ArmorContainer
      8. 7LevelEntityContainer
      9. 8BeaconPaymentContainer
      10. 9BrewingStandInputContainer
      11. 10BrewingStandResultContainer
      12. 11BrewingStandFuelContainer
      13. 12CombinedHotbarAndInventoryContainer
      14. 13CraftingInputContainer
      15. 14CraftingOutputPreviewContainer
      16. 15RecipeConstructionContainer
      17. 16RecipeNatureContainer
      18. 17RecipeItemsContainer
      19. 64RecipeFoodContainer
      20. 65RecipeBlocksContainer
      21. 66RecipeFurnaceItemsContainer
      22. 18RecipeSearchContainer
      23. 19RecipeSearchBarContainer
      24. 20RecipeEquipmentContainer
      25. 21RecipeBookContainer
      26. 22EnchantingInputContainer
      27. 23EnchantingMaterialContainer
      28. 24FurnaceFuelContainer
      29. 25FurnaceIngredientContainer
      30. 26FurnaceResultContainer
      31. 27HorseEquipContainer
      32. 28HotbarContainer
      33. 29InventoryContainer
      34. 30ShulkerBoxContainer
      35. 31TradeIngredient1Container
      36. 32TradeIngredient2Container
      37. 33TradeResultPreviewContainer
      38. 34OffhandContainer
      39. 35CompoundCreatorInput
      40. 36CompoundCreatorOutputPreview
      41. 37ElementConstructorOutputPreview
      42. 38MaterialReducerInput
      43. 39MaterialReducerOutput
      44. 40LabTableInput
      45. 41LoomInputContainer
      46. 42LoomDyeContainer
      47. 43LoomMaterialContainer
      48. 44LoomResultPreviewContainer
      49. 45BlastFurnaceIngredientContainer
      50. 46SmokerIngredientContainer
      51. 47Trade2Ingredient1Container
      52. 48Trade2Ingredient2Container
      53. 49Trade2ResultPreviewContainer
      54. 50GrindstoneInputContainer
      55. 51GrindstoneAdditionalContainer
      56. 52GrindstoneResultPreviewContainer
      57. 53StonecutterInputContainer
      58. 54StonecutterResultPreviewContainer
      59. 55CartographyInputContainer
      60. 56CartographyAdditionalContainer
      61. 57CartographyResultPreviewContainer
      62. 58BarrelContainer
      63. 59CursorContainer
      64. 60CreatedOutputContainer
      65. 61SmithingTableTemplateContainer
      66. 62CrafterLevelEntityContainer
      67. 63DynamicContainer
    2. 1SlotsList of inventory slot indices within the given container.array<uint8>
  3. 2TransactionThe 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>
    0NormalTransactionDataNormalTransactionData
    1. 0ActionsBase inventory actions. Lists the slot changes making up this Normal (container UI) transaction.InventoryTransaction
      1. 0ActionsList of inventory slot changes. Each action describes which container slot is changing and what the item descriptor transitions from and to.InventoryActionas array<InventoryAction>
        1. 0SourceThe inventory source identifying which container this action targets.InventorySource
          1. 0Source TypeThe inventory source type.CompressionEnum-as-ValueInventorySourceTypeas varuint32
            1. 0Container Inventory
            2. 1Global Inventory
            3. 2World Interaction
            4. 3Creative Inventory
            5. 99999Non Implemented Feature TODO
          2. 1Container IDoptionalContainer window ID. Present only for ContainerInventory and NonImplementedFeatureTODO source types.Compressionint8
          3. 2Bit FlagsoptionalSource flags. Present only for WorldInteraction source type.CompressionEnum-as-ValueInventorySourceFlagsas varuint32
            1. 0No Flag
            2. 1World Interaction Random
        2. 1SlotThe slot index within the source container.Compressionvaruint32
        3. 2From ItemThe item descriptor representing the state of the slot before this action.NetworkItemStackDescriptor
        4. 3To ItemThe item descriptor representing the desired state of the slot after this action.NetworkItemStackDescriptor
    1InventoryMismatchDataInventoryMismatchData
    1. 0ActionsBase inventory actions. Lists the slot changes making up this server-to-client rejection transaction.InventoryTransaction
      1. 0ActionsList of inventory slot changes. Each action describes which container slot is changing and what the item descriptor transitions from and to.InventoryActionas array<InventoryAction>
        1. 0SourceThe inventory source identifying which container this action targets.InventorySource
          1. 0Source TypeThe inventory source type.CompressionEnum-as-ValueInventorySourceTypeas varuint32
            1. 0Container Inventory
            2. 1Global Inventory
            3. 2World Interaction
            4. 3Creative Inventory
            5. 99999Non Implemented Feature TODO
          2. 1Container IDoptionalContainer window ID. Present only for ContainerInventory and NonImplementedFeatureTODO source types.Compressionint8
          3. 2Bit FlagsoptionalSource flags. Present only for WorldInteraction source type.CompressionEnum-as-ValueInventorySourceFlagsas varuint32
            1. 0No Flag
            2. 1World Interaction Random
        2. 1SlotThe slot index within the source container.Compressionvaruint32
        3. 2From ItemThe item descriptor representing the state of the slot before this action.NetworkItemStackDescriptor
        4. 3To ItemThe item descriptor representing the desired state of the slot after this action.NetworkItemStackDescriptor
    2ItemUseInventoryTransactionItemUseInventoryTransaction
    1. 0ActionsBase inventory actions. Lists the inventory slot changes associated with this transaction.InventoryTransaction
      1. 0ActionsList of inventory slot changes. Each action describes which container slot is changing and what the item descriptor transitions from and to.InventoryActionas array<InventoryAction>
        1. 0SourceThe inventory source identifying which container this action targets.InventorySource
          1. 0Source TypeThe inventory source type.CompressionEnum-as-ValueInventorySourceTypeas varuint32
            1. 0Container Inventory
            2. 1Global Inventory
            3. 2World Interaction
            4. 3Creative Inventory
            5. 99999Non Implemented Feature TODO
          2. 1Container IDoptionalContainer window ID. Present only for ContainerInventory and NonImplementedFeatureTODO source types.Compressionint8
          3. 2Bit FlagsoptionalSource flags. Present only for WorldInteraction source type.CompressionEnum-as-ValueInventorySourceFlagsas varuint32
            1. 0No Flag
            2. 1World Interaction Random
        2. 1SlotThe slot index within the source container.Compressionvaruint32
        3. 2From ItemThe item descriptor representing the state of the slot before this action.NetworkItemStackDescriptor
        4. 3To ItemThe item descriptor representing the desired state of the slot after this action.NetworkItemStackDescriptor
    2. 1Action TypeThe type of item use action performed.CompressionEnum-as-ValueItemUseActionTypeas varint32
      1. 0Place
      2. 1Use
      3. 2Destroy
      4. 3Use As Attack
    3. 2Trigger TypePlayerInput if a direct result of the player's initial button input. SimulationTick if the player is holding down input from a previous tick.CompressionEnum-as-ValueItemUseTriggerTypeas uint8
      1. 0Unknown
      2. 1Player Input
      3. 2Simulation Tick
    4. 3PositionThe position of the target block.BlockPos
      1. 0XCompressionvarint32
      2. 1YCompressionvarint32
      3. 2ZCompressionvarint32
    5. 4FaceThe face of the target block that was clicked.Compressionuint8
    6. 5SlotThe inventory slot of the item being used.Compressionvarint32
    7. 6HandThe hand of the item being used.CompressionEnum-as-ValueHandSlotas uint8
      1. 0Mainhand
      2. 1Offhand
    8. 7ItemThe item stack descriptor of the item being used.NetworkItemStackDescriptor
    9. 8From PositionThe player's position when this transaction was sent.Vec3
    10. 9Click PositionThe position within the target block face that was clicked.Vec3
    11. 10Target Block IdThe runtime block state ID of the target block.Compressionvaruint32
    12. 11Client Interact PredictionWhether the client predicted the interaction would succeed.Enum-as-ValueItemUsePredictedResultas uint8
      1. 0Failure
      2. 1Success
    13. 12Client Cooldown StateWhether the item is currently on cooldown on the client.Enum-as-ValueItemUseClientCooldownStateas uint8
      1. 0Off
      2. 1On
    3ItemUseOnActorInventoryTransactionItemUseOnActorInventoryTransaction
    1. 0ActionsBase inventory actions. Lists the inventory slot changes associated with this transaction.InventoryTransaction
      1. 0ActionsList of inventory slot changes. Each action describes which container slot is changing and what the item descriptor transitions from and to.InventoryActionas array<InventoryAction>
        1. 0SourceThe inventory source identifying which container this action targets.InventorySource
          1. 0Source TypeThe inventory source type.CompressionEnum-as-ValueInventorySourceTypeas varuint32
            1. 0Container Inventory
            2. 1Global Inventory
            3. 2World Interaction
            4. 3Creative Inventory
            5. 99999Non Implemented Feature TODO
          2. 1Container IDoptionalContainer window ID. Present only for ContainerInventory and NonImplementedFeatureTODO source types.Compressionint8
          3. 2Bit FlagsoptionalSource flags. Present only for WorldInteraction source type.CompressionEnum-as-ValueInventorySourceFlagsas varuint32
            1. 0No Flag
            2. 1World Interaction Random
        2. 1SlotThe slot index within the source container.Compressionvaruint32
        3. 2From ItemThe item descriptor representing the state of the slot before this action.NetworkItemStackDescriptor
        4. 3To ItemThe item descriptor representing the desired state of the slot after this action.NetworkItemStackDescriptor
    2. 1Runtime IdThe runtime ID of the actor being interacted with or attacked.ActorRuntimeID
      1. 0Actor Runtime IDCompressionvaruint64
    3. 2Action TypeInteract: right-click on actor. Attack: left-click or trident spin attack.CompressionEnum-as-ValueItemUseOnActorActionTypeas varint32
      1. 0Interact
      2. 1Attack
      3. 2Item Interact
    4. 3SlotThe inventory slot of the item being used on the actor.Compressionvarint32
    5. 4HandThe hand of the item being used.CompressionEnum-as-ValueHandSlotas uint8
      1. 0Mainhand
      2. 1Offhand
    6. 5ItemThe item stack descriptor of the item being used on the actor.NetworkItemStackDescriptor
    7. 6From PositionThe player's position when this transaction was sent.Vec3
    8. 7Hit PositionThe position on the actor that was clicked.Vec3
    4ItemReleaseInventoryTransactionItemReleaseInventoryTransaction
    1. 0ActionsBase inventory actions. Lists the inventory slot changes associated with this transaction.InventoryTransaction
      1. 0ActionsList of inventory slot changes. Each action describes which container slot is changing and what the item descriptor transitions from and to.InventoryActionas array<InventoryAction>
        1. 0SourceThe inventory source identifying which container this action targets.InventorySource
          1. 0Source TypeThe inventory source type.CompressionEnum-as-ValueInventorySourceTypeas varuint32
            1. 0Container Inventory
            2. 1Global Inventory
            3. 2World Interaction
            4. 3Creative Inventory
            5. 99999Non Implemented Feature TODO
          2. 1Container IDoptionalContainer window ID. Present only for ContainerInventory and NonImplementedFeatureTODO source types.Compressionint8
          3. 2Bit FlagsoptionalSource flags. Present only for WorldInteraction source type.CompressionEnum-as-ValueInventorySourceFlagsas varuint32
            1. 0No Flag
            2. 1World Interaction Random
        2. 1SlotThe slot index within the source container.Compressionvaruint32
        3. 2From ItemThe item descriptor representing the state of the slot before this action.NetworkItemStackDescriptor
        4. 3To ItemThe item descriptor representing the desired state of the slot after this action.NetworkItemStackDescriptor
    2. 1Action TypeRelease: firing a bow or releasing a held item. Use: finishing charging a crossbow.CompressionEnum-as-ValueItemReleaseActionTypeas varint32
      1. 0Release
      2. 1Use
    3. 2SlotThe inventory slot of the item being released.Compressionvarint32
    4. 3ItemThe item stack descriptor of the item being released.NetworkItemStackDescriptor
    5. 4From PositionThe player's position when this transaction was sent.Vec3
    6. 5HandWhich hand the item being released is inCompressionEnum-as-ValueHandSlotas uint8
      1. 0Mainhand
      2. 1Offhand

Changelog

Stable releases

Changes between stable protocol releases.

Released
Protocol
2193

Packet

1 entry

Changed 1

InventoryTransactionPacket10 changes · ID 30