Block Traits
FORMAT VERSION 1.26.10
Before you learn about block traits, you should be confident with block states.
When working with block states, ensure that the min_engine_version in your pack manifest is 1.20.20 or higher.
Applying Traits
Block traits can be used to apply vanilla block states (such as direction) to your custom blocks easily, without the need for events and triggers.
{
"format_version": "1.26.10",
"minecraft:block": {
"description": {
"identifier": "wiki:custom_slab",
"menu_category": {
"category": "construction",
"group": "minecraft:itemGroup.name.slab"
},
"traits": {
"minecraft:placement_position": {
"enabled_states": ["minecraft:vertical_half"]
}
}
},
"components": { ... },
"permutations": [ ... ]
}
}This example will set the minecraft:vertical_half block state when placed to either "top" or "bottom" - depending on where the player is looking.
Entries in the permutations array are still required for this state to make a functional difference, with conditions querying
q.block_state('minecraft:vertical_half')List of Traits
Connection
Allows for fence-like connection permutations by updating cardinal connection states based on adjacent blocks.
Requires format version 1.26.0 or later.
enabled_states— Array- May only contain
"minecraft:cardinal_connections", which enables all of the following states.
- May only contain
Provided States
| State | Values | Description |
|---|---|---|
minecraft:connection_north | false (default)true | Whether the block is connected to the adjacent block to the north. |
minecraft:connection_south | false (default)true | Whether the block is connected to the adjacent block to the south. |
minecraft:connection_west | false (default)true | Whether the block is connected to the adjacent block to the west. |
minecraft:connection_east | false (default)true | Whether the block is connected to the adjacent block to the east. |
"minecraft:connection": {
"enabled_states": ["minecraft:cardinal_connections"]
}Placement Direction
Contains information about the player's rotation when the block was placed.
Requires format version 1.26.0 or later.
enabled_states— Array- May contain any of the states from the table below (excluding
minecraft:corner), enabling only the states specified. - Alternatively, may contain
"minecraft:corner_and_cardinal_direction"which enables bothminecraft:cornerandminecraft:cardinal_direction.
- May contain any of the states from the table below (excluding
y_rotation_offset— Integer (optional)- This rotation offset only applies to the horizontal state values (north, south, east, west).
- Only axis-aligned angles may be specified (e.g. 90, 180).
blocks_to_corner_with— Array (optional)- Lists the blocks (as an array of block descriptors) that the block can create corners with.
- This parameter may only be specified when
"minecraft:corner_and_cardinal_direction"is included in theenabled_statesarray.
Provided States
| State | Values | Description |
|---|---|---|
minecraft:cardinal_direction | "south" (default)"north""west""east" | Cardinal facing direction of player when placed. |
minecraft:facing_direction | "down" (default)"up""south""north""west""east" | Overall direction of player when placed. |
minecraft:corner | "none" (default)"inner_left""inner_right""outer_left""outer_right" | The shape of the corner that the block has created. |
"minecraft:placement_direction": {
"enabled_states": ["minecraft:cardinal_direction"],
"y_rotation_offset": 180
}Placement Position
Contains information about where the player placed the block.
Requires format version 1.20.20 or later.
enabled_states— Array- May contain any of the states from the table below, enabling only the states specified.
Provided States
| State | Values | Description |
|---|---|---|
minecraft:block_face | "down" (default)"up""south""north""west""east" | Face on which the block was placed. |
minecraft:vertical_half | "top""bottom" (default) | The vertical half where the block was placed. |
"minecraft:placement_position": {
"enabled_states": [
"minecraft:block_face",
"minecraft:vertical_half"
]
}Contributors
Edit Block Traits on GitHubText and image content on this page is licensed under the Creative Commons Attribution 4.0 International License
Code samples on this page are licensed under the MIT License

