← 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. 18RecipeFoodContainer
      20. 19RecipeBlocksContainer
      21. 20RecipeFurnaceItemsContainer
      22. 21RecipeSearchContainer
      23. 22RecipeSearchBarContainer
      24. 23RecipeEquipmentContainer
      25. 24RecipeBookContainer
      26. 25EnchantingInputContainer
      27. 26EnchantingMaterialContainer
      28. 27FurnaceFuelContainer
      29. 28FurnaceIngredientContainer
      30. 29FurnaceResultContainer
      31. 30HorseEquipContainer
      32. 31HotbarContainer
      33. 32InventoryContainer
      34. 33ShulkerBoxContainer
      35. 34TradeIngredient1Container
      36. 35TradeIngredient2Container
      37. 36TradeResultPreviewContainer
      38. 37OffhandContainer
      39. 38CompoundCreatorInput
      40. 39CompoundCreatorOutputPreview
      41. 40ElementConstructorOutputPreview
      42. 41MaterialReducerInput
      43. 42MaterialReducerOutput
      44. 43LabTableInput
      45. 44LoomInputContainer
      46. 45LoomDyeContainer
      47. 46LoomMaterialContainer
      48. 47LoomResultPreviewContainer
      49. 48BlastFurnaceIngredientContainer
      50. 49SmokerIngredientContainer
      51. 50Trade2Ingredient1Container
      52. 51Trade2Ingredient2Container
      53. 52Trade2ResultPreviewContainer
      54. 53GrindstoneInputContainer
      55. 54GrindstoneAdditionalContainer
      56. 55GrindstoneResultPreviewContainer
      57. 56StonecutterInputContainer
      58. 57StonecutterResultPreviewContainer
      59. 58CartographyInputContainer
      60. 59CartographyAdditionalContainer
      61. 60CartographyResultPreviewContainer
      62. 61BarrelContainer
      63. 62CursorContainer
      64. 63CreatedOutputContainer
      65. 64SmithingTableTemplateContainer
      66. 65CrafterLevelEntityContainer
      67. 66DynamicContainer
    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. 4Non 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. 4Non 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. 4Non 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. 4Non 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. 4ItemThe item stack descriptor of the item being used on the actor.NetworkItemStackDescriptor
    6. 5From PositionThe player's position when this transaction was sent.Vec3
    7. 6Hit 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. 4Non 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

Changelog

Stable releases

Changes between stable protocol releases.

Released
Protocol
2193

Packet

1 entry

Changed 1

InventoryTransactionPacket10 changes · ID 30