Advancement/JSON format

Custom advancements in data packs of a *Minecraft* world store the advancement data for that world as separate JSON files.

## File format

All advancement JSON files are structured according to the following format.

### Legend

* **\***: If parent field is written, this field is required.

* The root tag.
	+ display: Data related to the advancement's display.
		- icon**\***: Object containing data for the advancement's icon.
			* item**\***: The item's ID.
			* nbt: A string containing SNBT that may modify the item's appearance on the icon.
		- title**\***: A JSON text component for the title of this advancement.
		- frame: Type of frame for the icon. `challenge` for , `goal` for , `task` for . Defaults to `task`.
		- background: The directory for the background to use in this advancement tab (used only for the root advancement).
		- description**\***: A JSON text component for the description text of this advancement.
		- show\_toast: Whether to show a toast to the player when this advancement has been completed. Defaults to `true`.
		- announce\_to\_chat: Whether to announce in the chat when this advancement has been completed. Defaults to `true`.
		- hidden: Whether to hide this advancement and all its children from the advancement screen until this advancement have been completed. Has no effect on root advancements themselves, but still affects all their children. Defaults to `false`.
	+ parent: The parent advancement directory of this advancement. If absent, this advancement is a root advancement. Circular references cause a loading failure.
	+ criteria**\***: The criteria to be tracked by this advancement.
		- <criterionName>: The key is a unique name given to the criterion.
			* See below for details.
	+ requirements: Defines how these criteria above are completed to grant the advancement. Contains sublists, which in turn contain names of criteria from this advancement (all the `<criterionName>`s). When a criterion is newly completed or revoked, the advancement is granted if all sublists have at least one criterion within them completed. Optional, defaults to requiring all criteria completed.
		- Sublist within  requirements, contains strings of `<criterionName>`s. If a sublist is empty, the advancement is unachievable without cheats.
			* A criterion name.
	+ rewards: An object representing the rewards provided when this advancement is obtained.
		- recipes: To unlock recipes.
			* The resource location of a recipe.
		- loot: To give items from loot tables to the player.
			* The resource location of a loot table.
		- experience: To give an amount of experience. Defaults to 0.
		- function: To run a function. Function tags are not allowed.
	+ sends\_telemetry\_event: Determines whether telemetry data should be collected when this advancement is achieved or not. Defaults to false.

## Display

Within the root tag of an advancement JSON object, the  display object and the  parent string, both optional, are related to the display of the advancement.

If the  display tag is present, it must have the  title,  description and  icon fields present in order to be considered as valid advancement display data.

The  parent field, albeit not directly associated with the display data of an advancement, affects only the display data effectively. When an advancement does not have a display data and none of its children has a display data, the parent of the advancement only affects `/advancement ... through|from|until` usage.

### Advancement tabs

Creating a root advancement (no  parent) with valid  display data automatically creates a tab in the advancement menu. When loaded, the root advancement shows as a tab in the menu when any advancement in its advancement tree is granted to the player viewing the menu.

The missing texture displays on the tab's background if the root advancement does not have a background.

If a root advancement successfully creates a tab, child advancements of the root will show inside of that tab, provided they also have valid  display data.

### Positioning

The game automatically arranges advancements, positions them when it loads advancements from data packs, and sends the arrangement to the client. Each advancement has an arrow from its closest visible ancestor (i.e. if its parent does not have a display, it has a link from its grandparent, and so on). The root advancement appears on the leftmost column while each arrow points to an advancement in the next column. The arrangement of advancements within a column is based on file name.

### Lack of display

Some advancements, such as the vanilla recipe unlocking advancements, may lack a display so that they can utilize triggers and rewards instead of excessive commands or functions for more functionalities and a more flexible control. These advancements should not have the  display field defined in order to hide from users and enjoy a better loading performance.

## Criteria

* **\***: If parent field is written, this field is required.

The format of a criterion:

* <criterionName>: Root object.
	+ trigger**\***: The trigger for this criterion.
	+ conditions: Object containing conditions that need to be met when the trigger gets activated. The criterion is marked completed when the trigger activates and all conditions passed.
		- player: Checks properties of the player that would get the advancement. Not available for `minecraft:impossible` trigger.
			* All possible conditions for entities
		- player: Another format for "player". Specifies a list of predicates that must pass in order for the criterion to be granted. Not available for `minecraft:impossible` trigger.
			* : A single predicate.
		- Extra contents depend on selected  trigger.

## List of triggers

All JSON fields in the conditions are optional unless marked with "**\***".

The possible values for  trigger and associated extra contents in  conditions:

### minecraft:allay\_drop\_item\_on\_block

Triggers when an allay drops an item on a block. Available extra conditions:

* conditions:
	+ location: Specifies a list of predicates that must pass in order for the criterion to be granted. The origin is the location of the block the item was dropped on, the block state belongs to that block, and the tool is the item dropped on the block. The `this` entity is the player that would get the advancement.
		- : A single predicate.

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:allay\_drop\_item\_on\_block",
 "conditions": {
 "location": {
 "biome": "minecraft:meadow",
 "block": {
 "blocks": [
 "minecraft:note\_block"
 ]
 }
 },
 "item": {
 "items": [
 "minecraft:cookie"
 ]
 }
 }
 }
 }
}

