← All message topics  ·  schema ToolUsed/tool_used_event_message.json

header

FieldTypeRequiredAllowed valuesDescription
timestamp string
message_type string event
version string The message format version

msg

FieldTypeRequiredAllowed valuesDescription
experiment_id string
trial_id string
timestamp string
source string
sub_type string Event:ToolUsed
version string
replay_parent_type string|null TRIAL REPLAY null
replay_parent_id string|null
replay_id string|null

data

FieldTypeRequiredAllowed valuesDescription
mission_timer string
elapsed_milliseconds number
participant_id string
playername string
tool_type string MEDKIT STRETCHER STRETCHER_OCCUPIED HAMMER NULL
durability number
count number
target_block_x number
target_block_y number
target_block_z number
target_block_type string

Example message

{
"header": {
	"timestamp": "2019-12-26T12:47:23.1234Z",
	"message_type": "event",
	"version": "1.0"
	},
"msg": {
	"experiment_id": "123e4567-e89b-12d3-a456-426655440000", 
    "trial_id": "123e4567-e89b-12d3-a456-426655440000",
	"timestamp": "2019-12-26T14:05:02.1412Z",
	"source": "simulator",
	"sub_type": "Event:ToolUsed",
	"version": "1.1"},
"data": {
	"mission_timer":"8 : 36",
	"elapsed_milliseconds": 15113,
	"participant_id": "E000321",	
	"tool_type": "MEDKIT",
	"durability": 6,
	"count": 1,
	"target_block_x": -2180,
	"target_block_y": 64,
	"target_block_z": 128,
	"target_block_type": "minecraft:gravel"
	}
}
Raw JSON Schema (resolved)
{
  "$id": "https://gitlab-external.aptima.com/adapt/testbed/MessageSpecs/ToolUsed/tool_used_event_message.json",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "definitions": {},
  "properties": {
    "data": {
      "$id": "#/properties/data",
      "properties": {
        "count": {
          "$id": "#/properties/data/properties/count",
          "examples": [
            1
          ],
          "pattern": "^([0-9]+?)$",
          "title": "The Count Schema",
          "type": "number"
        },
        "durability": {
          "$id": "#/properties/data/properties/durability",
          "examples": [
            10
          ],
          "pattern": "^([0-9]+?)$",
          "title": "The Durability Schema",
          "type": "number"
        },
        "elapsed_milliseconds": {
          "$id": "#/properties/event/state/elapsed_milliseconds",
          "examples": [
            5000,
            77459,
            689457
          ],
          "pattern": "^[0-9]+$",
          "title": "The Elapsed Milliseconds Schema",
          "type": "number"
        },
        "mission_timer": {
          "$id": "#/properties/data/properties/mission_timer",
          "examples": [
            "8 : 36"
          ],
          "pattern": "^(.*)$",
          "title": "The Mission Timer Schema",
          "type": "string"
        },
        "participant_id": {
          "$id": "#/properties/data/properties/participant_id",
          "examples": [
            "E000321"
          ],
          "pattern": "^(.*)$",
          "title": "The Participant id Schema",
          "type": "string"
        },
        "playername": {
          "$id": "#/properties/data/properties/playername",
          "examples": [
            "Aptiminer1"
          ],
          "pattern": "^(.*)$",
          "title": "The PlayerName Schema",
          "type": "string"
        },
        "target_block_type": {
          "$id": "#/properties/data/properties/target_block_type",
          "examples": [
            "minecraft:gravel",
            "asistmod:block_victim_1",
            "asistmod:block_victim_2",
            "asistmod:block_victim_1b"
          ],
          "pattern": "^(.*)$",
          "title": "The Target_Block_Type Schema",
          "type": "string"
        },
        "target_block_x": {
          "$id": "#/properties/data/properties/target_block_x",
          "examples": [
            -2185
          ],
          "pattern": "^([0-9]+?)$",
          "title": "The Target_Block_X Schema",
          "type": "number"
        },
        "target_block_y": {
          "$id": "#/properties/data/properties/target_block_y",
          "examples": [
            52
          ],
          "pattern": "^([0-9]+?)$",
          "title": "The Target_Block_Y Schema",
          "type": "number"
        },
        "target_block_z": {
          "$id": "#/properties/data/properties/target_block_z",
          "examples": [
            194
          ],
          "pattern": "^([0-9]+?)$",
          "title": "The Target_Block_Z Schema",
          "type": "number"
        },
        "tool_type": {
          "$id": "#/properties/data/properties/tool_type",
          "enum": [
            "MEDKIT",
            "STRETCHER",
            "STRETCHER_OCCUPIED",
            "HAMMER",
            "NULL"
          ],
          "examples": [
            "MEDKIT"
          ],
          "title": "The Tool_Type Schema",
          "type": "string"
        }
      },
      "required": [
        "mission_timer",
        "elapsed_milliseconds",
        "participant_id",
        "tool_type",
        "durability",
        "count",
        "target_block_x",
        "target_block_y",
        "target_block_z",
        "target_block_type"
      ],
      "title": "The Tool Used Data Schema",
      "type": "object"
    },
    "header": {
      "$id": "http://asist.aptima.com/schemas/common_header.json",
      "$schema": "http://json-schema.org/draft-07/schema#",
      "definitions": {},
      "properties": {
        "message_type": {
          "$id": "#/properties/message_type",
          "const": "event",
          "enum": [
            "control",
            "observation",
            "chat",
            "status",
            "trial",
            "event",
            "groundtruth",
            "experiment",
            "metadata",
            "agent"
          ],
          "examples": [
            "observation"
          ],
          "pattern": "^([a-z_]*?)$",
          "title": "The Message_type Schema",
          "type": "string"
        },
        "timestamp": {
          "$id": "#/properties/timestamp",
          "examples": [
            "2019-12-26T12:47:23.1234Z"
          ],
          "pattern": "[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}[.]?[0-9]{0,}?Z",
          "title": "The Timestamp Schema",
          "type": "string"
        },
        "version": {
          "$id": "#/properties/version",
          "examples": [
            "1.0",
            "2.3.1"
          ],
          "pattern": "^([0-9]+\\.)?([0-9]+\\.)?([0-9]+)$",
          "title": "The message format version",
          "type": "string"
        }
      },
      "required": [
        "timestamp",
        "message_type",
        "version"
      ],
      "title": "ASIST message common header Schema",
      "type": "object",
      "version": "0.3"
    },
    "msg": {
      "$id": "http://asist.aptima.com/schemas/event_message.json",
      "$schema": "http://json-schema.org/draft-07/schema#",
      "definitions": {},
      "properties": {
        "experiment_id": {
          "$id": "#/properties/experiment_id",
          "default": "",
          "examples": [
            "123e4567-e89b-12d3-a456-426655440000"
          ],
          "pattern": "(([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})|Not Set|Null|null)",
          "title": "The Experiment Id Schema",
          "type": "string"
        },
        "replay_id": {
          "$id": "#/properties/replay_id",
          "default": "",
          "examples": [
            "123e4567-e89b-12d3-a456-426655440000"
          ],
          "pattern": "(([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})|Not Set|null|Null)",
          "title": "The Replay Id Schema",
          "type": [
            "string",
            "null"
          ]
        },
        "replay_parent_id": {
          "$id": "#/properties/replay_parent_id",
          "default": "",
          "examples": [
            "123e4567-e89b-12d3-a456-426655440000"
          ],
          "pattern": "(([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})|Not Set|null|Null)",
          "title": "The Replay Parent Id Schema",
          "type": [
            "string",
            "null"
          ]
        },
        "replay_parent_type": {
          "$id": "#/properties/replay_parent_type",
          "enum": [
            "TRIAL",
            "REPLAY",
            null
          ],
          "title": "The Replay Parent Type Schema",
          "type": [
            "string",
            "null"
          ]
        },
        "source": {
          "$id": "#/properties/source",
          "default": "",
          "examples": [
            "simulator"
          ],
          "pattern": "^(.*)$",
          "title": "The Source Schema",
          "type": "string"
        },
        "sub_type": {
          "$id": "#/properties/sub_type",
          "const": "Event:ToolUsed",
          "default": "",
          "examples": [
            "equip",
            "triage"
          ],
          "pattern": "^([a-zA-Z0-9_:]*?)$",
          "title": "The Sub Type Schema",
          "type": "string"
        },
        "timestamp": {
          "$id": "#/properties/timestamp",
          "default": "",
          "examples": [
            "2019-12-26T14:05:02.3412Z"
          ],
          "pattern": "[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}[.]?[0-9]{0,}?Z",
          "title": "The Timestamp Schema",
          "type": "string"
        },
        "trial_id": {
          "$id": "#/properties/trial_id",
          "default": "",
          "examples": [
            "123e4567-e89b-12d3-a456-426655440000"
          ],
          "pattern": "(([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})|Not Set|null|Null)",
          "title": "The Trial Id Schema",
          "type": "string"
        },
        "version": {
          "$id": "#/properties/version",
          "default": "",
          "examples": [
            "0.1",
            "1.0.1"
          ],
          "pattern": "^([.]*)|(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$",
          "title": "The Version Schema",
          "type": "string"
        }
      },
      "required": [
        "experiment_id",
        "timestamp",
        "source",
        "sub_type",
        "version"
      ],
      "title": "The Event Message Schema",
      "type": "object",
      "version": "0.5"
    }
  },
  "required": [
    "header",
    "msg",
    "data"
  ],
  "title": "The Tool Used Event Schema",
  "type": "object",
  "version": "1.1"
}
Upstream spec documentation

