Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Minecraft:Interaction

From SAS Gaming Wiki

Template:Work in progress Template:Exclusive Template:Infobox entity Interaction entities are a technical Minecraft:entity, useful for map or data pack creators to see who the last player to click on a certain spot is. They can only be created with the Template:Cmd or Template:Cmd commands. Interaction entities are invisible, invincible and of a custom size. Their Minecraft:bounding box can be viewed via the Template:Key + Template:Key debug shortcut.

Behavior

Interaction entities record the Minecraft:UUID of the last player that left-clicked and right-clicked them, and the time at which the interaction happened. If response is set to true, left-clicking an interaction entity plays a punching sound, and right-clicking it makes the player's arm swing.

Usage

You can check information on who last left-clicked and right-clicked on the interaction entity with the Template:Cmd command. This information can be useful in datapack and map creation. You can also change their size to match the area you want to be checked. Although there is seemingly no limit on the size that may be specified, there still appears to be an effective limit of 22.6 blocks in each dimension. Interactions and attacks will not be detected on the part of the hitbox beyond 3.3 blocks away from the entity's position (which is at the center of the hitbox) in the negative X and Z directions, and the same is true in the positive directions beyond 19.3 blocks away. In the Y direction, the bottom of the hitbox is always at the Y coordinate of the entity's position, so interactions and attacks are not detected beyond 22.6 blocks above the Y coordinate.

Advancement triggers

Commands

The interaction entity targets the player who last interacted with it. That makes the following possible:

  • Template:Cmd execute as the last player who attacked (left-clicked) the entity.
  • Template:Cmd execute as the last player who interacted with (right-clicked) the entity.

Data values

ID

Template:ID table

Entity data

Template:See also

Interaction entities have entity data associated with them that contain various properties of the Minecraft:entity.

<section begin="entity data"/>

  • Template:Nbt Entity data
    • Template:Nbt inherit/entity
    • Template:Nbt: The width of the entity's bounding box. Defaults to 1.
    • Template:Nbt: The height of the entity's bounding box. Defaults to 1.
    • Template:Nbt: 1 or 0 (true/false). Specifies whether an interaction should trigger a response (hand animation). Defaults to 0 (false).
    • Template:Nbt: The last attack (left click) to hit the entity.
      • Template:Nbt: The UUID of the player that attacked the entity. The 128-bit UUID is stored as four 32-bit integers, ordered from most to least significant.
      • Template:Nbt: When the attack took place.
    • Template:Nbt: The last interaction (right click) to hit the entity.
      • Template:Nbt: The UUID of the player that interacted with the entity. The 128-bit UUID is stored as four 32-bit integers, ordered from most to least significant.
      • Template:Nbt: When the interaction took place.

<section end="entity data"/>

History

Template:HistoryTable

Navigation

Template:Navbox entities

Minecraft:de:Interaktionsobjekt Minecraft:fr:Interaction Minecraft:ja:操作記録エンティティ Minecraft:lzh:交互 Minecraft:pt:Entidade-interação Minecraft:zh:交互实体 Minecraft:ru:Взаимодействие