```

### minecraft:avoid\_vibration

Triggers when a vibration event is ignored because the source player is crouching. No extra conditions.

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:avoid\_vibration",
 "conditions": {
 "player": {
 "location": {
 "biome": "minecraft:deep\_dark"
 }
 }
 }
 }
 }
}

```

### minecraft:bee\_nest\_destroyed

Triggers when the player breaks a bee nest or beehive. Available extra conditions:

* conditions:
	+ block: Checks the block that was destroyed. Accepts block IDs.
	+ item: The item used to break the block.
		- All possible conditions for items
	+ num\_bees\_inside: The number of bees that were inside the bee nest/beehive before it was broken.
		- num\_bees\_inside: Another form for  num\_bees\_inside.
			* max: The maximum value.
			* min: The minimum value.

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:bee\_nest\_destroyed",
 "conditions": {
 "block": "minecraft:beehive",
 "item": {
 "items": [
 "minecraft:wooden\_axe"
 ]
 },
 "num\_bees\_inside": 3
 }
 }
 }
}

```

### minecraft:bred\_animals

Triggers after the player breeds 2 animals. Available extra conditions:

* conditions:
	+ child: Checks properties of the child that results from the breeding.
		- All possible conditions for entities
	+ child: Another format for "child". Specifies a list of predicates that must pass in order for the criterion to be granted. The origin of the predicate is the position of the player that would get the advancement.
		- : A single predicate.
	+ parent: The parent.
		- All possible conditions for entities
	+ parent: Another format for "parent". Specifies a list of predicates that must pass in order for the criterion to be granted. The origin of the predicate is the position of the player that would get the advancement.
		- : A single predicate.
	+ partner: The partner (The entity the parent was bred with).
		- All possible conditions for entities
	+ partner: Another format for "partner". Specifies a list of predicates that must pass in order for the criterion to be granted. The origin of the predicate is the position of the player that would get the advancement.
		- : A single predicate.

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:bred\_animals",
 "conditions": {
 "child": {
 "type": "minecraft:mule"
 },
 "parent": {
 "location": {
 "biome": "minecraft:beach"
 }
 },
 "partner": {
 "effects": {
 "minecraft:speed": {
 "amplifier": {
 "min": 2
 }
 }
 }
 }
 }
 }
 }
}

```

### minecraft:brewed\_potion

Triggers after the player takes any item out of a brewing stand. Available extra conditions:

* conditions:
	+ potion: A brewed potion ID.

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:brewed\_potion",
 "conditions": {
 "potion": "minecraft:strong\_swiftness"
 }
 }
 }
}

```

### minecraft:changed\_dimension

Triggers after the player travels between two dimensions. Available extra conditions:

* conditions:
	+ from: The dimension the entity traveled from. This tag is a resource location for a dimension (only these in vanilla; more can be added with data packs).
	+ to: The dimension the entity traveled to. Same accepted values as above.

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:changed\_dimension",
 "conditions": {
 "from": "minecraft:the\_end",
 "to": "minecraft:overworld"
 }
 }
 }
}

```

### minecraft:channeled\_lightning

Triggers after the player successfully uses the Channeling enchantment on an entity or a lightning rod. Available extra conditions:

* conditions:
	+ victims: The victims hit by the lightning summoned by the Channeling enchantment. All entities in this list must be hit.
		- : A victim.
			* All possible conditions for entities
		- : Another format for the victim. Specifies a list of predicates that must pass in order for the criterion to be granted. The checks are applied to the victim hit by the lighting, with the origin being the position of the player that would get the advancement.
			* : A single predicate.

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:channeled\_lightning",
 "conditions": {
 "victims": [
 {
 "type": "minecraft:skeleton\_horse",
 "nbt": "{SkeletonTrap: true}"
 }
 ]
 }
 }
 }
}

```

### minecraft:construct\_beacon

Triggers after the player changes the structure of a beacon. (When the beacon updates itself). Available extra conditions:

* conditions:
	+ level: The level of the updated beacon structure.
	+ level: Another format.
		- max: The maximum value.
		- min: The minimum value.

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:construct\_beacon",
 "conditions": {
 "level": {
 "min": 3
 }
 }
 }
 }
}

```

### minecraft:consume\_item

Triggers when the player consumes an item. Available extra conditions:

* conditions:
	+ item: The item that was consumed.
		- All possible conditions for items

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:consume\_item",
 "conditions": {
 "item": {
 "items": [
 "minecraft:enchanted\_golden\_apple"
 ],
 "nbt": "{display:{Name:\"Example\"}}"
 }
 }
 }
 }
}

