← Type index

ItemUseInventoryTransaction

Object datagramWire order
0ActionsInventoryTransaction · variable
1Action Typevarint32 · variable (up to 5 bytes)
2Trigger Typeuint8 · 1 byte
3PositionBlockPos · variable
4Faceuint8 · 1 byte
5Slotvarint32 · variable (up to 5 bytes)
6Handuint8 · 1 byte
7ItemNetworkItemStackDescriptor · variable
8From PositionVec3 · variable
9Click PositionVec3 · variable
10Target Block Idvaruint32 · variable (up to 5 bytes)
11Client Interact Predictionuint8 · 1 byte
12Client Cooldown Stateuint8 · 1 byte

Fields

13 top-level fields
  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

Packet references

2 references
  1. InventoryTransactionPacket
    Transaction › ItemUseInventoryTransaction › ItemUseInventoryTransaction
  2. PlayerAuthInputPacket
    Item Use Transaction › PackedItemUseLegacyInventoryTransaction › Item Use Transaction › ItemUseInventoryTransaction

Changelog

Stable releases

Changes between stable protocol releases.

Released
Protocol
2193

Changed 1

  • Added field Hand (type uint8).
  • Moved Item from field 6 to 7.
  • Moved From Position from field 7 to 8.
  • Moved Click Position from field 8 to 9.
  • Moved Target Block Id from field 9 to 10.
  • Moved Client Interact Prediction from field 10 to 11.
  • Moved Client Cooldown State from field 11 to 12.