# BLOCKS DOCUMENTATION Version: 1.17.0.2

##

Index

Blocks
Block Components
Block Definition Properties
Block Description Properties
Block Event Responses
Block Trigger Components

Back to top

#

Blocks

#

Block Components

##

Name | Type | Default Value | Description
--- | --- | --- | ---
minecraft:block_light_absorption | Integer | 0 | The amount of light this block will absorb.
minecraft:block_light_emission | Decimal | 0.0 | The amount of light this block will emit in a range [0.0, 1.0].
minecraft:breakonpush | Boolean |  | When pushed by a piston the block breaks
minecraft:breathability | Enumerator | solid | Property describing the breathability of this block and whether it is treated as a solid or as air.
minecraft:destroy_time | Decimal | 0.0 | Sets the destroy time property for the block. Greater numbers result in greater mining times.
minecraft:display_name | String |  | Specifies the display name id for the block.
minecraft:entity_collision | Boolean | false | Can only be set to false, it disables the collision of the block with entities
Name | Type | Default Value | Description
--- | --- | --- | ---
origin | Array | [-8.0, 0.0, -8.0] | Minimal position Bounds of the collision box
size | Array | [16.0, 16.0, 16.0] | Size of each side of the box of the component
minecraft:explosion_resistance | Decimal | 0.0 | Sets the explosion resistance for this block.
minecraft:flammable | JSON Object |  | Describes the flammable properties for this block.
Name | Type | Default Value | Description
--- | --- | --- | ---
burn_odds | Integer | 0 | How likely the block will be destroyed by flames when on fire.
flame_odds | Integer | 0 | How likely the block will catch flame when next to a fire.
minecraft:friction | Decimal | 0.1 | Property describing the friction for this block. Friction effects an entities movements when it walks on the block.
minecraft:geometry | String |  | The geometry definition name to use.
minecraft:immovable | Boolean |  | An Immovable block cannot be pushed by pistons
minecraft:map_color | String |  | A color represented as a hex value. This will be the color rendered to a map.
minecraft:material_instances | JSON Object |  | Maps face or material_instance names in a geometry file to an actual material instance. Material instance can either be a full material instance or a name to another already defined instance
minecraft:onlypistonpush | Boolean |  | Blocks with those components won't stick to stickyPistons
minecraft:pick_collision | Boolean | false | Can only be set to false, it disables the collision of the block with entities
Name | Type | Default Value | Description
--- | --- | --- | ---
origin | Array | [-8.0, 0.0, -8.0] | Minimal position Bounds of the collision box
size | Array | [16.0, 16.0, 16.0] | Size of each side of the box of the component
minecraft:placement_filter | JSON Object |  | Sets rules for under what conditions the block can be placed/survive ### conditions List of conditions where the block can be placed/survive ####
Name | Type | Default Value | Description
--- | --- | --- | ---
allowed_faces | Array |  | List of any of the following strings: up, down, north, south, east, west, side, all
block_filter | Array |  | List of blocks (can use tags to specify them) that this block can be placed against in the allowed_faces direction
Back to top
minecraft:preventsjumping | Boolean |  | this component makes it so actors can't jump when walking on this block
minecraft:random_ticking | JSON Object |  | Describes the component that will trigger an even at a regular interval between two values
Name | Type | Default Value | Description
--- | --- | --- | ---
Trigger |  |  | on_tick
Name | Type | Default Value | Description
--- | --- | --- | ---
condition | String | 1 | The condition of event to be executed on the block.
event | String | set_block_property | The type of event executed on the block.
range | Array | [10, 10] | The Range between which the component will trigger his event.
target | String | self | The target of event executed on the block.
minecraft:rotation | Vector [a, b, c] | rotation[0, 0, 0] | This is the block's rotation around the center of the cube in degrees. The rotation order is x-y-z.
minecraft:ticking | JSON Object |  | Describes the component that will trigger an even at a regular interval between two values
Name | Type | Default Value | Description
--- | --- | --- | ---
Trigger |  |  | on_tick
Name | Type | Default Value | Description
--- | --- | --- | ---
condition | String | 1 | The condition of event to be executed on the block.
event | String | set_block_property | The type of event executed on the block.
range | Array | [10, 10] | The Range between which the component will trigger his event.
target | String | self | The target of event executed on the block.
looping | Boolean | true | Does the event loop
range | Array | [10, 10] | The Range between which the component will trigger his event.
minecraft:unit_cube | String |  | Specifies that a unit cube is to be used with tessellation.
minecraft:unwalkable | Boolean |  | this component sets a block as unwalkable. Most mobs will not try to jump over it if the value is set to true