```

### minecraft:cured\_zombie\_villager

Triggers when the player cures a zombie villager. Available extra conditions:

* conditions:
	+ villager: The villager that is the result of the conversion. The 'type' tag is redundant since it will always be "villager".
		- All possible conditions for entities
	+ villager: Another format for "villager". Specifies a list of predicates that must pass in order for the criterion to be granted. The checks are applied to the villager, with the origin being the position of the player that would get the advancement.
		- : A single predicate.
	+ zombie: The zombie villager right before the conversion is complete (not when it is initiated). The 'type' tag is redundant since it will always be "zombie\_villager".
		- All possible conditions for entities
	+ zombie: Another format for "zombie". Specifies a list of predicates that must pass in order for the criterion to be granted. The checks are applied to the zombie villager, with the origin being the position of the player that would get the advancement.
		- : A single predicate.

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:cured\_zombie\_villager",
 "conditions": {
 "villager": {
 "location": {
 "biome": "minecraft:plains"
 }
 },
 "zombie": {
 "distance": { //Checks the distance from zombie villager to the player.
 "horizontal": {
 "max": 10
 }
 }
 }
 }
 }
 }
}

```

### minecraft:effects\_changed

Triggers after the player gets a status effect applied or taken from them. Available extra conditions:

* conditions:
	+ effects: A list of active status effects the player currently has.
		- <minecraft:effect\_name>: The key name is a status effect name.
			* ambient: Whether the effect is from a beacon.
			* amplifier: The effect amplifier.
			* amplifier: Another format.
				+ max: The maximum value.
				+ min: The minimum value.
			* duration: The effect duration in ticks.
			* duration: Another format.
				+ max: The maximum value.
				+ min: The minimum value.
			* visible: Whether the effect has visible particles.
	+ source: The entity that was the source of the status effect. When there is no entity or when the effect was self-applied or removed, the test passes only if the source is not specified.
		- All possible conditions for entities
	+ source: Another format for "source". Specifies a list of predicates that must pass in order for the criterion to be granted. The checks are applied to the source, with the origin being the position of the player that would get the advancement.
		- : A single predicate.

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:effects\_changed",
 "conditions": {
 "effects": {
 "minecraft:weakness": {},
 "minecraft:slowness": {
 "amplifier": 2,
 "duration": {
 "min": 100,
 "max": 500
 }
 }
 }
 }
 }
 }
}

```

### minecraft:enchanted\_item

Triggers after the player enchants an item through an enchanting table (does not get triggered through an anvil, or through commands). Available extra conditions:

* conditions:
	+ item: The item after it has been enchanted.
		- All possible conditions for items
	+ levels: The levels spent by the player on the enchantment.
	+ levels: Another format.
		- max: The maximum value.
		- min: The minimum value.

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:enchanted\_item",
 "conditions": {
 "item": {
 "items": [
 "minecraft:wooden\_sword"
 ],
 "enchantments": [
 {
 "enchantment": "minecraft:sharpness",
 "levels": {
 "min": 2
 }
 }
 ]
 },
 "levels": {
 "min": 3
 }
 }
 }
 }
}

```

### minecraft:enter\_block

Every tick, triggers once for each block the player's hitbox is inside (up to 12 blocks, the maximum number of blocks the player can stand in). Available extra conditions:

* conditions:
	+ block: The block that the player is standing in. Accepts block IDs.
	+ state: A map of block property names to values. Errors if the block doesn't have these properties.
		- *key*: Block property key and value pair.
		- *key*: Another format.
			* max: A maximum value.
			* min: A minimum value.

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:enter\_block",
 "conditions": {
 "block": "minecraft:rose\_bush",
 "state": {
 "half": "lower"
 }
 }
 }
 }
}

```

### minecraft:entity\_hurt\_player

Triggers after a player gets hurt (even when it's not caused by an entity). Available extra conditions:

* conditions:
	+ damage: Checks the damage done to the player.
		- Damage tags

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:entity\_hurt\_player",
 "conditions": {
 "damage": {
 "type": {
 "source\_entity": {
 "type": "minecraft:skeleton"
 },
 "direct\_entity": {
 "type": "minecraft:arrow"
 }
 },
 "taken": {
 "min": 4.0
 }
 }
 }
 }
 }
}

```

### minecraft:entity\_killed\_player

Triggers after a living entity kills a player. Available extra conditions:

* conditions:
	+ entity: Checks the entity that was the source of the damage that killed the player (for example: The skeleton that shot the arrow).
		- All possible conditions for entities
	+ entity: Another format for "entity". Specifies a list of predicates that must pass in order for the criterion to be granted. The checks are applied to the entity that kills the player, with the origin being the position of the player that would get the advancement.
		- : A single predicate.
	+ killing\_blow: Checks the type of damage that killed the player.
		- Tags common to all damage types

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:entity\_killed\_player",
 "conditions": {
 "entity": {
 "type": "minecraft:skeleton"
 },
 "killing\_blow": {
 "is\_projectile": true
 }
 }
 }
 }
}

