Experimental Blocks

experimental

Better documentation on the new block format introduced in the Minecraft Beta 1.16.100 and newer versions.

WARNING

This document covers experimental features for blocks. If you would like to learn about stable blocks, you can do so here.

Block Events

Copy
json
{
  "format_version": "1.19.80",
  "minecraft:block": {
    "description": {
      "identifier": "wiki:custom_block"
    },
    "components": {
      "minecraft:on_step_on": {
        "event": "wiki:drop_loot",
        "target": "self"
      }
    },
    "events": {
      "wiki:drop_loot": {
        "spawn_loot": {
          "table": "loot_tables/blocks/my_loot_table.json"
        }
      }
    }
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

This example spawns a loot table when an entity stands on the block.

Event Responses

add_mob_effect

Adds a mob effect to a target when triggered.

Copy
json
{
  "wiki:effect_event": {
    "add_mob_effect": {
      "effect": "poison",
      "target": "other",
      "duration": 8,
      "amplifier": 3
    }
  }
}
1
2
3
4
5
6
7
8
9
10

remove_mob_effect

Removes a target's mob effect when triggered.

Copy
json
{
  "wiki:remove_effect_event": {
    "remove_mob_effect": {
      "effect": "poison",
      "target": "other"
    }
  }
}
1
2
3
4
5
6
7
8

spawn_loot

Summons a loot table.

Copy
json
{
  "wiki:drop_loot": {
    "spawn_loot": {
      "table": "loot_tables/blocks/my_loot_table.json"
    }
  }
}
1
2
3
4
5
6
7

set_block

Removes the current block and replaces it with the defined block in the same position.

Copy
json
{
  "wiki:place_block": {
    "set_block": "minecraft:grass"
  }
}
1
2
3
4
5

set_block_property

Sets the block's property.

Copy
json
{
  "wiki:change_color": {
    "set_block_property": {
      "wiki:string_property_example": "'red'"
    }
  }
}
1
2
3
4
5
6
7

set_block_at_pos

Sets a block at a specified position relative to the block.

Copy
json
{
  "wiki:trigger_event": {
    "set_block_at_pos": {
      "block_type": "minecraft:stone",
      "block_offset": [0, 0, 0]
    }
  }
}
1
2
3
4
5
6
7
8

run_command

Runs command(s) onto a target in context.

Copy
json
{
  "wiki:execute_event": {
    "run_command": {
      "target": "self",
      "command": "summon pig"
    }
  }
}
1
2
3
4
5
6
7
8
Copy
json
{
  "wiki:execute_event": {
    "run_command": {
      "target": "self",
      "command": ["summon pig", "say Ooh... A pig!!1!"]
    }
  }
}
1
2
3
4
5
6
7
8

damage

Inflicts a specified damage unto a target in context.

Copy
json
{
  "wiki:damage_event": {
    "damage": {
      "type": "magic",
      "target": "other",
      "amount": 4
    }
  }
}
1
2
3
4
5
6
7
8
9

decrement_stack

Decrements the player's current item stack.

Copy
json
{
  "wiki:remove_one": {
    "decrement_stack": {}
  }
}
1
2
3
4
5

die

Kills the specified target in context, making the block disappear with no loot. (Destroying the block, if specified).

Copy
json
{
  "wiki:destroy": {
    "die": {
      "target": "self"
    }
  }
}
1
2
3
4
5
6
7

play_effect

Play a particle effect at a specified contextual target's position.

Copy
json
{
  "wiki:particle_effect": {
    "play_effect": {
      "effect": "minecraft:campfire_smoke",
      "target": "self"
    }
  }
}
1
2
3
4
5
6
7
8

play_sound

Play a sound to a specified contextual target.

Copy
json
{
  "wiki:play_sound": {
    "play_sound": {
      "sound": "mob.enderman.death",
      "target": "self"
    }
  }
}
1
2
3
4
5
6
7
8

trigger

Triggers an event unto a specified contextual target.

Copy
json
{
  "wiki:trigger_event": {
    "trigger": {
      "event": "wiki:my_event",
      "target": "self"
    }
  }
}
1
2
3
4
5
6
7
8

sequence

Sequences event functions

Copy
json
{
  "wiki:sequence_event": {
    "sequence": [
      {
        "set_block_property": {
          "wiki:my_prop": true
        }
      },
      {
        "condition": "q.block_property('wiki:my_prop')", //Optional
        "trigger": {
          "event": "wiki:my_entity_event",
          "target": "other"
        }
      }
    ]
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

randomize

Randomizes event functions

Copy
json
{
  "wiki:randomize_events": {
    "randomize": [
      {
        "weight": 1, //Defines the rarity
        "set_block_property": {
          "wiki:boolean_property_example": false
        }
      },
      {
        "weight": 2,
        "set_block_property": {
          "wiki:boolean_property_example": true
        }
      },
      {
        "weight": 4,
        "set_block": "minecraft:stone"
      }
    ]
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

Triggering Events

Block event-trigger components:

  • minecraft:on_interact

  • minecraft:on_step_on

  • minecraft:on_step_off

  • minecraft:on_fall_on

  • minecraft:on_placed

  • minecraft:on_player_placing

  • minecraft:on_player_destroyed

  • minecraft:queued_ticking and minecraft:random_ticking may be used to trigger events after a time either set or random, respectively

Block Components

List of experimental block components, with usage examples.

minecraft:random_ticking

Allows for behavior like random crop growth.

Copy
json
{
  "minecraft:random_ticking": {
    "on_tick": {
      "event": "block_event",
      "target": "self",
      "condition": "q.block_property('wiki:block_property')" //Optional
    }
  }
}
1
2
3
4
5
6
7
8
9

minecraft:queued_ticking

Ticks when the values between x and y values randomly inside interval_range.

Copy
json
{
  "minecraft:queued_ticking": {
      "looping": true,
        "interval_range": [20, 20], //range changed to this.
        "on_tick": {
            "event": "set_particles_and_effect",
            "target": "block"
        }
  }
}
1
2
3
4
5
6
7
8
9
10

minecraft:transformation

Allows for rotation, scaling and translation.

Copy
json
{
  "minecraft:transformation": {
    "translation": [0.0, 0.1, -0.1],
    "scale": [0.5, 1, 1.5],
    "rotation": [90, 180, 0]
  }
}
1
2
3
4
5
6
7

For block rotations like logs, see this

minecraft:unit_cube

Forces the block to be a cube with face culling.

Copy
json
{
  "minecraft:unit_cube": {}
}
1
2
3

minecraft:on_step_on

Runs an event when an entity stepped on the block.

Copy
json
{
  "minecraft:on_step_on": {
    "event": "block_event",
    "target": "self",
    "condition": "q.block_property('wiki:block_property')" //Optional
  }
}
1
2
3
4
5
6
7

minecraft:on_step_off

Runs an event when an entity stepped off of the block.

Copy
json
{
  "minecraft:on_step_off": {
    "event": "block_event",
    "target": "self",
    "condition": "q.block_property('wiki:block_property')" //Optional
  }
}
1
2
3
4
5
6
7

minecraft:on_fall_on

Runs an event when an entity fell on the block.

Copy
json
{
  "minecraft:on_fall_on": {
    "event": "block_event",
    "target": "self",
    "condition": "q.block_property('wiki:block_property')", //Optional
    "min_fall_distance": 5
  }
}
1
2
3
4
5
6
7
8

minecraft:on_placed

Runs an event when an entity placed the block.

Copy
json
{
  "minecraft:on_placed": {
    "event": "block_event",
    "target": "self",
    "condition": "q.block_property('wiki:block_property')" //Optional
  }
}
1
2
3
4
5
6
7

minecraft:on_player_placing

Runs an event when The Player placed the block.

Copy
json
{
  "minecraft:on_player_placing": {
    "event": "block_event",
    "target": "self",
    "condition": "q.block_property('wiki:block_property')" //Optional
  }
}
1
2
3
4
5
6
7

minecraft:on_player_destroyed

Runs an event when The Player destroys the block. currently bugged as of 1.19.50

Copy
json
{
  "minecraft:on_player_destroyed": {
    "event": "block_event",
    "target": "self",
    "condition": "q.block_property('wiki:block_property')" //Optional
  }
}
1
2
3
4
5
6
7

minecraft:on_interact

Runs an event when The Player uses the block.

Copy
json
{
  "minecraft:on_interact": {
    "event": "block_event",
    "target": "self",
    "condition": "q.block_property('wiki:block_property')" //Optional
  }
}
1
2
3
4
5
6
7

Block Tags

Block tags can be given to blocks to be queried or referenced with any_tag or all_tags, which is used inside item and entity files. A tag can be applied like this:

Copy
json
{
  "format_version": "1.16.100",
  "minecraft:block": {
    "description": {
      "identifier": "wiki:custom_block"
    },
    "components": {
      "tag:wiki:my_tag": {},
      "tag:my_other_tag": {}
    }
  }
}
1
2
3
4
5
6
7
8
9
10
11
12

and this tag can be queried with:

  • q.all_tags
  • q.any_tag
  • q.block_has_all_tags
  • q.block_has_any_tag
  • q.relative_block_has_all_tags
  • q.relative_block_has_any_tag

Example of querying a tag:

Copy
json
{
  "format_version": "1.16.100",
  "minecraft:item": {
    "description": {
      "category": "equipment",
      "identifier": "wiki:pickaxe"
    },
    "components": {
      "minecraft:digger": {
        "use_efficiency": true,
        "destroy_speeds": [
          {
            "speed": 5,
            "block": {
              "tags": "q.any_tag('wiki:my_tag', 'stone', 'metal')"
            }
          }
        ]
      }
    }
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

Additional Notes

  • The following event triggers require the minecraft:collision_box component to be 4 or higher on the Y-axis:
    • minecraft:on_step_on
    • minecraft:on_step_off
    • minecraft:on_fall_on

Contributors

SmokeyStackQuazChick