Back to top

#

Block Definition Properties

These properties are part of the Block Definition. This helps the system determine how to parse and initialize this block.

##

Name | Type | Default Value | Description
--- | --- | --- | ---
format_version | String |  | Specifies the version of the game this entity was made in. If the version is lower than the current version, any changes made to the entity in the vanilla version will be applied to it.

## Code Example

Example
{ "format_version": "1.16.0", "minecraft:block": { "description": { "identifier": "design:lavenderstone" }, "components": { "minecraft:loot": "loot_tables/chests/simple_dungeon.json", "minecraft:destroy_time": 4.0, "minecraft:friction": 0.6, "minecraft:map_color": "#00ff00", "minecraft:flammable": { "flame_odds": 50, "burn_odds": 0 }, "minecraft:block_light_emission": 1.0 } } } Back to top

#

Block Description Properties

##

Name | Type | Default Value | Description
--- | --- | --- | ---
identifier | String |  | The identifier for this block. The name must include a namespace and must not use the Minecraft namespace unless overriding a Vanilla block.

Back to top

#

Block Event Responses

Event responses for block trigger components.

##

Name | Type | Default Value | Description
--- | --- | --- | ---
add_mob_effect | JSON Object |  | Apply mob effect to target.
Name | Type | Default Value | Description
--- | --- | --- | ---
amplifier | Integer | 0 | The amplifier for the mob effect.
duration | Decimal | 0.0 | The duration of the mob effect.
effect | String |  | The mob effect to apply.
target | Minecraft Filter | self | The target context to execute against.
damage | JSON Object |  | Deals damage to the target.
Name | Type | Default Value | Description
--- | --- | --- | ---
amount | Integer | 0 | The amount of damage to deal.
target | Minecraft Filter | self | The target context to execute against.
type | String |  | The type of damage to deal.
decrement_stack | JSON Object |  | Decrement item stack.
die | JSON Object |  | Kill target. If target is self and this is run from a block then destroy the block.
Name | Type | Default Value | Description
--- | --- | --- | ---
target | Minecraft Filter | self | The target context to execute against.
play_effect | JSON Object |  | Spawns a particle effect relative to target position.
Name | Type | Default Value | Description
--- | --- | --- | ---
data | Integer | 0 | Particle data value.
effect | String |  | The name of the particle effect to create.
target | Minecraft Filter | self | The target context to execute against.
play_sound | JSON Object |  | Play a sound relative to target position.
Name | Type | Default Value | Description
--- | --- | --- | ---
sound | String |  | The name of the sound to play.
target | Minecraft Filter | self | The target context to execute against.
remove_mob_effect | JSON Object |  | Removes mob effect from target.
Name | Type | Default Value | Description
--- | --- | --- | ---
effect | String |  | The mob effect to remove. Use 'all' to remove all mob effects from target.
target | Minecraft Filter | self | The target context to execute against.
run_command | JSON Object |  | Triggers a slash command or a list of slash commands.
Name | Type | Default Value | Description
--- | --- | --- | ---
command | String |  | Slash command to run.
command array | Array |  | List of slash commands to run.
target | Minecraft Filter | self | The target context to execute against.
set_block | JSON Object |  | Sets this block to another block type.
Name | Type | Default Value | Description
--- | --- | --- | ---
block_type | String |  | The type of block to set.
set_block_at_pos | JSON Object |  | Sets a block relative to this block to another block type.
Name | Type | Default Value | Description
--- | --- | --- | ---
block_offset | Vector [a, b, c] | [0.0, 0.0, 0.0] | The offset from the block's center.
block_type | String |  | The type of block to set.
set_block_property | JSON Object |  | Sets a block property on this block.
Name | Type | Default Value | Description
--- | --- | --- | ---
property | MoLang |  | Block property to set on the block.
spawn_loot | JSON Object |  | Spawn loot from block.
Name | Type | Default Value | Description
--- | --- | --- | ---
table | String |  | File path, relative to the Behavior Pack's path, to the loot table file.
swing | JSON Object |  | Event causes the actor to swing.
teleport | JSON Object |  | Teleport target randomly around destination point.
Name | Type | Default Value | Description
--- | --- | --- | ---
avoid_water | Boolean | true | Determines if the teleport avoids putting the target in water.
destination | Vector [a, b, c] | [0.0, 0.0, 0.0] | Origin destination of the teleport.
land_on_block | Boolean | true | Determines if the teleport places the target on a block.
max_range | Vector [a, b, c] | [8.0, 8.0, 8.0] | Max range the target can teleport relative to the origin destination.
target | Minecraft Filter | self | The target context to execute against.
transform_item | JSON Object |  | Transforms item into another item.
Name | Type | Default Value | Description
--- | --- | --- | ---
transform | String |  | Name of the item it should transform into