```

### minecraft:fall\_from\_height

Triggers when a player lands after falling. Available extra conditions:

* conditions:
	+ start\_position: A location predicate for the last position before the falling started.
		- Tags common to all locations
	+ distance: The distance between the start position and the player's position.
		- Distance predicate tags

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:fall\_from\_height",
 "conditions": {
 "start\_position": {
 "position": {
 "y": {
 "min": -13,
 "max": 256
 }
 }
 },
 "distance": {
 "y": {
 "min": 50,
 "max": 320
 }
 }
 }
 }
 }
}

```

### minecraft:filled\_bucket

Triggers after the player fills a bucket. Available extra conditions:

* conditions:
	+ item: The item resulting from filling the bucket.
		- All possible conditions for items

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:filled\_bucket",
 "conditions": {
 "item": {
 "items": [
 "minecraft:lava\_bucket"
 ]
 }
 }
 }
 }
}

```

### minecraft:fishing\_rod\_hooked

Triggers after the player successfully catches an item with a fishing rod or pulls an entity with a fishing rod. Available extra conditions:

* conditions:
	+ entity: The entity that was pulled, or the fishing bobber if no entity is pulled.
		- All possible conditions for entities
	+ entity: Another format for "entity". Specifies a list of predicates that must pass in order for the criterion to be granted. The checks are applied to the entity pulled or the bobber, with the origin being the position of the player that would get the advancement.
		- : A single predicate.
	+ item: The item that was caught.
		- All possible conditions for items
	+ rod: The fishing rod used.
		- All possible conditions for items

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:fishing\_rod\_hooked",
 "conditions": {
 "item": {
 "items": [
 "minecraft:bamboo"
 ]
 }
 }
 }
 }
}

```

### minecraft:hero\_of\_the\_village

Triggers when a raid ends in victory and the player has attacked at least one raider from that raid. No extra conditions.

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:hero\_of\_the\_village",
 "conditions": {
 "player":{
 "location": {
 "biome": "minecraft:plains",
 "dimension": "minecraft:overworld",
 "position": {
 "z": {
 "min": -10,
 "max": 10
 }
 }
 }
 }
 }
 }
 }
}

```

### minecraft:impossible

Never triggers. No available conditions.

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:impossible"
 }
 }
}

```

### minecraft:inventory\_changed

Triggers after any changes happen to the player's inventory. Available extra conditions:

* conditions:
	+ items: A list of items in the player's inventory. All items in the list must be in the player's inventory, but not all items in the player's inventory have to be in this list.
		- : An item stack.
			* All possible conditions for items
	+ slots:
		- empty: The amount of slots empty in the inventory.
		- empty: Another format.
			* max: The maximum value.
			* min: The minimum value.
		- full: The amount of slots completely filled (stacksize) in the inventory.
		- full: Another format.
			* max: The maximum value.
			* min: The minimum value.
		- occupied: The amount of slots occupied in the inventory.
		- occupied: Another format.
			* max: The maximum value.
			* min: The minimum value.

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:inventory\_changed",
 "conditions": {
 "items": [
 {
 "items": [
 "minecraft:polished\_granite"
 ],
 "count": {
 "min": 5,
 "max": 10
 }
 },
 {
 "items": [
 "minecraft:lime\_wool"
 ]
 },
 {
 "items": [
 "minecraft:wooden\_sword"
 ],
 "durability": {
 "min": 50
 },
 "nbt": "{display:{Name:\"Example\"}}"
 }
 ],
 "slots": {
 "occupied": 3
 }
 }
 }
 }
}

```

### minecraft:item\_durability\_changed

Triggers after any item in the inventory has been damaged in any form. Available extra conditions:

* conditions:
	+ delta: The change in durability (negative numbers are used to indicate a decrease in durability).
	+ delta: Another format.
		- max: The maximum value.
		- min: The minimum value.
	+ durability: The remaining durability of the item.
	+ durability: Another format.
		- max: The maximum value.
		- min: The minimum value.
	+ item: The item before it was damaged, allows you to check the durability before the item was damaged.
		- All possible conditions for items

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:item\_durability\_changed",
 "conditions": {
 "delta": -2,
 "item": {
 "items": [
 "minecraft:wooden\_axe"
 ],
 "durability": {
 "max": 1
 }
 }
 }
 }
 }
}

```

### minecraft:item\_used\_on\_block

Triggers when the player uses their hand or an item on a block. Available extra conditions:

* conditions:
	+ location: Specifies a list of predicates that must pass in order for the criterion to be granted. The origin is the location of the block the item was used on, the block state belongs to that block, and the tool is the item used on the block. The `this` entity is the player that would get the advancement.
		- : A single predicate.

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:item\_used\_on\_block",
 "conditions": {
 "location": [
 {
 "condition": "minecraft:match\_tool",
 "predicate": {
 "items": [
 "minecraft:glow\_ink\_sac"
 ]
 }
 },
 {
 "condition": "minecraft:location\_check",
 "predicate": {
 "block": {
 "tag": "minecraft:all\_signs"
 }
 }
 }
 ]
 }
 }
 }
}