Data Subtype: Event Message Format

This data message subtype is used to communicate event data for both the world and the player.

TOPIC

observations/events/player/tool_used

Message Fields

Field Name Type Description
header object From Common Message Format section
msg object From the Common Event Message Format section
data.mission_timer string the mission time of the event
data.elapsed_milliseconds number the number of elapsed milliseconds since mission start
data.participant_id string the participant id for the player being reported
data.playername string [Deprecated]The name of the entity that changed state
data.tool_type string The type of tool being used. From ENUM --> [ "Shovel", "Med_Kit" ]
data.durability number The number of uses (hits) left in the tool
data.count number The number of tools of this type in the inventory
data.target_block_x number The X Position of the block being hit
data.target_block_y number The Y Position of the block being hit
data.target_block_z number The Z Position of the block being hit
data.target_block_type string A string representation of a blocktype defined by Minecraft such as Gravel, Clay, Air, or a blocktype defined by the AdaptMod such as Victim Block 1 (Green), Victim Block 2 (Yellow)

Message Example

{
"header": {
    "timestamp": "2019-12-26T12:47:23.1234Z",
    "message_type": "event",
    "version": "1.0"
    },
"msg": {
    "experiment_id": "123e4567-e89b-12d3-a456-426655440000", 
    "trial_id": "123e4567-e89b-12d3-a456-426655440000",
    "timestamp": "2019-12-26T14:05:02.1412Z",
    "source": "simulator",
    "sub_type": "Event:ToolUsed",
    "version": "1.1"},
"data": {
    "mission_timer":"8 : 36",
    "elapsed_milliseconds": 15113,
    "participant_id": "E000321",    
    "tool_type": "MEDKIT",
    "durability": 6,
    "count": 1,
    "target_block_x": -2180,
    "target_block_y": 64,
    "target_block_z": 128,
    "target_block_type": "minecraft:gravel"
    }
}

CHANGE HISTORY

VERSION | DATE | DETAILS | --- | --- | --- | 1.1 | 8/13/2021 | deprecated playername and added participant_id 1.0 | 3/5/2021 | Standardized tool_type enum field to Upper Case tools for all 3 roles. Changed target block type to use registry name instead of localized name, changed count to be a number instead of a string 0.5 | 1/26/2021 | Initial state when ported from ADAPT project