## Code Example

Event Response Example
"minecraft:block": { "description": { "identifier": "test:on_interact_change_state_block", "properties": { "minecraft:direction": { } } }, "components": { "minecraft:on_interact": { "event": "test_event" } }, "events": { "test_event": { "set_block_property": { "minecraft:direction": "1" } } } } Back to top

#

Block Trigger Components

##

Name | Type | Default Value | Description
--- | --- | --- | ---
minecraft:on_fall_on | JSON Object |  | Describes event for this block.
Name | Type | Default Value | Description
--- | --- | --- | ---
condition | String |  | The condition of event to be executed on the block.
event | String |  | The event executed on the block.
min_fall_distance | Decimal | 0.0 | The minimum distance in blocks that an actor needs to fall to trigger this event.
target | String | self | The target of event executed on the block.
minecraft:on_interact | JSON Object |  | Describes event for this block.
Name | Type | Default Value | Description
--- | --- | --- | ---
condition | String |  | The condition of event to be executed on the block.
event | String |  | The event executed on the block.
target | String | self | The target of event executed on the block.
minecraft:on_placed | JSON Object |  | Describes event for this block.
Name | Type | Default Value | Description
--- | --- | --- | ---
condition | String |  | The condition of event to be executed on the block.
event | String |  | The event executed on the block.
target | String | self | The target of event executed on the block.
minecraft:on_player_destroyed | JSON Object |  | Describes event for this block.
Name | Type | Default Value | Description
--- | --- | --- | ---
condition | String |  | The condition of event to be executed on the block.
event | String |  | The event executed on the block.
target | String | self | The target of event executed on the block.
minecraft:on_player_placing | JSON Object |  | Describes event for this block.
Name | Type | Default Value | Description
--- | --- | --- | ---
condition | String |  | The condition of event to be executed on the block.
event | String |  | The event executed on the block.
target | String | self | The target of event executed on the block.
minecraft:on_step_off | JSON Object |  | Describes event for this block.
Name | Type | Default Value | Description
--- | --- | --- | ---
condition | String |  | The condition of event to be executed on the block.
event | String |  | The event executed on the block.
target | String | self | The target of event executed on the block.
minecraft:on_step_on | JSON Object |  | Describes event for this block.
Name | Type | Default Value | Description
--- | --- | --- | ---
condition | String |  | The condition of event to be executed on the block.
event | String |  | The event executed on the block.
target | String | self | The target of event executed on the block.

Back to top