```

### minecraft:kill\_mob\_near\_sculk\_catalyst

Triggers after a player is the source of a mob or player being killed within the range of a sculk catalyst. Available extra conditions:

* conditions:
	+ entity: The entity that was killed.
		- All possible conditions for entities
	+ entity: Another format for "entity". Specifies a list of predicates that must pass in order for the criterion to be granted. The checks are applied to the mob, with the origin being the position of the player that would get the advancement.
		- : A single predicate.
	+ killing\_blow: The type of damage that killed an entity.
		- Tags common to all damage types

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:kill\_mob\_near\_sculk\_catalyst",
 "conditions": {
 "entity": {
 "type": "minecraft:creeper",
 "nbt": "{powered:1b}",
 "location": {
 "biome": "minecraft:the\_void"
 },
 "effects": {
 "minecraft:slowness": {},
 "minecraft:weakness": {
 "amplifier": {
 "min": 2
 }
 }
 }
 },
 "killing\_blow": {
 "source\_entity": {
 "nbt": "{SelectedItem:{id:\"minecraft:wooden\_sword\"}}"
 }
 }
 }
 }
 }
}

```

### minecraft:killed\_by\_crossbow

Triggers after the player kills a mob or player using a crossbow in ranged combat. Available extra conditions:

* conditions:
	+ unique\_entity\_types: The exact count of types of entities killed.
	+ unique\_entity\_types: Another format. The acceptable range of count of types of entities killed.
		- max: The maximum value.
		- min: The minimum value.
	+ victims: A list of victims. All of the entries must be matched, and one killed entity may match only one entry.
		- : A killed entities.
			* All possible conditions for entities
		- : Another format for the victim. Specifies a list of predicates that must pass in order for the criterion to be granted. The checks are applied to the victim, with the origin being the position of the player that would get the advancement.
			* : A single predicate.

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:killed\_by\_crossbow",
 "conditions": {
 "victims": [
 {
 "type": "minecraft:phantom"
 },
 {
 "type": "minecraft:phantom"
 }
 ],
 "unique\_entity\_types": 5
 }
 }
 }
}

```

### minecraft:levitation

Triggers when the player has the levitation status effect. Available extra conditions:

* conditions:
	+ distance: The distance between the position where the player started levitating and the player's current position.
		- Distance predicate tags
	+ duration: The duration of the levitation in ticks.
	+ duration: Another format.
		- max: The maximum value.
		- min: The minimum value.

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:levitation",
 "conditions": {
 "distance": {
 "horizontal": {
 "min": 5
 },
 "y": {
 "min": 2
 }
 },
 "duration": {
 "min": 100
 }
 }
 }
 }
}

```

### minecraft:lightning\_strike

Triggers when a lightning bolt disappears from the world, only for players within a 256 block radius of the lightning bolt. Available extra conditions:

* conditions:
	+ lightning: The lightning bolt that disappeared.
		- All possible conditions for entities
	+ lightning: Another format for "lightning". Specifies a list of predicates that must pass in order for the criterion to be granted. The checks are applied to the lightning, with the origin being the position of the player that would get the advancement.
		- : A single predicate.
	+ bystander: An entity not hurt by the lightning strike but in a certain area around it.
		- All possible conditions for entities
	+ bystander: Another format for "bystander". Specifies a list of predicates that must pass in order for the criterion to be granted. The checks are applied to the bystander, with the origin being the position of the player that would get the advancement.
		- : A single predicate.

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:lightning\_strike",
 "conditions": {
 "lightning": [
 {
 "condition": "minecraft:entity\_properties",
 "entity": "this",
 "predicate": {
 "lightning\_bolt": {
 "entity\_struck": {
 "type": "minecraft:creeper"
 }
 }
 }
 }
 ],
 "bystander": [
 {
 "condition": "minecraft:entity\_properties",
 "entity": "this",
 "predicate": {
 "type": "minecraft:pig"
 }
 }
 ]
 }
 }
 }
}

```

### minecraft:location

Triggers every 20 ticks (1 second). No extra conditions.

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:location",
 "conditions": {
 "player": {
 "location": {
 "position": {
 "x": {
 "min": -10,
 "max": 10
 }
 },
 "biome": "minecraft:jungle",
 "structure": "minecraft:jungle\_pyramid",
 "dimension": "minecraft:overworld"
 }
 }
 }
 }
 }
}

```

### minecraft:nether\_travel

Triggers when the player travels to the Nether and then returns to the Overworld. Available extra conditions:

* conditions:
	+ start\_position: A location predicate for the last position before the player teleported to the Nether.
		- Tags common to all locations
	+ distance: The distance between the position where the player teleported to the Nether and the player's position when they returned.
		- Distance predicate tags

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:nether\_travel",
 "conditions": {
 "distance": {
 "horizontal": {
 "min": 1000
 },
 "absolute": {
 "min": 1100
 }
 }
 }
 }
 }
}

