Block Culling
CREATE YOUR MODEL
Before you start, make sure you've created a model for your block. Otherwise you'll have nothing to apply culling rules to!
Applying Culling Rules
Block culling rules allow you to remove faces of a block's model based on the surrounding full, opaque blocks. This can help to improve the game's performance as resources aren't wasted on unnecessarily rendering hidden parts of your block.
Culling rules are added in your resource pack's "block_culling" folder and appear in the format shown below:
{
"format_version": "1.21.70",
"minecraft:block_culling_rules": {
"description": {
"identifier": "wiki:culling.lamp" // Identifier to be referenced in block JSON geometry component.
},
"rules": [ ... ] // An array that can contain multiple culling rules.
}
}
They are then applied to block models in your block's minecraft:geometry
component:
"minecraft:geometry": {
"identifier": "geometry.lamp", // Model identifier
"culling": "wiki:culling.lamp" // Block culling rules identifier
}
Culling Entire Bones
This type of rule should be used if a bone is only visible from one direction, meaning the entire bone can be culled rather than individual cube faces.
{
"direction": "up", // This bone will be culled if there is a full, opaque block above the lamp.
"geometry_part": {
"bone": "lamp_bulb" // Name of the bone to be culled.
}
}
Culling Cube Faces
This type of rule should be used when you want to hide specific faces of cubes that are abutting full, opaque blocks.
{
"direction": "down", // This bone will be culled if there is a full, opaque block below the lamp.
"geometry_part": {
"bone": "lamp_base", // Name of the bone containing the cube to be culled.
"cube": 0, // The zero-based index of the cube in the bone's "cubes" array.
"face": "down" // The face of the cube to cull. This is usually the same as the rule's "direction" unless your cube is rotated.
}
}
Culling Conditions
EXPERIMENTAL
Block culling rule conditions are experimental and require Upcoming Creator Features to be enabled.
Culling rules will always cull against for full, opaque faces of adjacent blocks. However, they can also cull against other types of blocks based on the rule's condition
parameter.
{
"condition": "same_block", // Cull against a full, opaque block OR a block with the same identifier.
"direction": "down",
"geometry_part": {
"bone": "lamp_bulb" // Name of the bone containing the cube to be culled.
}
}
Default
When the default
condition is used, the specified geometry part is only culled if the adjacent block is full and opaque. This culling also applies to all of the following conditions.
Same Block
When the same_block
condition is used, the specified geometry part is also culled if the adjacent block has the same identifier as the block.
Same Block Permutation
When the same_block_permutation
condition is used, the specified geometry part is also culled if the adjacent block has the same identifier and state values as the block.
Same Culling Layer
When the same_culling_layer
condition is used, the specified geometry part is also culled if the adjacent block has the same culling_layer
identifier as the block.
Contributors
Edit Block Culling 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