```

### minecraft:placed\_block

Triggers when the player places a block. Available extra conditions:

* conditions:
	+ location: Specifies a list of predicates that must pass in order for the criterion to be granted. The origin is the location of the block placed, the block state belongs to that block, and the tool is the item used to place the block. The `this` entity is the player that would get the advancement.
		- : A single predicate.

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:placed\_block",
 "conditions": {
 "block": "minecraft:wall\_torch",
 "state": {
 "facing": "west"
 },
 "location": {
 "position": {
 "x": 10,
 "z": 14
 },
 "biome": "minecraft:plains"
 },
 "item": {
 "items": [
 "minecraft:torch"
 ]
 }
 }
 }
 }
}

```

### minecraft:player\_generates\_container\_loot

Triggers when the player generates the contents of a container with a loot table set. Available extra conditions:

* conditions:
	+ loot\_table**\***: The resource location of the generated loot table.

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:player\_generates\_container\_loot",
 "conditions": {
 "loot\_table": "minecraft:chests/jungle\_temple\_dispenser"
 }
 }
 }
}

```

### minecraft:player\_hurt\_entity

Triggers after the player hurts a mob or player. Available extra conditions:

* conditions:
	+ damage: The damage that was dealt.
		- Damage tags
	+ entity: The entity that was damaged.
		- All possible conditions for entities
	+ entity: Another format for "entity". Specifies a list of predicates that must pass in order for the criterion to be granted. The checks are applied to the entity, with the origin being the position of the player that would get the advancement.
		- : A single predicate.

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:player\_hurt\_entity",
 "conditions": {
 "damage": {
 "blocked": true,
 "type": {
 "direct\_entity": {
 "type": "minecraft:arrow"
 }
 }
 },
 "entity": {
 "type": "minecraft:player",
 "nbt": "{Tags:[\"example\"]}"
 }
 }
 }
 }
}

```

### minecraft:player\_interacted\_with\_entity

Triggers when the player interacts with an entity. Available extra conditions:

* conditions:
	+ item: The item which was in the player's hand during interaction.
		- All possible conditions for items
	+ entity: The entity which was interacted with.
		- All possible conditions for entities
	+ entity: Another format for "entity". Specifies a list of predicates that must pass in order for the criterion to be granted. The checks are applied to the entity, with the origin being the position of the player that would get the advancement.
		- : A single predicate.

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:player\_interacted\_with\_entity",
 "conditions": {
 "item": {
 "items": [
 "minecraft:iron\_ingot"
 ]
 },
 "entity": {
 "type": "minecraft:iron\_golem"
 }
 }
 }
 }
}

```

### minecraft:player\_killed\_entity

Triggers after a player is the source of a mob or player being killed. Available extra conditions:

* conditions:
	+ entity: The entity that was killed.
		- All possible conditions for entities
	+ entity: Another format for "entity". Specifies a list of predicates that must pass in order for the criterion to be granted. The checks are applied to the entity, with the origin being the position of the player that would get the advancement.
		- : A single predicate.
	+ killing\_blow: The type of damage that killed an entity.
		- Tags common to all damage types

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:player\_killed\_entity",
 "conditions": {
 "entity": {
 "type": "minecraft:creeper",
 "nbt": "{powered:1b}",
 "location": {
 "biome": "minecraft:the\_void"
 },
 "effects": {
 "minecraft:slowness": {},
 "minecraft:weakness": {
 "amplifier": {
 "min": 2
 }
 }
 }
 },
 "killing\_blow": {
 "source\_entity": {
 "nbt": "{SelectedItem:{id:\"minecraft:wooden\_sword\"}}"
 }
 }
 }
 }
 }
}

```

### minecraft:recipe\_crafted

Triggers when the player crafts a recipe in a crafting table, stonecutter or smithing table. Available extra conditions:

* conditions:
	+ recipe\_id**\***: The recipe that was crafted.
	+ ingredients: An array of item predicates for the recipe ingredients. Each item can only match one predicate, and every predicate needs to pass for the criterion to be granted.
		- : A single predicate.
			* All possible conditions for items

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:recipe\_crafted",
 "conditions": {
 "recipe\_id": "minecraft:furnace",
 "ingredients": [
 {
 "items": [
 "minecraft:cobblestone"
 ]
 },
 {
 "items": [
 "minecraft:blackstone"
 ]
 },
 {
 "items": [
 "minecraft:cobbled\_deepslate"
 ]
 }
 ]
 }
 }
 }
}

```

### minecraft:recipe\_unlocked

Triggers after the player unlocks a recipe (using a knowledge book for example). Available extra conditions:

* conditions:
	+ recipe**\***: The recipe that was unlocked.

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:recipe\_unlocked",
 "conditions": {
 "recipe": "minecraft:wooden\_sword"
 }
 }
 }
}

```

### minecraft:ride\_entity\_in\_lava

Triggers when a player mounts an entity walking on lava and while the entity moves with them. Available extra conditions:

* conditions:
	+ start\_position: A location predicate for the last position before the player mounted the entity.
		- Tags common to all locations
	+ distance: The distance between the start position and the player's position.
		- Distance predicate tags

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:ride\_entity\_in\_lava",
 "conditions": {
 "distance": {
 "horizontal": {
 "min": 10,
 "max": 100
 }
 }
 }
 }
 }
}

```

### minecraft:shot\_crossbow

Triggers when the player shoots a crossbow. Available extra conditions:

* conditions:
	+ item: The crossbow that is used.
		- All possible conditions for items

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:shot\_crossbow",
 "conditions": {
 "item": {
 "items": [
 "minecraft:crossbow"
 ]
 }
 }
 }
 }
}

```

### minecraft:slept\_in\_bed

Triggers when the player enters a bed. No extra conditions.

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:slept\_in\_bed",
 "conditions": {
 "player": {
 "location": {
 "position": {
 "x": {
 "min": -10,
 "max": 10
 }
 },
 "biome": "minecraft:jungle",
 "structure": "minecraft:jungle\_pyramid",
 "dimension": "minecraft:overworld"
 }
 }
 }
 }
 }
}

```

### minecraft:slide\_down\_block

Triggers when the player slides down a block. Available extra conditions:

* conditions:
	+ block: The block that the player slid on.
	+ state: A map of block property names to values. Errors if the block doesn't have these properties.
		- *key*: Block property key and value pair.
		- *key*: Another format.
			* max: A maximum value.
			* min: A minimum value.

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:slide\_down\_block",
 "conditions": {
 "block": "minecraft:honey\_block"
 }
 }
 }
}

```

### minecraft:started\_riding

Triggers when the player starts riding a vehicle or an entity starts riding a vehicle currently ridden by the player. No extra conditions.

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:started\_riding",
 "conditions": {
 "player": [
 {
 "condition": "minecraft:entity\_properties",
 "entity": "this",
 "predicate": {
 "vehicle": {
 "type": "minecraft:strider"
 }
 }
 }
 ]
 }
 }
 }
}

```

### minecraft:summoned\_entity

Triggers after an entity has been summoned. Works with iron golems (pumpkin and iron blocks), snow golems (pumpkin and snow blocks), the ender dragon (end crystals) and the wither (wither skulls and soul sand/soul soil). Using dispensers, commands, or pistons to place the wither skulls or pumpkins will still activate this trigger. Available extra conditions:

* conditions:
	+ entity: The summoned entity.
		- All possible conditions for entities
	+ entity: Another format for "entity". Specifies a list of predicates that must pass in order for the criterion to be granted. The checks are applied to the entity, with the origin being the position of the player that would get the advancement.
		- : A single predicate.

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:summoned\_entity",
 "conditions": {
 "entity": {
 "type": "minecraft:snow\_golem"
 }
 }
 }
 }
}

```

### minecraft:tame\_animal

Triggers after the player tames an animal. Available extra conditions:

* conditions:
	+ entity: Checks the entity that was tamed.
		- All possible conditions for entities
	+ entity: Another format for "entity". Specifies a list of predicates that must pass in order for the criterion to be granted. The checks are applied to the entity, with the origin being the position of the player that would get the advancement.
		- : A single predicate.

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:tame\_animal",
 "conditions": {
 "entity": {
 "type": "minecraft:parrot",
 "nbt": "{Variant:2}"
 }
 }
 }
 }
}

```

### minecraft:target\_hit

Triggers when the player shoots a target block. Available extra conditions:

* conditions:
	+ signal\_strength: The redstone signal that will come out of the target block.
	+ signal\_strength: Another format.
		- max: The maximum value.
		- min: The minimum value.
	+ projectile: The projectile hit the target block.
		- All possible conditions for entities
	+ projectile: Another format for "projectile". Specifies a list of predicates that must pass in order for the criterion to be granted. The checks are applied to the projectile, with the origin being the position of the player that would get the advancement.
		- : A single predicate.

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:target\_hit",
 "conditions": {
 "signal\_strength": 15,
 "projectile": [
 {
 "condition": "minecraft:entity\_properties",
 "predicate": {
 "type": "minecraft:snowball"
 },
 "entity": "this"
 }
 ]
 }
 }
 }
}

```

### minecraft:thrown\_item\_picked\_up\_by\_entity

Triggers after the player throws an item and another entity picks it up. Available extra conditions:

* conditions:
	+ item: The thrown item which was picked up.
		- All possible conditions for items
	+ entity: The entity which picked up the item.
		- All possible conditions for entities
	+ entity: Another format for "entity". Specifies a list of predicates that must pass in order for the criterion to be granted. The checks are applied to the entity, with the origin being the position of the player that would get the advancement.
		- : A single predicate.

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:thrown\_item\_picked\_up\_by\_entity",
 "conditions": {
 "item": {
 "items": [
 "minecraft:diamond"
 ]
 },
 "entity": [
 {
 "condition": "minecraft:entity\_properties",
 "predicate": {
 "type": "minecraft:player"
 },
 "entity": "this"
 }
 ]
 }
 }
 }
}

```

### minecraft:thrown\_item\_picked\_up\_by\_player

Triggers when a player picks up an item thrown by another entity. Available extra conditions:

* conditions:
	+ item: The item thrown.
		- All possible conditions for items
	+ entity: The entity that threw the item.
		- All possible conditions for entities
	+ entity: Another format for "entity". Specifies a list of predicates that must pass in order for the criterion to be granted. The checks are applied to the entity, with the origin being the position of the player that would get the advancement.
		- : A single predicate.

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:thrown\_item\_picked\_up\_by\_player",
 "conditions": {
 "item": {
 "items": [
 "minecraft:cookie"
 ]
 },
 "entity": [
 {
 "condition": "minecraft:entity\_properties",
 "predicate": {
 "type": "minecraft:allay"
 },
 "entity": "this"
 }
 ]
 }
 }
 }
}

```

### minecraft:tick

Triggers every tick (20 times a second). No extra conditions.

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:tick",
 "conditions": {
 "player": [
 {
 "condition": "minecraft:entity\_properties",
 "predicate": {
 "team": "red"
 },
 "entity": "this"
 }
 ]
 }
 }
 }
}

```

### minecraft:used\_ender\_eye

Triggers when the player uses an eye of ender (in a world where strongholds generate). Available extra conditions:

* conditions:
	+ distance: The horizontal distance between the player and the stronghold.
	+ distance: Another format.
		- max: A maximum value.
		- min: A minimum value.

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:used\_ender\_eye",
 "conditions": {
 "distance": {
 "min": 100,
 "max": 200
 }
 }
 }
 }
}

```

### minecraft:used\_totem

Triggers when the player uses a totem. Available extra conditions:

* conditions:
	+ item: The item, only works with totem items.
		- All possible conditions for items

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:used\_totem",
 "conditions": {
 "item": {
 "items": [
 "minecraft:totem\_of\_undying"
 ]
 }
 }
 }
 }
}

```

### minecraft:using\_item

Triggers for every tick that the player uses an item that is used continuously. It is known to trigger for bows, crossbows, honey bottles, milk buckets, potions, shields, spyglasses, tridents, food items, eyes of ender, etc. Most items that activate from a single click, such as fishing rods, do not affect this trigger. Available extra conditions:

* conditions:
	+ item: The item that is used.
		- All possible conditions for items

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:using\_item",
 "conditions": {
 "item": {
 "items": [
 "minecraft:enchanted\_golden\_apple"
 ],
 "nbt": "{display:{Name:\"Example\"}}"
 }
 }
 }
 }
}

```

### minecraft:villager\_trade

Triggers after the player trades with a villager or a wandering trader. Available extra conditions:

* conditions:
	+ item: The item that was purchased. The "count" tag checks the count from one trade, not multiple.
		- All possible conditions for items
	+ villager: The villager the item was purchased from.
		- All possible conditions for entities
	+ villager: Another format for "villager". Specifies a list of predicates that must pass in order for the criterion to be granted. The checks are applied to the villager, with the origin being the position of the player that would get the advancement.
		- : A single predicate.

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:villager\_trade",
 "conditions": {
 "item": {
 "items": [
 "minecraft:emerald"
 ],
 "count": {
 "min": 1
 }
 },
 "villager": {
 "nbt": "{VillagerData:{career:\"minecraft:librarian\"}}"
 }
 }
 }
 }
}

```

### minecraft:voluntary\_exile

Triggers when the player causes a raid. No extra conditions.

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:voluntary\_exile",
 "conditions": {
 "player":{
 "location": {
 "biome": "minecraft:savanna",
 "dimension": "minecraft:overworld",
 "position": {
 "z": {
 "min": -10,
 "max": 10
 }
 }
 }
 }
 }
 }
 }
}

```

## Removed triggers

### minecraft:arbitrary\_player\_tick

Triggers every tick for one player only. No available conditions.

Only exists in 17w18b.

### minecraft:item\_delivered\_to\_player

Triggers when an allay delivers an item to the player. No extra conditions.

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:item\_delivered\_to\_player",
 "conditions": {
 "player": [
 {
 "condition": "minecraft:entity\_properties",
 "predicate": {
 "location": {
 "dimension": "minecraft:the\_nether"
 }
 },
 "entity": "this"
 }
 ]
 }
 }
 }
}

```

Only exists in 22w14a.

### minecraft:player\_damaged

Triggers when the player receives damage. Available conditions:

* conditions:
	+ damage: Damage source predicate.
		- Damage tags

Removed in 17w14a.

### minecraft:safely\_harvest\_honey

Triggers when the player harvests honey from a bee nest/beehive with a campfire below it. Available extra conditions:

* conditions:
	+ block: The block that the player harvested the honey from.
		- block: A block ID.
		- tag: A block tag.
	+ item: The item that the player used to harvest the honey.
		- All possible conditions for items

An example

```
{
 "criteria": {
 "example": {
 "trigger": "minecraft:safely\_harvest\_honey",
 "conditions": {
 "block": {
 "tag": "minecraft:beehives"
 },
 "item": {
 "item": "minecraft:shears"
 }
 }
 }
 }
}

```

This trigger was made redundant by the `item_used_on_block` trigger. Removed in 20w20a.