Minecraft:Block components/Upstream: Difference between revisions
More actions
Sync: upstream version from Minecraft |
Fix template calls: add MC/ prefix |
||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
{{For|item components|Item components}} | {{MC/For|item components|Item components}} | ||
{{ | {{MC/Exclusive|bedrock}} | ||
Block components are [[Minecraft:JSON]] objects that are added to a custom [[Minecraft:block definition]] in a [[Minecraft:behavior pack]] to customize the [[Minecraft:block]]'s behavior and visuals. | Block components are [[Minecraft:JSON]] objects that are added to a custom [[Minecraft:block definition]] in a [[Minecraft:behavior pack]] to customize the [[Minecraft:block]]'s behavior and visuals. | ||
{{ | {{MC/Toc|right}} | ||
== Applying == | == Applying == | ||
Block components can be applied by adding them to {{ | Block components can be applied by adding them to {{MC/Cd|components}} within {{MC/Cd|minecraft:block}} in the block's definition file. | ||
Components can also be found in a {{ | Components can also be found in a {{MC/Cd|components}} object located in objects within the {{MC/Cd|permutations}} array. This can be used to make a component only active when the permutation's {{MC/Cd|condition}} evaluates to {{MC/Cd|true}}. | ||
=== Tags === | === Tags === | ||
{{In development|be||26.20|note=Replaced with the [[#minecraft:tags|minecraft:tags]] component.|removed=1|section=1}} | {{MC/In development|be||26.20|note=Replaced with the [[#minecraft:tags|minecraft:tags]] component.|removed=1|section=1}} | ||
Tags are used to categorize blocks and allow them to work better with vanilla blocks and items. Both vanilla and custom [[Minecraft:Block tag (Bedrock Edition)|block tags]] can be added. Tags are added with other components, as an empty object with the format: <code>"tag:''<tag_name>''": {}</code> | Tags are used to categorize blocks and allow them to work better with vanilla blocks and items. Both vanilla and custom [[Minecraft:Block tag (Bedrock Edition)|block tags]] can be added. Tags are added with other components, as an empty object with the format: <code>"tag:''<tag_name>''": {}</code> | ||
| Line 23: | Line 23: | ||
Permutations are used to make some block components active only under certain conditions. | Permutations are used to make some block components active only under certain conditions. | ||
Permutations are defined in the {{ | Permutations are defined in the {{MC/Cd|permutations}} array within {{MC/Cd|minecraft:block}}, and consist of two properties: | ||
* {{ | * {{MC/Nbt|string|condition}}: A molang expression resolving to a boolean, representing when the permutation's components should be active. This is most often a block state query. For example: | ||
<syntaxhighlight lang=json copy> | <syntaxhighlight lang=json copy> | ||
"condition": "query.block_state('minecraft:cardinal_direction') == 'north'"</syntaxhighlight> | "condition": "query.block_state('minecraft:cardinal_direction') == 'north'"</syntaxhighlight> | ||
* {{ | * {{MC/Nbt|compound|components}}: The [[#Components list|components]] for this permutation. | ||
Example: | Example: | ||
| Line 57: | Line 57: | ||
=== <code>minecraft:chest_obstruction</code> === | === <code>minecraft:chest_obstruction</code> === | ||
{{Experimental|be||be=Upcoming Creator Features|untilbe=26.20}} | {{MC/Experimental|be||be=Upcoming Creator Features|untilbe=26.20}} | ||
Defines how the block should obstruct [[Minecraft:chest]]s from opening when placed above one. | Defines how the block should obstruct [[Minecraft:chest]]s from opening when placed above one. | ||
| Line 63: | Line 63: | ||
<div class="treeview"> | <div class="treeview"> | ||
* {{ | * {{MC/Nbt|compound|minecraft:chest_obstruction}}: The component root. | ||
** {{ | ** {{MC/Nbt|string|obstruction_rule}}: ''Optional.'' How the block is evaluated during chest opening if the block is placed above the chest. Defaults to <code>shape</code>. Valid values are: | ||
*** '''<code>always</code>''': The block will always obstruct a chest from opening. | *** '''<code>always</code>''': The block will always obstruct a chest from opening. | ||
*** '''<code>never</code>''': The block will never obstruct a chest from opening. | *** '''<code>never</code>''': The block will never obstruct a chest from opening. | ||
| Line 79: | Line 79: | ||
=== <code>minecraft:collision_box</code> === | === <code>minecraft:collision_box</code> === | ||
Defines the block's | Defines the block's collision box. This component can be specified in 3 ways. | ||
* '''As a single {{ | * '''As a single {{MC/Cd|true}} or {{MC/Cd|false}} value:''' | ||
Example: | Example: | ||
| Line 93: | Line 93: | ||
Fields: | Fields: | ||
* '''{{ | * '''{{MC/Cd|origin}}''': | ||
** The origin of the collision box. (0,0,0) represents the bottom center of the block. | ** The origin of the collision box. (0,0,0) represents the bottom center of the block. | ||
* '''{{ | * '''{{MC/Cd|size}}''': | ||
** The size of the collision box. The total size of the collision box may not be larger than 16×24×16. | ** The size of the collision box. The total size of the collision box may not be larger than 16×24×16. | ||
| Line 128: | Line 128: | ||
=== <code>minecraft:connection_rule</code> === | === <code>minecraft:connection_rule</code> === | ||
Defines which blocks this block can connect to with the {{ | Defines which blocks this block can connect to with the {{MC/Cd|minecraft:connection}} block trait. | ||
Fields: | Fields: | ||
* '''{{ | * '''{{MC/Cd|accepts_connections_from}}''': | ||
** ''Optional.'' Which blocks this block can connect to. If omitted, the block accepts connections from all blocks. Allowed values are {{ | ** ''Optional.'' Which blocks this block can connect to. If omitted, the block accepts connections from all blocks. Allowed values are {{MC/Cd|d=and|all|only_fences|none}}. | ||
* '''{{ | * '''{{MC/Cd|enabled_directions}}''': | ||
** ''Optional.'' Enables connection in only certain directions, disabling others; available values are {{ | ** ''Optional.'' Enables connection in only certain directions, disabling others; available values are {{MC/Cd|north}}, {{MC/Cd|south}}, {{MC/Cd|west}}, and {{MC/Cd|east}}. | ||
Example: | Example: | ||
| Line 146: | Line 146: | ||
=== <code>minecraft:crafting_table</code> === | === <code>minecraft:crafting_table</code> === | ||
Gives a custom block the functionality of a | Gives a custom block the functionality of a crafting table. | ||
Fields: | Fields: | ||
* '''{{ | * '''{{MC/Cd|crafting_tags}}''': | ||
** An array of | ** An array of recipe tags that this block should be able to craft. There can be at most 64 tags, and each tag can be at most 64 characters. | ||
** The default tag for vanilla crafting recipes is {{ | ** The default tag for vanilla crafting recipes is {{MC/Cd|crafting_table}}, and custom tags can be specified to allow crafting of recipes with that tag in their definition. | ||
* '''{{ | * '''{{MC/Cd|table_name}}''': | ||
** The name to display in the crafting table UI. Specified as a localization string, or will resort to a regular string if it can't be resolved. | ** The name to display in the crafting table UI. Specified as a localization string, or will resort to a regular string if it can't be resolved. | ||
| Line 169: | Line 169: | ||
=== <code>minecraft:destructible_by_explosion</code> === | === <code>minecraft:destructible_by_explosion</code> === | ||
Defines whether the block can be destroyed by | Defines whether the block can be destroyed by explosions, and sets its blast resistance. | ||
This component can be defined in two ways. | This component can be defined in two ways. | ||
* '''As a boolean ({{ | * '''As a boolean ({{MC/Cd|true}} or {{MC/Cd|false}}) value:''' | ||
Example: | Example: | ||
| Line 184: | Line 184: | ||
Fields: | Fields: | ||
* '''{{ | * '''{{MC/Cd|explosion_resistance}}''': | ||
** Sets the block's resistance to explosions. | ** Sets the block's resistance to explosions. | ||
** ''Note that the actual blast resistance value of the block is 1/5 of the value set here.'' | ** ''Note that the actual blast resistance value of the block is 1/5 of the value set here.'' | ||
| Line 197: | Line 197: | ||
=== <code>minecraft:destructible_by_mining</code> === | === <code>minecraft:destructible_by_mining</code> === | ||
Defines whether the block can be | Defines whether the block can be mined and sets its hardness. | ||
This component can be defined in two ways. | This component can be defined in two ways. | ||
'''As a boolean ({{ | '''As a boolean ({{MC/Cd|true}} or {{MC/Cd|false}}) value:''' | ||
A value of {{ | A value of {{MC/Cd|true}} makes the block destructible in 0 seconds, making it able to be instant mined. | ||
A value of {{ | A value of {{MC/Cd|false}} makes the block indestructible by mining. | ||
Example: | Example: | ||
| Line 215: | Line 215: | ||
Structure: | Structure: | ||
<div class="treeview"> | <div class="treeview"> | ||
* {{ | * {{MC/Nbt|compound|minecraft:destructible_by_mining}}: (root of component) | ||
** {{ | ** {{MC/Nbt|list|item_specific_speeds}} | ||
*** {{ | *** {{MC/Nbt|compound|An item}}: | ||
**** {{ | **** {{MC/Nbt|int|destroy_speed}}: The hardness of the block when mined with the target item(s). | ||
**** {{ | **** {{MC/Nbt|string}}{{MC/Nbt|compound|item}}: A description of the item(s). Either a string item identifier or an object. | ||
***** {{ | ***** {{MC/Nbt|string|tags}}: A [[Minecraft:Molang]] expression defining the [[Minecraft:Item tag (Bedrock Edition)|tags]] of the target item(s). | ||
** {{ | ** {{MC/Nbt|int|seconds_to_destroy}} | ||
</div> | </div> | ||
Fields: | Fields: | ||
* '''{{ | * '''{{MC/Cd|seconds_to_destroy}}''': The amount of time it takes to destroy the block. ''Note that this sets the block's hardness value, not the actual seconds to destroy!'' | ||
* '''{{ | * '''{{MC/Cd|item_specific_speeds}}''': ''Optional.'' Specific breaking speed values for each item, it is recommended to use tags because manually defining items can make the list unnecessarily long and remove compatibility with the enchantment Efficiency. | ||
Example: | Example: | ||
<syntaxhighlight lang=json copy> | <syntaxhighlight lang=json copy> | ||
| Line 251: | Line 251: | ||
Fields: | Fields: | ||
* '''{{ | * '''{{MC/Cd|particle_count}}''': | ||
** ''Optional.'' Sets the number of particles created when the block destroyed. Default is {{ | ** ''Optional.'' Sets the number of particles created when the block destroyed. Default is {{MC/Cd|100}}, maximum is {{MC/Cd|255}}. | ||
* '''{{ | * '''{{MC/Cd|texture}}''': | ||
** ''Optional.'' The | ** ''Optional.'' The texture to use for the particles. This is a texture name defined in {{MC/Cd|terrain_texture.json}}. Defaults to the texture of the {{MC/Cd|down}} material instance. | ||
* '''{{ | * '''{{MC/Cd|tint_method}}''': | ||
** ''Optional.'' The method with which the particles are tinted. Default is {{ | ** ''Optional.'' The method with which the particles are tinted. Default is {{MC/Cd|none}}. | ||
** Can be {{ | ** Can be {{MC/Cd|none|default_foliage|birch_foliage|evergreen_foliage|dry_foliage|grass|water|d=or}}. | ||
Example: | Example: | ||
| Line 282: | Line 282: | ||
=== <code>minecraft:embedded_visual</code> === | === <code>minecraft:embedded_visual</code> === | ||
Sets the visuals of the block when it is embedded, such as in a | Sets the visuals of the block when it is embedded, such as in a flowerpot. | ||
This component can not be specified in entries in the {{ | This component can not be specified in entries in the {{MC/Cd|permutations}} array. | ||
Fields: | Fields: | ||
* '''{{ | * '''{{MC/Cd|geometry}}''': | ||
** A [[#minecraft:geometry|{{ | ** A [[#minecraft:geometry|{{MC/Cd|minecraft:geometry}}]] component defining the embedded geometry. | ||
* '''{{ | * '''{{MC/Cd|material_instances}}''': | ||
** A [[#minecraft:material_instances|{{ | ** A [[#minecraft:material_instances|{{MC/Cd|minecraft:material_instances}}]] component defining the embedded material. | ||
Example: | Example: | ||
| Line 306: | Line 306: | ||
=== <code>minecraft:entity_fall_on</code> === | === <code>minecraft:entity_fall_on</code> === | ||
Configures the fall distance required to trigger the {{ | Configures the fall distance required to trigger the {{MC/Cd|onEntityFallOn}} custom component [[Minecraft:Add-on#Scripting|script]] event. The distance defaults to 1 block if omitted. | ||
Fields: | Fields: | ||
* '''{{ | * '''{{MC/Cd|min_fall_distance}}''': | ||
** The distance an entity must fall to trigger the event. | ** The distance an entity must fall to trigger the event. | ||
| Line 322: | Line 322: | ||
=== <code>minecraft:flammable</code> === | === <code>minecraft:flammable</code> === | ||
Defines how | Defines how flammable the block is, in this case, all blocks with this component will burn from fire and lava, unlike vanilla where some blocks do not burn from lava. | ||
This component can be defined in two ways. | This component can be defined in two ways. | ||
* '''As a boolean ({{ | * '''As a boolean ({{MC/Cd|true}} or {{MC/Cd|false}}) property:''' | ||
If {{ | If {{MC/Cd|true}}, the block can catch fire from nearby blocks. The chance modifier for catching fire is automatically set to 5, and the chance modifier for the block being destroyed by fire is set to 20. | ||
If {{ | If {{MC/Cd|false}} (or omitted) the block will only catch fire if directly ignited. | ||
Example: | Example: | ||
| Line 341: | Line 341: | ||
Fields: | Fields: | ||
* '''{{ | * '''{{MC/Cd|catch_chance_modifier}}''': | ||
** ''Optional.'' The chance that the block catches fire from a nearby block. Default is 5. | ** ''Optional.'' The chance that the block catches fire from a nearby block. Default is 5. | ||
** If greater than 0, fire on the block will burn until it is destroyed or the fire is put out. If {{ | ** If greater than 0, fire on the block will burn until it is destroyed or the fire is put out. If {{MC/Cd|destroy_chance_modifier}} is 0, the block will burn forever. | ||
** If 0 the block will eventually burn out (if it isn't destroyed). | ** If 0 the block will eventually burn out (if it isn't destroyed). | ||
* '''{{ | * '''{{MC/Cd|destroy_change_modifier}}''': | ||
** ''Optional.'' The chance the block is destroyed while on fire. Default is 20. | ** ''Optional.'' The chance the block is destroyed while on fire. Default is 20. | ||
** If 0, the block will not be destroyed by fire. | ** If 0, the block will not be destroyed by fire. | ||
| Line 359: | Line 359: | ||
=== <code>minecraft:flower_pottable</code> === | === <code>minecraft:flower_pottable</code> === | ||
Indicates that this block can be placed inside a | Indicates that this block can be placed inside a flower pot. The geometry of the block while inside a flower pot is specified by [[#minecraft:geometry|{{MC/Cd|minecraft:geometry}}]] by default, but it can be changed with [[#minecraft:embedded_visual|{{MC/Cd|minecraft:embedded_visual}}]]. | ||
This component is specified as an empty object, and can not be specified in an entry to the {{ | This component is specified as an empty object, and can not be specified in an entry to the {{MC/Cd|permutations}} array. | ||
Example: | Example: | ||
| Line 370: | Line 370: | ||
=== <code>minecraft:friction</code> === | === <code>minecraft:friction</code> === | ||
Describes the block's friction. | Describes the block's friction. | ||
This component is specified as a decimal number between {{ | This component is specified as a decimal number between {{MC/Cd|0.0}} and {{MC/Cd|9.0}}. | ||
Example: | Example: | ||
| Line 379: | Line 379: | ||
=== <code>minecraft:geometry</code> === | === <code>minecraft:geometry</code> === | ||
Defines the geometry of the block. There are three vanilla models that can be used: {{ | Defines the geometry of the block. There are three vanilla models that can be used: {{MC/Cd|minecraft:geometry.full_block|minecraft:geometry.cross|minecraft:geometry.full_block_v1|d=and}}. You can also use your own model from a resource pack. | ||
This component must be included with [[#minecraft:material_instances|{{ | This component must be included with [[#minecraft:material_instances|{{MC/Cd|minecraft:material_instances}}]]. This component can be specified in two ways. | ||
* '''As a string:''' | * '''As a string:''' | ||
| Line 396: | Line 396: | ||
Fields: | Fields: | ||
* '''{{ | * '''{{MC/Cd|bone_visibility}}''': | ||
** ''Optional.'' Defines the visibility of each bone. All bones are visible by default. | ** ''Optional.'' Defines the visibility of each bone. All bones are visible by default. | ||
** A key-value map of bone names from the model to [[Minecraft:molang]] expressions that result in boolean values. | ** A key-value map of bone names from the model to [[Minecraft:molang]] expressions that result in boolean values. | ||
* '''{{ | * '''{{MC/Cd|culling}}''': | ||
** ''Optional.'' An identifier of a culling definition. | ** ''Optional.'' An identifier of a culling definition. | ||
* '''{{ | * '''{{MC/Cd|culling_layer}}''': | ||
** ''Optional.'' A string to group multiple blocks when comparing them in a culling rule. Default is {{ | ** ''Optional.'' A string to group multiple blocks when comparing them in a culling rule. Default is {{MC/Cd|minecraft:culling_layer.undefined}} but there is also {{MC/Cd|minecraft:culling_layer.leaves}} as vanilla. | ||
* '''{{ | * '''{{MC/Cd|culling_shape}}''':{{OnlyExperimental|Experimental Voxel Shape Features}} | ||
** ''Optional.'' An identifier of a voxel shape definition. | ** ''Optional.'' An identifier of a voxel shape definition. | ||
** Vanilla shapes are {{ | ** Vanilla shapes are {{MC/Cd|minecraft:unit_cube|minecraft:empty|d=and}}. | ||
* '''{{ | * '''{{MC/Cd|identifier}}''': | ||
** The identifier of the block model to use. | ** The identifier of the block model to use. | ||
* '''{{ | * '''{{MC/Cd|uv_lock}}''': | ||
** ''Optional.'' Sets whether UVs should be locked to their original rotations, regardless of the [[#minecraft:transformation|{{ | ** ''Optional.'' Sets whether UVs should be locked to their original rotations, regardless of the [[#minecraft:transformation|{{MC/Cd|minecraft:transformation}}]] component. | ||
** Can be an array of bone names to lock, {{ | ** Can be an array of bone names to lock, {{MC/Cd|false}} (default) which locks none, or {{MC/Cd|true}} which locks all bones. | ||
Example: | Example: | ||
| Line 432: | Line 432: | ||
Fields: | Fields: | ||
* '''{{ | * '''{{MC/Cd|geometry}}''': | ||
** A [[#minecraft:geometry|{{ | ** A [[#minecraft:geometry|{{MC/Cd|minecraft:geometry}}]] component defining the geometry of the block item. | ||
* '''{{ | * '''{{MC/Cd|material_instances}}''': | ||
** A [[#minecraft:material_instances|{{ | ** A [[#minecraft:material_instances|{{MC/Cd|minecraft:material_instances}}]] component defining the material of the block item. | ||
Example: | Example: | ||
| Line 467: | Line 467: | ||
=== <code>minecraft:light_dampening</code> === | === <code>minecraft:light_dampening</code> === | ||
Sets the number of | Sets the number of light levels that will be dampened by the block. This component is specified as an integer between 0 and 15, where 15 blocks all light. | ||
Example: | Example: | ||
| Line 486: | Line 486: | ||
=== <code>minecraft:liquid_detection</code> === | === <code>minecraft:liquid_detection</code> === | ||
Defines how the block responds to | Defines how the block responds to liquids. | ||
Structure: | Structure: | ||
<div class="treeview"> | <div class="treeview"> | ||
* {{ | * {{MC/Nbt|compound|minecraft:liquid_detection}}: The component root. | ||
** {{ | ** {{MC/Nbt|list|detection_rules}}: An array of liquid rules. | ||
*** {{ | *** {{MC/Nbt|compound}}: ''A rule'' | ||
**** {{ | **** {{MC/Nbt|bool|can_contain_liquid}}: {{MC/Cd|true}} or {{MC/Cd|false}} whether the liquid can occupy the same space as the block. In other words, can it be waterlogged? | ||
**** {{ | **** {{MC/Nbt|string|liquid_type}}: The type of liquid this rule applies to. Currently, the only available value is {{MC/Cd|water}}. | ||
**** {{ | **** {{MC/Nbt|string|on_liquid_touches}}: ''Optional.'' Sets what happens when liquid touches the block. Available values are: | ||
***** {{ | ***** {{MC/Cd|blocking}}: ''Default.'' The block stops liquid from flowing through it. | ||
***** {{ | ***** {{MC/Cd|broken}}: The block is destroyed on contact with flowing liquid. | ||
***** {{ | ***** {{MC/Cd|popped}}: The block breaks and drops its loot on contact with flowing liquid. | ||
***** {{ | ***** {{MC/Cd|no_reaction}}: Liquids flow through the block as if it is not there. | ||
**** {{ | **** {{MC/Nbt|list|stops_liquid_flowing_from_direction}}: ''Optional.'' An array of directions from which liquid can not flow out of (or in to, if {{MC/Cd|on_liquid_touches}} is set to {{MC/Cd|no_reaction}}) the block. | ||
**** {{ | **** {{MC/Nbt|bool|use_liquid_clipping}}: {{MC/Cd|true}} means the block will use the [[#minecraft:collision_box|{{MC/Cd|minecraft:collision_box}}]] to visually clip the water like the [[Minecraft:stairs]], {{MC/Cd|false}} ignores liquid clipping, which will render water across the whole block how current behavior. | ||
</div> | </div> | ||
| Line 557: | Line 557: | ||
Fields: | Fields: | ||
* '''{{ | * '''{{MC/Cd|color}}''': | ||
** The color to use on the map. | ** The color to use on the map. | ||
** This is specified as an RGB array, or an hex string, as described above. | ** This is specified as an RGB array, or an hex string, as described above. | ||
* '''{{ | * '''{{MC/Cd|tint_method}}''': | ||
** ''Optional.'' The method to use to [[Minecraft:Biome#Tint|tint]] the color based on the [[Minecraft:biome]]. Available values are {{ | ** ''Optional.'' The method to use to [[Minecraft:Biome#Tint|tint]] the color based on the [[Minecraft:biome]]. Available values are {{MC/Cd|none|default_foliage|birch_foliage|evergreen_foliage|dry_foliage|grass|water|d=and}}. | ||
Example: | Example: | ||
| Line 573: | Line 573: | ||
=== <code>minecraft:material_instances</code> === | === <code>minecraft:material_instances</code> === | ||
Defines the materials and textures of the block. This component must be included with [[#minecraft:geometry|{{ | Defines the materials and textures of the block. This component must be included with [[#minecraft:geometry|{{MC/Cd|minecraft:geometry}}]]. | ||
Structure: | Structure: | ||
<div class="treeview"> | <div class="treeview"> | ||
* {{ | * {{MC/Nbt|compound|minecraft:material_instances}}: The component root. | ||
** {{ | ** {{MC/Nbt|string}}{{nbt|compound|'''*'{{!}}<block face>{{!}}<material name>''}}: A material instance definition, or the name of a material instance. The name of the property can be the name of a block face, a "*" to map to all block faces, or a custom name to define a material instance. | ||
*** {{ | *** {{MC/Nbt|boolean}}{{MC/Nbt|float|ambient_occlusion}}: ''Optional.'' Whether the block should have ambient occlusion, and its intensity. | ||
*** {{ | *** {{MC/Nbt|boolean|face_dimming}}: ''Optional.'' Sets if these faces are dimmed by their direction. | ||
*** {{ | *** {{MC/Nbt|boolean|isotropic}}: ''Optional.'' Should the UVs for these faces be randomly rotated based on position? | ||
*** {{ | *** {{MC/Nbt|string|render_method}}: ''Optional.'' The block's render method. | ||
**** {{ | **** {{MC/Cd|opaque}}: ''Default.'' Non-transparent texture, viewable from the full render distance. | ||
**** {{ | **** {{MC/Cd|alpha_test}}: Allows for transparent textures, but disables backface culling, and can only be viewed from half the render distance. | ||
**** {{ | **** {{MC/Cd|alpha_test_single_sided}}: Like {{MC/Cd|alpha_test}}, but reenables backface culling. Also can only be viewed from half the render distance. | ||
**** {{ | **** {{MC/Cd|blend}}: Allows for texture translucency, but disables backface culling. | ||
**** {{ | **** {{MC/Cd|double_sided}}: Like {{MC/Cd|opaque}}, but disables backface culling. | ||
**** {{ | **** {{MC/Cd|alpha_test_to_opaque}}: {{MC/Cd|alpha_test}}, but past half the render distance it shifts to {{MC/Cd|opaque}}, like [[Minecraft:leaves]]. | ||
**** {{ | **** {{MC/Cd|alpha_test_single_sided_to_opaque}}: {{MC/Cd|alpha_test_single_sided}}, but past half the render distance it shifts to {{MC/Cd|opaque}}. | ||
**** {{ | **** {{MC/Cd|blend_to_opaque}}: {{MC/Cd|blend}}, but past half the render distance it shifts to {{MC/Cd|opaque}}. | ||
*** {{ | *** {{MC/Nbt|string|texture}}: Defines the texture for the material instance. This is the name of a texture defined within {{MC/Cd|terrain_texture.json}}. | ||
*** {{ | *** {{MC/Nbt|string|tint_method}}: ''Optional.'' Sets the method with which to [[Minecraft:Biome#Tint|tint]] the texture based on the biome. Available values are {{MC/Cd|none|default_foliage|birch_foliage|evergreen_foliage|dry_foliage|grass|water|d=and}}. | ||
</div> | </div> | ||
| Line 609: | Line 609: | ||
=== <code>minecraft:movable</code> === | === <code>minecraft:movable</code> === | ||
Determines the block's behavior when being pushed or pulled by a [[Minecraft:piston]]. If trait [[Minecraft:Block definition#minecraft:multi_block| {{ | Determines the block's behavior when being pushed or pulled by a [[Minecraft:piston]]. If trait [[Minecraft:Block definition#minecraft:multi_block| {{MC/Cd|minecraft:multi_block}}]] is defined, the component cannot be used in permutations, and the only available {{MC/Cd|movement_type}} are {{MC/Cd|popped|immovable|d=and}}. | ||
Fields: | Fields: | ||
* '''{{ | * '''{{MC/Cd|movement_type}}''': | ||
** How the block will react to a piston. | ** How the block will react to a piston. | ||
** Can be {{ | ** Can be {{MC/Cd|push_pull|push|popped|immovable|d=or}}. | ||
* '''{{ | * '''{{MC/Cd|sticky}}''': | ||
** ''Optional.'' Whether or not the block affects nearby blocks when pushed or pulled, allowing behavior similar to [[Minecraft:Slime Block|slime]] or [[Minecraft:Honey Block|honey]] blocks. | ** ''Optional.'' Whether or not the block affects nearby blocks when pushed or pulled, allowing behavior similar to [[Minecraft:Slime Block|slime]] or [[Minecraft:Honey Block|honey]] blocks. | ||
** Can be {{ | ** Can be {{MC/Cd|same|none|d=or}}. Default is {{MC/Cd|none}}. | ||
Example: | Example: | ||
| Line 629: | Line 629: | ||
=== <code>minecraft:placement_filter</code> === | === <code>minecraft:placement_filter</code> === | ||
Defines the conditions in which the block can survive. If the conditions are not met, the block can not be placed, and if it already exists, it will break and drop itself. If trait [[Minecraft:Block definition#minecraft:multi_block| {{ | Defines the conditions in which the block can survive. If the conditions are not met, the block can not be placed, and if it already exists, it will break and drop itself. If trait [[Minecraft:Block definition#minecraft:multi_block| {{MC/Cd|minecraft:multi_block}}]] is defined, the component it cannot be used in permutations. | ||
Structure: | Structure: | ||
<div class="treeview"> | <div class="treeview"> | ||
* {{ | * {{MC/Nbt|compound|minecraft:placement_filter}}: The component root. | ||
** {{ | ** {{MC/Nbt|list|conditions}}: A list of conditions. | ||
*** {{ | *** {{MC/Nbt|compound}} ''A condition'' | ||
**** {{ | **** {{MC/Nbt|list|allowed_faces}}: ''Optional.'' A list of allowed faces the block can be placed on, or {{MC/Cd|all}} for all faces. | ||
**** {{ | **** {{MC/Nbt|list|block_filter}}: ''Optional.'' A list of blocks that this block can be placed on. | ||
***** {{ | ***** {{MC/Nbt|compound}} ''A filter'' | ||
****** {{ | ****** {{MC/Nbt|string|name}}: ''Optional.'' The block identifier. | ||
****** {{ | ****** {{MC/Nbt|compound|states}}: ''Optional.'' A key-value map of block states to required values. | ||
****** {{ | ****** {{MC/Nbt|string|tags}}: ''Optional.'' A molang expression defining the [[Minecraft:Block tag (Bedrock Edition)|tags]] for the block. | ||
</div> | </div> | ||
| Line 663: | Line 663: | ||
=== <code>minecraft:precipitation_interactions</code> === | === <code>minecraft:precipitation_interactions</code> === | ||
Defines how the block is affected by | Defines how the block is affected by precipitation. If the block has [[#minecraft:collision_box|{{MC/Cd|minecraft:collision_box}}]] that is not false, it will not be possible to use {{MC/Cd|snow_log_no_collision}}. | ||
Structure: | Structure: | ||
<div class="treeview"> | <div class="treeview"> | ||
* {{ | * {{MC/Nbt|compound|minecraft:precipitation_interactions}}: The component root. | ||
** {{ | ** {{MC/Nbt|string|precipitation_behavior}}: The block's behavior with precipitation. | ||
*** {{ | *** {{MC/Cd|obstruct_rain_accumulate_snow}}: ''Default.'' Rain particles will land on the block, and snow layers will accumulate if it is snowing. | ||
*** {{ | *** {{MC/Cd|obstruct_rain}}: Rain particles will land on the block, but snow will not accumulate. | ||
*** {{ | *** {{MC/Cd|none}}: Rain and snow will pass through the block. | ||
*** {{ | *** {{MC/Cd|snow_log_no_collision}}:{{MC/Upcoming|be 26.20}}{{OnlyExperimental|Upcoming Creator Features}} Snow will accumulate inside the block if it is snowing, causing it to become snowlogged. | ||
</div> | </div> | ||
| Line 685: | Line 685: | ||
=== <code>minecraft:random_offset</code> === | === <code>minecraft:random_offset</code> === | ||
Allows the block's model to be randomly offset, similar to | Allows the block's model to be randomly offset, similar to short grass. The chosen offset is still subject to the block model limits. | ||
Due to current limitations, this component causes the block to be shadowed if it intersects another block. | Due to current limitations, this component causes the block to be shadowed if it intersects another block. | ||
| Line 691: | Line 691: | ||
<div class="treeview"> | <div class="treeview"> | ||
* {{ | * {{MC/Nbt|compound|minecraft:random_offset}}: The component root. | ||
** {{ | ** {{MC/Nbt|compound|''<axis>''}}: The settings for the axis ({{MC/Cd|x|y|z|d=or}}). | ||
*** {{ | *** {{MC/Nbt|int|steps}}: The number of possible values within the range to be chosen from. 0 means any value within the range can be chosen. | ||
*** {{ | *** {{MC/Nbt|compound|range}}: The range of values to choose from. | ||
**** {{ | **** {{MC/Nbt|float|max}}: The maximum possible value. | ||
**** {{ | **** {{MC/Nbt|float|min}}: The minimun possible value. | ||
</div> | </div> | ||
| Line 728: | Line 728: | ||
=== <code>minecraft:redstone_conductivity</code> === | === <code>minecraft:redstone_conductivity</code> === | ||
Defines how the block conducts | Defines how the block conducts redstone power. | ||
Structure: | Structure: | ||
<div class="treeview"> | <div class="treeview"> | ||
* {{ | * {{MC/Nbt|compound|minecraft:redstone_conductivity}}: The component root. | ||
** {{ | ** {{MC/Nbt|boolean|allows_wire_to_step_down}}: ''Optional.'' Sets whether redstone wire can step down the side of this block. | ||
** {{ | ** {{MC/Nbt|boolean|redstone_conductor}}: ''Optional.'' Sets whether the block conducts redstone. | ||
</div> | </div> | ||
| Line 749: | Line 749: | ||
=== <code>minecraft:redstone_consumer</code> === | === <code>minecraft:redstone_consumer</code> === | ||
Allows the block to consume a redstone signal, sending the {{ | Allows the block to consume a redstone signal, sending the {{MC/Cd|onRedstoneUpdate}} custom component event to scripts when the power changes. | ||
Structure: | Structure: | ||
<div class="treeview"> | <div class="treeview"> | ||
* {{ | * {{MC/Nbt|compound|minecraft:redstone_consumer}}: The component root. | ||
** {{ | ** {{MC/Nbt|int|min_power}}: ''Optional.'' Sets the minimum power required to trigger the script event. Must be between 0 and 15. | ||
** {{ | ** {{MC/Nbt|boolean|propagates_power}}: ''Optional.'' Sets whether a redstone signal will pass through this block. | ||
</div> | </div> | ||
| Line 774: | Line 774: | ||
<div class="treeview"> | <div class="treeview"> | ||
* {{ | * {{MC/Nbt|compound|minecraft:redstone_producer}}: The component root. | ||
** {{ | ** {{MC/Nbt|int|power}}: Sets the power level that this block produces. Must be between 0 and 15. | ||
** {{ | ** {{MC/Nbt|string|strongly_powered_face}}: ''Optional.'' Determines the face of the block that strongly powers the block it is connected to. | ||
** {{ | ** {{MC/Nbt|list|connected_faces}}: ''Optional.'' A list of the faces of the block that emit redstone power. | ||
** {{ | ** {{MC/Nbt|boolean|transform_relative}}: ''Optional.'' Whether the faces selected should be relative to the [[#minecraft:transformation|{{MC/Cd|minecraft:transformation}}]] component. | ||
</div> | </div> | ||
| Line 793: | Line 793: | ||
=== <code>minecraft:replaceable</code> === | === <code>minecraft:replaceable</code> === | ||
Allows the block to be replaced when another block is placed in its position, like | Allows the block to be replaced when another block is placed in its position, like short grass. | ||
This component is specified as an empty object. | This component is specified as an empty object. | ||
| Line 806: | Line 806: | ||
This component can be defined in two ways. | This component can be defined in two ways. | ||
* '''As a boolean ({{ | * '''As a boolean ({{MC/Cd|true}} or {{MC/Cd|false}}) value:''' | ||
A value of {{ | A value of {{MC/Cd|true}} creates the default full block selection box. | ||
A value of {{ | A value of {{MC/Cd|false}} makes the block not selectable by players. | ||
Example: | Example: | ||
| Line 821: | Line 821: | ||
Fields: | Fields: | ||
* '''{{ | * '''{{MC/Cd|origin}}''': | ||
** The origin of the selection box. (0,0,0) represents the bottom center of the block. | ** The origin of the selection box. (0,0,0) represents the bottom center of the block. | ||
* '''{{ | * '''{{MC/Cd|size}}''': | ||
** The size of the selection box. The total size of the selection box may not be larger than 16×16×16. | ** The size of the selection box. The total size of the selection box may not be larger than 16×16×16. | ||
| Line 837: | Line 837: | ||
=== <code>minecraft:support</code> === | === <code>minecraft:support</code> === | ||
Defines the shape of the block with regards to how it can support other blocks like | Defines the shape of the block with regards to how it can support other blocks like torches. This component cannot be used in permutations. | ||
Structure: | Structure: | ||
<div class="treeview"> | <div class="treeview"> | ||
* {{ | * {{MC/Nbt|compound|minecraft:support}}: The component root. | ||
** {{ | ** {{MC/Nbt|string|shape}}: The support shape of the block. If the component is omitted, the default is unit cube (all sides give support). | ||
*** <code>stair</code>: Uses the shape of a | *** <code>stair</code>: Uses the shape of a stair (bottom and back give support). This requires the <code>minecraft:vertical_half</code> block state, and either state from the <code>minecraft:placement_direction</code> block trait. | ||
*** <code>fence</code>: Uses the shape of a [[Minecraft:fence]] (bottom and top give support). | *** <code>fence</code>: Uses the shape of a [[Minecraft:fence]] (bottom and top give support). | ||
</div> | </div> | ||
| Line 857: | Line 857: | ||
=== <code>minecraft:tags</code> === | === <code>minecraft:tags</code> === | ||
{{In development|be||26.20|section=1}} | {{MC/In development|be||26.20|section=1}} | ||
Defines the block's [[Minecraft:Block tag (Bedrock Edition)|tags]]. Tags are used to categorize blocks and allow them to work better with vanilla blocks and items. Both vanilla and custom block tags can be added. This component is defined as an array. | Defines the block's [[Minecraft:Block tag (Bedrock Edition)|tags]]. Tags are used to categorize blocks and allow them to work better with vanilla blocks and items. Both vanilla and custom block tags can be added. This component is defined as an array. | ||
| Line 864: | Line 864: | ||
<div class="treeview"> | <div class="treeview"> | ||
* {{ | * {{MC/Nbt|list|minecraft:tags}}: The list of tags for this block. | ||
</div> | </div> | ||
| Line 880: | Line 880: | ||
<div class="treeview"> | <div class="treeview"> | ||
* {{ | * {{MC/Nbt|compound|minecraft:tick}}: The component root. | ||
** {{ | ** {{MC/Nbt|list|interval_range}}: The minimum and maximum possible time between block ticks. The time values are specified in ticks. | ||
** {{ | ** {{MC/Nbt|boolean|looping}}: ''Optional.'' Whether the block should continue to tick after the first tick. | ||
</div> | </div> | ||
| Line 901: | Line 901: | ||
<div class="treeview"> | <div class="treeview"> | ||
* {{ | * {{MC/Nbt|compound|minecraft:transformation}}: The component root. | ||
** {{ | ** {{MC/Nbt|list|rotation}}: ''Optional.'' The rotation values around each axis. | ||
** {{ | ** {{MC/Nbt|list|rotation_pivot}}: ''Optional.'' The point to apply rotation around. Defaults to the center of the block. | ||
** {{ | ** {{MC/Nbt|list|scale}}: ''Optional.'' The scale amount for each axis. | ||
** {{ | ** {{MC/Nbt|list|scale_pivot}}: ''Optional.'' The point to apply scaling around. Defaults to the center of the block. | ||
** {{ | ** {{MC/Nbt|list|translation}}: ''Optional.'' The distance on each axis to translate the block's geometry. | ||
</div> | </div> | ||
| Line 919: | Line 919: | ||
== Custom components == | == Custom components == | ||
Custom block components allow for custom blocks to take advantage of | Custom block components allow for custom blocks to take advantage of script API capabilities. Custom components are registered in scripts using the method {{MC/Cd|StartupEvent.blockComponentRegistry.registerCustomComponent()}}. | ||
Custom components can be added to blocks the same way as any other component, using the namespaced [[Minecraft:identifier]] the component was registered with. Custom components can have arguments of any type, which will be passed to scripts as the second argument. | Custom components can be added to blocks the same way as any other component, using the namespaced [[Minecraft:identifier]] the component was registered with. Custom components can have arguments of any type, which will be passed to scripts as the second argument. | ||
| Line 936: | Line 936: | ||
In scripts, the custom component object can have methods added to listen to any amount of the following events<ref>{{cite|url=https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/blockcustomcomponent?view=minecraft-bedrock-stable|title=minecraft/server.BlockCustomComponent Interface|website=Microsoft Learn|date=December 3, 2025}}</ref>: | In scripts, the custom component object can have methods added to listen to any amount of the following events<ref>{{cite|url=https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/blockcustomcomponent?view=minecraft-bedrock-stable|title=minecraft/server.BlockCustomComponent Interface|website=Microsoft Learn|date=December 3, 2025}}</ref>: | ||
* {{ | * {{MC/Cd|beforeOnPlayerPlace}}: Called before the player places the block. | ||
* {{ | * {{MC/Cd|onBlockStateChange}}: Called when an block has its state changed.{{MC/Upcoming|BE 26.20}}{{OnlyExperimental|Beta APIs}} | ||
* {{ | * {{MC/Cd|onBreak}}: Called when the block is destroyed. | ||
* {{ | * {{MC/Cd|onEntity}}: Called when an entity sends an event to the block. | ||
* {{ | * {{MC/Cd|onEntityFallOn}}: Called when an entity falls onto the block. This requires the [[#minecraft:entity_fall_on|{{MC/Cd|minecraft:entity_fall_on}}]] component. | ||
* {{ | * {{MC/Cd|onPlace}}: Called when the block is placed. | ||
* {{ | * {{MC/Cd|onPlayerBreak}}: Called when the block is destroyed by a player. | ||
* {{ | * {{MC/Cd|onPlayerInteract}}: Called when a player interacts with the block. | ||
* {{ | * {{MC/Cd|onRandomTick}}: Called when the block is randomly ticked. | ||
* {{ | * {{MC/Cd|onRedstoneUpdate}}: Called when the block receives a redstone update. This requires the [[#minecraft:redstone_consumer|{{MC/Cd|minecraft:redstone_consumer}}]] component, and will only be called if the signal power is greater than or equal to the {{MC/Cd|min_power}} set in the component. | ||
* {{ | * {{MC/Cd|onStepOff}}: Called when an entity steps off the block. | ||
* {{ | * {{MC/Cd|onStepOn}}: Called when an entity steps on to the block. | ||
* {{ | * {{MC/Cd|onTick}}: Called when the block ticks (As specified by the [[#minecraft:tick|{{MC/Cd|minecraft:tick}}]] component). | ||
== History == | == History == | ||
{{Missing information|section|Information about many components.}} | {{MC/Missing information|section|Information about many components.}} | ||
{{HistoryTable | {{HistoryTable | ||
|{{HistoryLine|bedrock}} | |{{MC/HistoryLine|bedrock}} | ||
|{{HistoryLine||?|Block components were added.}} | |{{MC/HistoryLine||?|Block components were added.}} | ||
|{{HistoryLine||1.21.50|dev=Preview 1.21.50.20|Updated [[#minecraft:destructible_by_mining|{{ | |{{HistoryLine||1.21.50|dev=Preview 1.21.50.20|Updated [[#minecraft:destructible_by_mining|{{MC/Cd|minecraft:destructible_by_mining}}]] component, new field {{MC/Cd|item_specific_speeds}} no longer experimental.}} | ||
|{{HistoryLine|||dev=Preview 1.21.50.26|Added the [[#minecraft:liquid_detection|{{ | |{{HistoryLine|||dev=Preview 1.21.50.26|Added the [[#minecraft:liquid_detection|{{MC/Cd|minecraft:liquid_detection}}]] component. The only supported liquid is {{MC/Cd|water}}.}} | ||
|{{HistoryLine||1.21.50|dev=Preview 1.21.50.26|exp=Upcoming Creator Features|Added the [[#minecraft:item_visual|{{ | |{{HistoryLine||1.21.50|dev=Preview 1.21.50.26|exp=Upcoming Creator Features|Added the [[#minecraft:item_visual|{{MC/Cd|minecraft:item_visual}}]] component.}} | ||
|{{HistoryLine|||dev=Preview 1.21.50.28|Modified {{ | |{{HistoryLine|||dev=Preview 1.21.50.28|Modified {{MC/Cd|ambient_occlusion}} field for [[#minecraft:material_instances|{{MC/Cd|minecraft:material_instances}}]] component to be a float value.}} | ||
|{{HistoryLine||1.21.60|dev=Preview 1.21.60.21|Removed Upcoming Creator Features experiment requirement for [[#minecraft:item_visual|{{Cd|minecraft:item_visual}}]] component.|Removed "Upcoming Creator Features" experiment requirement for the {{ | |{{HistoryLine||1.21.60|dev=Preview 1.21.60.21|Removed Upcoming Creator Features experiment requirement for [[#minecraft:item_visual|{{MC/Cd|minecraft:item_visual}}]] component.|Removed "Upcoming Creator Features" experiment requirement for the {{MC/Cd|ambient_occlusion}} field in the [[#minecraft:material_instances|{{MC/Cd|minecraft:material_instances}}]] component.}} | ||
|{{HistoryLine||1.21.60|dev=Preview 1.21.60.21|exp=Upcoming Creator Features|Removing a waterlogged custom block using the [[#minecraft:liquid_detection|{{ | |{{HistoryLine||1.21.60|dev=Preview 1.21.60.21|exp=Upcoming Creator Features|Removing a waterlogged custom block using the [[#minecraft:liquid_detection|{{MC/Cd|minecraft:liquid_detection}}]] component with {{MC/Cd|stopsLiquidFlowingFromDirection}} enabled for all directions now results in flowing water rather than a stagnant block of water.}} | ||
|{{HistoryLine||1.21.60|dev=Preview 1.21.60.24|[[#minecraft:liquid_detection|{{ | |{{HistoryLine||1.21.60|dev=Preview 1.21.60.24|[[#minecraft:liquid_detection|{{MC/Cd|minecraft:liquid_detection}}]] no longer requires the Upcoming Creator Features experiment.}} | ||
|{{HistoryLine||1.21.70|dev=Preview 1.21.70.20|[[#minecraft:map_color|{{ | |{{HistoryLine||1.21.70|dev=Preview 1.21.70.20|[[#minecraft:map_color|{{MC/Cd|minecraft:map_color}}]] is now a JSON object with two fields: {{MC/Cd|color}} and {{MC/Cd|tint_method}}. The old format is still supported.|Added the [[#minecraft:replaceable|{{MC/Cd|minecraft:replaceable}}]] component.}} | ||
|{{HistoryLine||1.21.70|dev=Preview 1.21.70.23|exp=Upcoming Creator Features|[[#minecraft:material_instances|{{ | |{{HistoryLine||1.21.70|dev=Preview 1.21.70.23|exp=Upcoming Creator Features|[[#minecraft:material_instances|{{MC/Cd|minecraft:material_instances}}]] now has a new boolean field {{MC/Cd|isotropic}}.}} | ||
|{{HistoryLine||1.21.70|dev=Preview 1.21.70.24|[[#minecraft:material_instances|{{ | |{{HistoryLine||1.21.70|dev=Preview 1.21.70.24|[[#minecraft:material_instances|{{MC/Cd|minecraft:material_instances}}]] now supports an optional {{MC/Cd|tint_method}} field.}} | ||
|{{HistoryLine|||dev=Preview 1.21.70.25|Added [[#minecraft:destruction_particles|{{ | |{{HistoryLine|||dev=Preview 1.21.70.25|Added [[#minecraft:destruction_particles|{{MC/Cd|minecraft:destruction_particles}}]].|Added the {{MC/Cd|dry_foliage}} tint method.}} | ||
|{{HistoryLine||1.21.80|dev=Preview 1.21.80.21|exp=Upcoming Creator Features|The texture field in [[#minecraft:destruction_particles|{{ | |{{HistoryLine||1.21.80|dev=Preview 1.21.80.21|exp=Upcoming Creator Features|The texture field in [[#minecraft:destruction_particles|{{MC/Cd|minecraft:destruction_particles}}]] is now optional; if not provided or empty, it will be populated from the Material Instances component.}} | ||
|{{HistoryLine||1.21.80|dev=Preview 1.21.80.22|Removed Upcoming Creator Features experiment requirement for field {{ | |{{HistoryLine||1.21.80|dev=Preview 1.21.80.22|Removed Upcoming Creator Features experiment requirement for field {{MC/Cd|isotropic}} in [[#minecraft:material_instances|{{MC/Cd|minecraft:material_instances}}]] component.|From 1.21.80 onward, when using a [[#minecraft:geometry|{{MC/Cd|minecraft:geometry}}]] component or [[#minecraft:material_instances|{{MC/Cd|minecraft:material_instances}}]] component, you must include both.}} | ||
|{{HistoryLine|||dev=Preview 1.21.80.25|Added {{ | |{{HistoryLine|||dev=Preview 1.21.80.25|Added {{MC/Cd|blend_to_opaque|alpha_test_to_opaque|alpha_test_single_sided_to_opaque|d=and}} {{MC/Cd|render_method}} types to [[#minecraft:material_instances|{{MC/Cd|minecraft:material_instances}}]].|The field {{MC/Cd|tint_method}} in the {{MC/Cd|minecraft:map_color|minecraft:destruction_particles|minecraft:material_instances|d=and}} components no longer require the "upcoming creator feeatures" toggle.}} | ||
|{{HistoryLine||1.21.90|dev=Preview 1.21.90.20|Removed component {{ | |{{HistoryLine||1.21.90|dev=Preview 1.21.90.20|Removed component {{MC/Cd|minecraft:custom_components}} now replaced by custom component V2 in JSON versions 1.21.90 and higher.|Updated [[#minecraft:material_instances|{{MC/Cd|minecraft:material_instances}}]] | ||
Updated the {{ | Updated the {{MC/Cd|*}} instance to be optional.}} | ||
|{{HistoryLine||1.21.90|dev=Preview 1.21.90.21|exp=Upcoming Creator Features|Added field {{ | |{{HistoryLine||1.21.90|dev=Preview 1.21.90.21|exp=Upcoming Creator Features|Added field {{MC/Cd|uv_lock}} to [[#minecraft:geometry|{{MC/Cd|minecraft:geometry}}]] block component behind Upcoming Creator Features experiment.|Updated [[#minecraft:destruction_particles|{{MC/Cd|minecraft:destruction_particles}}]] added {{MC/Cd|particle_count}} parameter which determines how many particles are created when the block is destroyed (0-255).}} | ||
|{{HistoryLine|||dev=Preview 1.21.90.23|Added [[#minecraft:random_offset|{{ | |{{HistoryLine|||dev=Preview 1.21.90.23|Added [[#minecraft:random_offset|{{MC/Cd|minecraft:random_offset}}]] component under the Upcoming Creator Features toggle. This allows for blocks to randomly offset like foliage does in the Vanilla game.}} | ||
|{{HistoryLine||1.21.90|dev=Preview 1.21.90.25|Updated [[#minecraft:geometry|{{ | |{{HistoryLine||1.21.90|dev=Preview 1.21.90.25|Updated [[#minecraft:geometry|{{MC/Cd|minecraft:geometry}}]], released {{MC/Cd|culling_layer}} parameter from experimental.|UV locking will not be supported if Block Json {{MC/Cd|format_version}} is less than {{MC/Cd|1.19.80}}.}} | ||
|{{HistoryLine||1.21.90|dev=Preview 1.21.90.26|exp=Upcoming Creator Features|Added [[#minecraft:movable|{{ | |{{HistoryLine||1.21.90|dev=Preview 1.21.90.26|exp=Upcoming Creator Features|Added [[#minecraft:movable|{{MC/Cd|minecraft:movable}}]] component under the "Upcoming Creator Features" toggle. This allows for blocks to configure how they should react when moved by a [[Minecraft:piston]].}} | ||
|{{HistoryLine||1.21.90|dev=Preview 1.21.90.27|The render methods {{ | |{{HistoryLine||1.21.90|dev=Preview 1.21.90.27|The render methods {{MC/Cd|alpha_test_to_opaque|alpha_test_single_sided_to_opaque|blend_to_opaque|d=and}} will not shift to opaque in the distance.}} | ||
|{{HistoryLine||1.21.100|dev= Preview 1.21.100.20|The field {{ | |{{HistoryLine||1.21.100|dev= Preview 1.21.100.20|The field {{MC/Cd|uv_lock}} in the component [[#minecraft:geometry|{{MC/Cd|minecraft:geometry}}]] no longer requires experiment in format version of 1.19.80 or higher.}} | ||
|{{HistoryLine|||dev=Preview 1.21.100.21|Field {{ | |{{HistoryLine|||dev=Preview 1.21.100.21|Field {{MC/Cd|uv_lock}} in the component [[#minecraft:geometry|{{MC/Cd|minecraft:geometry}}]] now requires format version of 1.21.90 or higher.|{{MC/Cd|alpha_test_to_opaque|alpha_test_single_sided_to_opaque|blend_to_opaque|d=and}} will now shift to {{MC/Cd|opaque}} in the distance again when used as render method in [[#minecraft:material_instances|{{MC/Cd|minecraft:material_instances}}]].|The component [[#minecraft:movable|{{MC/Cd|minecraft:movable}}]] no longer requires experiment.}} | ||
|{{HistoryLine|||dev=Preview 1.21.100.22|Released the component [[#minecraft:random_offset|{{ | |{{HistoryLine|||dev=Preview 1.21.100.22|Released the component [[#minecraft:random_offset|{{MC/Cd|minecraft:random_offset}}]] from experimental for block format versions 1.21.100 or higher.}} | ||
|{{HistoryLine|||dev=Preview 1.21.100.23|Released {{ | |{{HistoryLine|||dev=Preview 1.21.100.23|Released {{MC/Cd|particle_count}} parameter in component [[#minecraft:destruction_particles|{{MC/Cd|minecraft:destruction_particles}}]] from experimental.}} | ||
|{{HistoryLine||1.21.111|dev= Preview 1.21.110.25|exp=Upcoming Creator Features|Added components {{ | |{{HistoryLine||1.21.111|dev= Preview 1.21.110.25|exp=Upcoming Creator Features|Added components {{MC/Cd|minecraft:redstone_producer|minecraft:flower_pottable|minecraft:embedded_visual|d=and}}.|Modified [[#minecraft:material_instances|{{MC/Cd|minecraft:material_instances}}]] to support weighted texture variations.}} | ||
|{{HistoryLine||1.21.120|dev=Preview 1.21.120.20|exp=Upcoming Creator Features|Allow items referencing a pottable block in their [[Minecraft:item components#minecraft:block_placer|{{ | |{{HistoryLine||1.21.120|dev=Preview 1.21.120.20|exp=Upcoming Creator Features|Allow items referencing a pottable block in their [[Minecraft:item components#minecraft:block_placer|{{MC/Cd|minecraft:block_placer}}]] component to be pottable when {{MC/Cd|replace_block_item}} is true.}} | ||
|{{HistoryLine|||dev=Preview 1.21.120.22|Added [[#minecraft:precipitation_interactions|{{ | |{{HistoryLine|||dev=Preview 1.21.120.22|Added [[#minecraft:precipitation_interactions|{{MC/Cd|minecraft:precipitation_interactions}}]] component. This component allows creators to determine whether a block should obstruct precipitation or not.}} | ||
|{{HistoryLine|||dev=Preview 1.21.120.23|Added {{ | |{{HistoryLine|||dev=Preview 1.21.120.23|Added {{MC/Cd|emissive}} field to [[#minecraft:material_instances|{{MC/Cd|minecraft:material_instances}}]] component.}} | ||
|{{HistoryLine|||dev=Preview 1.21.120.24|Added boolean field {{ | |{{HistoryLine|||dev=Preview 1.21.120.24|Added boolean field {{MC/Cd|alpha_masked_tint}} to materials in [[#minecraft:material_instances|{{MC/Cd|minecraft:material_instances}}]] component.}} | ||
|{{HistoryLine||1.21.120|dev=Preview 1.21.120.24|Removed Upcoming Creator Features toggle requirement from the {{ | |{{HistoryLine||1.21.120|dev=Preview 1.21.120.24|Removed Upcoming Creator Features toggle requirement from the {{MC/Cd|minecraft:redstone_producer|minecraft:embedded_visual|minecraft:flower_pottable|d=and}}.}} | ||
|{{HistoryLine||1.21.130|dev=Preview 1.21.130.20|exp=Upcoming Creator Features|Added component [[#minecraft:support|{{ | |{{HistoryLine||1.21.130|dev=Preview 1.21.130.20|exp=Upcoming Creator Features|Added component [[#minecraft:support|{{MC/Cd|minecraft:support}}]] which allows you to specify which faces of the block can support blocks such as the [[Minecraft:torch]].}} | ||
|{{HistoryLine|||dev=Preview 1.21.130.22|The option {{ | |{{HistoryLine|||dev=Preview 1.21.130.22|The option {{MC/Cd|alpha_masked_tint}} in [[#minecraft:material_instances|{{MC/Cd|minecraft:material_instances}}]] now requires the Upcoming Creator Features toggle again.|Added component [[#minecraft:connection_rule|{{MC/Cd|minecraft:connection_rule}}]] behind the Upcoming Creator Features toggle, which allows custom blocks to define whether other blocks with connection behavior like a [[Minecraft:fence]].|Modified [[#minecraft:material_instances|{{MC/Cd|minecraft:material_instances}}]] component field {{MC/Cd|emissive}} renamed to {{MC/Cd|shaded}} to better describe what the field does and released field {{MC/Cd|shaded}}, from experimental.}} | ||
|{{HistoryLine||1.21.130|dev=Preview 1.21.130.26|Moved the [[#minecraft:precipitation_interactions|{{ | |{{HistoryLine||1.21.130|dev=Preview 1.21.130.26|Moved the [[#minecraft:precipitation_interactions|{{MC/Cd|minecraft:precipitation_interactions}}]] component from experimental to stable.}} | ||
|{{HistoryLine||1.21.130|dev=Preview 1.21.130.26|exp=Upcoming Creator Features|Extended [[#minecraft:collision_box|{{ | |{{HistoryLine||1.21.130|dev=Preview 1.21.130.26|exp=Upcoming Creator Features|Extended [[#minecraft:collision_box|{{MC/Cd|minecraft:collision_box}}]] height to 24 and added support for arrays of boxes when using a format version of 1.21.130 or higher and the Upcoming Creator Features toggle is enabled.}} | ||
|{{HistoryLine|||dev=Preview 1.21.130.27|In [[#minecraft:material_instances|{{ | |{{HistoryLine|||dev=Preview 1.21.130.27|In [[#minecraft:material_instances|{{MC/Cd|minecraft:material_instances}}]] removed redundant experimental field {{MC/Cd|shaded}}.|Added [[#minecraft:redstone_consumer|{{MC/Cd|minecraft:redstone_consumer}}]] and [[#minecraft:leashable|{{MC/Cd|minecraft:leashable}}]] components behind the Upcoming Creator Features experiment.}} | ||
|{{HistoryLine||26.0|dev=Preview 26.0.23|Added {{ | |{{HistoryLine||26.0|dev=Preview 26.0.23|Added {{MC/Cd|use_liquid_clipping}} field to the {{MC/Cd|detection_rules}} in [[#minecraft:liquid_detection|{{MC/Cd|minecraft:liquid_detection}}]] a boolean field that indicates whether water will pass through the block or not, like a stair.|Updated [[#minecraft:redstone_consumer|{{MC/Cd|minecraft:redstone_consumer}}]] renamed field {{MC/Cd|propogates_power}} to {{MC/Cd|propagates_power}} and release for format version 1.26.0 and higher.|The option {{MC/Cd|alpha_masked_tint}} in [[#minecraft:material_instances|{{MC/Cd|minecraft:material_instances}}]] no longer requires "Upcoming Creator Features".}} | ||
|{{HistoryLine|||dev=Preview 26.0.25|The components {{ | |{{HistoryLine|||dev=Preview 26.0.25|The components {{MC/Cd|minecraft:connection_rule|minecraft:support|minecraft:leashable|d=and}} can be used with format version 1.26.0 and higher without the "Upcoming Creator Features" toggle.}} | ||
|{{HistoryLine|||dev=Preview 26.0.27|Added block permutation component validation for [[#minecraft:geometry|{{ | |{{HistoryLine|||dev=Preview 26.0.27|Added block permutation component validation for [[#minecraft:geometry|{{MC/Cd|minecraft:geometry}}]] and [[#minecraft:material_instances|{{MC/Cd|minecraft:material_instances}}]]. If you add one, you need to add the other.|Rotated the down face of the {{MC/Cd|minecraft:geometry.full_block}} model by 180 degrees. The old behavior is still accessible with older {{MC/Cd|format_version}}s or the {{MC/Cd|minecraft:geometry.full_block_v1}} model.|The [[#minecraft:collision_box|{{MC/Cd|minecraft:collision_box}}]] improvements no longer require the "Upcoming Creator Features" experiment.}} | ||
|{{HistoryLine|||dev=Preview 26.0.29|Removed block permutation component validation for [[#minecraft:geometry|{{ | |{{HistoryLine|||dev=Preview 26.0.29|Removed block permutation component validation for [[#minecraft:geometry|{{MC/Cd|minecraft:geometry}}]] and [[#minecraft:material_instances|{{MC/Cd|minecraft:material_instances}}]] components.}} | ||
|{{HistoryLine||26.10|dev=Preview 26.10.20|exp=Experimental Voxel Shape Features|Added {{ | |{{HistoryLine||26.10|dev=Preview 26.10.20|exp=Experimental Voxel Shape Features|Added {{MC/Cd|culling_shape}} field to the [[#minecraft:geometry|{{MC/Cd|minecraft:geometry}}]] component.}} | ||
|{{HistoryLine|||dev=Preview 26.10.23|Experiment active in preview that may utilize the modern parsing pipeline. There are some breaking changes that may affect loading of block json with format version 26.10. Many block components have become more restricted and will miss the block if something that shouldn't happen occurs.|The format {{cd|"tag:tag_name":<nowiki>{}</nowiki>}} has been removed, and replaced by the component [[#minecraft:tags|{{ | |{{HistoryLine|||dev=Preview 26.10.23|Experiment active in preview that may utilize the modern parsing pipeline. There are some breaking changes that may affect loading of block json with format version 26.10. Many block components have become more restricted and will miss the block if something that shouldn't happen occurs.|The format {{cd|"tag:tag_name":<nowiki>{}</nowiki>}} has been removed, and replaced by the component [[#minecraft:tags|{{MC/Cd|minecraft:tags}}]], despite being mentioned as a replacement, the new format doesn't work, only the old one.}} | ||
|{{HistoryLine|||dev=Preview 26.10.25|Experiment disabled, and all changes have been disabled, including restricted components and the {{ | |{{HistoryLine|||dev=Preview 26.10.25|Experiment disabled, and all changes have been disabled, including restricted components and the {{MC/Cd|minecraft:tags}} component.}} | ||
|{{HistoryLine||26.10|dev=Preview 26.10.25|exp=Upcoming Creator Features|If trait [[Minecraft:Block definition#minecraft:multi_block| {{ | |{{HistoryLine||26.10|dev=Preview 26.10.25|exp=Upcoming Creator Features|If trait [[Minecraft:Block definition#minecraft:multi_block| {{MC/Cd|minecraft:multi_block}}]] is defined, the components [[#minecraft:movable|{{MC/Cd|minecraft:movable}}]] and [[#minecraft:placement_filter|{{MC/Cd|minecraft:placement_filter}}]] cannot be used in permutations, and movable will have some excluded types.|Added [[#minecraft:chest_obstruction|{{MC/Cd|minecraft:chest_obstruction}}]] component it defines how a block placed above a [[Minecraft:chest]] or ender chest should obstruct their opening.}} | ||
|{{HistoryLine|upcoming bedrock}} | |{{MC/HistoryLine|upcoming bedrock}} | ||
|{{HistoryLine||26.20|dev=Preview 26.20.20|[[Minecraft:Block tag (Bedrock Edition)|Block tags]] are no longer allowed as {{cd|"tag:tag_name":<nowiki>{}</nowiki>}} objects in the components list. Instead, they must be specified in the [[#minecraft:tags|{{ | |{{HistoryLine||26.20|dev=Preview 26.20.20|[[Minecraft:Block tag (Bedrock Edition)|Block tags]] are no longer allowed as {{cd|"tag:tag_name":<nowiki>{}</nowiki>}} objects in the components list. Instead, they must be specified in the [[#minecraft:tags|{{MC/Cd|minecraft:tags}}]] array component. Many block components have become more restricted. However, in practice, all the changes were not implemented despite being mentioned as having been added.|Fixed y-offset for [[#minecraft:flower_pottable|{{MC/Cd|minecraft:flower_pottable}}]] blocks in flower pots to match vanilla for format version 1.26.20+.|For {{MC/Cd|format_version}} 1.26.20+ the component [[#minecraft:redstone_producer|{{MC/Cd|minecraft:redstone_producer}}]] cannot be defined in the permutations array without defining it in the base components object as well.|Fixed [[#minecraft:placement_filter|{{MC/Cd|minecraft:placement_filter}}]] for blocks with trait [[Minecraft:Block definition#minecraft:multi_block|{{MC/Cd|minecraft:multi_block}}]] however, the block will not be destroyed when the base is broken.|[[#Custom components|Custom components]] no longer work due to a bug.<ref>{{Bug|MCPE-237057||An error is incorrectly thrown when using custom components}}</ref>}} | ||
|{{HistoryLine|||dev=Preview 26.20.21|[[Minecraft:Block tag (Bedrock Edition)|Block tags]] are no longer allowed as {{cd|"tag:tag_name":<nowiki>{}</nowiki>}} objects in the components list as it should. The component [[#minecraft:tags|{{ | |{{HistoryLine|||dev=Preview 26.20.21|[[Minecraft:Block tag (Bedrock Edition)|Block tags]] are no longer allowed as {{cd|"tag:tag_name":<nowiki>{}</nowiki>}} objects in the components list as it should. The component [[#minecraft:tags|{{MC/Cd|minecraft:tags}}]] is now being used. All restrictions are now in place as they should be in format version 1.26.20.|[[#minecraft:material_instances|{{MC/Cd|ambient_occlusion}}]] no longer supports {{MC/Cd|true|false|d=and}} values in the format version 1.26.20 only numerical values.}} | ||
|{{HistoryLine||26.20|dev=Preview 26.20.22|exp=Upcoming Creator Features|Added {{ | |{{HistoryLine||26.20|dev=Preview 26.20.22|exp=Upcoming Creator Features|Added {{MC/Cd|snow_log_no_collision}} behavior to {{MC/Cd|precipitation_behavior}} in [[#minecraft:precipitation_interactions|{{MC/Cd|minecraft:precipitation_interactions}}]] component.}} | ||
|{{HistoryLine||26.20|dev=Preview 26.20.23|[[#Custom components|Custom components]] now parse properly with the modern block definition loader.}} | |{{MC/HistoryLine||26.20|dev=Preview 26.20.23|[[#Custom components|Custom components]] now parse properly with the modern block definition loader.}} | ||
|{{HistoryLine|||dev=Preview 26.20.26|The [[#minecraft:chest_obstruction|{{ | |{{HistoryLine|||dev=Preview 26.20.26|The [[#minecraft:chest_obstruction|{{MC/Cd|minecraft:chest_obstruction}}]] component no longer requires the "Upcoming Creator Features" experiment.}} | ||
}} | }} | ||
== References == | == References == | ||
{{Reflist}} | {{MC/Reflist}} | ||
== External links == | == External links == | ||
| Line 1,016: | Line 1,016: | ||
== Navigation == | == Navigation == | ||
{{Navbox Bedrock Edition}} | {{MC/Navbox Bedrock Edition}} | ||
[[Category:Development]] | [[Category:Development]] | ||
Latest revision as of 19:54, 9 April 2026
Template:Hatnote Script error: No such module "Exclusive". Block components are Minecraft:JSON objects that are added to a custom Minecraft:block definition in a Minecraft:behavior pack to customize the Minecraft:block's behavior and visuals.
- redirect Template:TOC
Applying
Block components can be applied by adding them to
- REDIRECT Template:Code
Template:Redr within
- REDIRECT Template:Code
Template:Redr in the block's definition file.
Components can also be found in a
- REDIRECT Template:Code
Template:Redr object located in objects within the
- REDIRECT Template:Code
Template:Redr array. This can be used to make a component only active when the permutation's
- REDIRECT Template:Code
Template:Redr evaluates to
- REDIRECT Template:Code
Tags
Template:Message box Template:Article other
Tags are used to categorize blocks and allow them to work better with vanilla blocks and items. Both vanilla and custom block tags can be added. Tags are added with other components, as an empty object with the format: "tag:<tag_name>": {}
Example: <syntaxhighlight lang=json copy> "tag:minecraft:is_pickaxe_item_destructible": {} </syntaxhighlight>
Permutations
Permutations are used to make some block components active only under certain conditions. Permutations are defined in the
- REDIRECT Template:Code
Template:Redr array within
- REDIRECT Template:Code
Template:Redr, and consist of two properties:
- Template:Nbt/sprite condition: A molang expression resolving to a boolean, representing when the permutation's components should be active. This is most often a block state query. For example:
<syntaxhighlight lang=json copy> "condition": "query.block_state('minecraft:cardinal_direction') == 'north'"</syntaxhighlight>
- Template:Nbt/sprite components: The components for this permutation.
Example:
<syntaxhighlight lang=json copy> "permutations": [
{
"condition": "query.block_state('minecraft:vertical_half') == 'top'",
"components": {
"minecraft:collision_box": {
"origin": [-8,8,-8],
"size": [16,8,16]
}
}
},
{
"condition": "query.block_state('minecraft:vertical_half') == 'bottom'",
"components": {
"minecraft:collision_box": {
"origin": [-8,0,-8],
"size": [16,8,16]
}
}
}
] </syntaxhighlight>
Components list
minecraft:chest_obstruction
Template:Message boxTemplate:Article other Defines how the block should obstruct Minecraft:chests from opening when placed above one.
Structure:
- Template:Nbt/sprite minecraft:chest_obstruction: The component root.
- Template:Nbt/sprite obstruction_rule: Optional. How the block is evaluated during chest opening if the block is placed above the chest. Defaults to
shape. Valid values are:always: The block will always obstruct a chest from opening.never: The block will never obstruct a chest from opening.shape: The block's AABB shape is used to determine if a chest is obstructed from opening.
- Template:Nbt/sprite obstruction_rule: Optional. How the block is evaluated during chest opening if the block is placed above the chest. Defaults to
Example:
<syntaxhighlight lang=json copy> "minecraft:chest_obstruction": {
"obstruction_rule": "always"
} </syntaxhighlight>
minecraft:collision_box
Defines the block's collision box. This component can be specified in 3 ways.
- As a single
- REDIRECT Template:Code
- REDIRECT Template:Code
Template:Redr value:
Example:
<syntaxhighlight lang=json copy> "minecraft:collision_box": true </syntaxhighlight>
- As a JSON object:
Fields:
- REDIRECT Template:Code
- The origin of the collision box. (0,0,0) represents the bottom center of the block.
- REDIRECT Template:Code
- The size of the collision box. The total size of the collision box may not be larger than 16×24×16.
Example (Bottom half slab collision):
<syntaxhighlight lang=json copy> "minecraft:collision_box": {
"origin": [-8,0,-8], "size": [16,8,16]
} </syntaxhighlight>
- As a JSON array:
The array consists of the above object, allowing for the definition of multiple collision boxes.
Example:
<syntaxhighlight lang=json copy> "minecraft:collision_box": [
{
"origin": [-8,0,-8],
"size": [16,8,16]
},
{
"origin": [-8,8,-8],
"size": [16,8,8]
}
] </syntaxhighlight>
minecraft:connection_rule
Defines which blocks this block can connect to with the
- REDIRECT Template:Code
Template:Redr block trait.
Fields:
- REDIRECT Template:Code
- Optional. Which blocks this block can connect to. If omitted, the block accepts connections from all blocks. Allowed values are
- REDIRECT Template:Code
- REDIRECT Template:Code
- Optional. Enables connection in only certain directions, disabling others; available values are
- REDIRECT Template:Code
- REDIRECT Template:Code
- REDIRECT Template:Code
Template:Redr, and
- REDIRECT Template:Code
Example: <syntaxhighlight lang=json copy> "minecraft:connection_rule": {
"accepts_connections_from": "only_fences", "enabled_directions": ["north", "south", "east"]
} </syntaxhighlight>
minecraft:crafting_table
Gives a custom block the functionality of a crafting table.
Fields:
- REDIRECT Template:Code
- An array of recipe tags that this block should be able to craft. There can be at most 64 tags, and each tag can be at most 64 characters.
- The default tag for vanilla crafting recipes is
- REDIRECT Template:Code
Template:Redr, and custom tags can be specified to allow crafting of recipes with that tag in their definition.
- REDIRECT Template:Code
- The name to display in the crafting table UI. Specified as a localization string, or will resort to a regular string if it can't be resolved.
Example:
<syntaxhighlight lang=json copy> "minecraft:crafting_table": {
"crafting_tags": [ "crafting_table", "custom_crafting_table" ], "table_name": "Custom Crafting Table"
} </syntaxhighlight>
minecraft:destructible_by_explosion
Defines whether the block can be destroyed by explosions, and sets its blast resistance. This component can be defined in two ways.
- As a boolean (
- REDIRECT Template:Code
- REDIRECT Template:Code
Template:Redr) value:
Example:
<syntaxhighlight lang=json copy> "minecraft:destructible_by_explosion": false </syntaxhighlight>
- As a JSON object:
Fields:
- REDIRECT Template:Code
- Sets the block's resistance to explosions.
- Note that the actual blast resistance value of the block is 1/5 of the value set here.
Example (Blast resistance 6, similar to Minecraft:cobblestone):
<syntaxhighlight lang=json copy> "minecraft:destructible_by_explosion": {
"explosion_resistance": 30
} </syntaxhighlight>
minecraft:destructible_by_mining
Defines whether the block can be mined and sets its hardness. This component can be defined in two ways.
As a boolean (
- REDIRECT Template:Code
- REDIRECT Template:Code
Template:Redr) value:
A value of
- REDIRECT Template:Code
Template:Redr makes the block destructible in 0 seconds, making it able to be instant mined. A value of
- REDIRECT Template:Code
Template:Redr makes the block indestructible by mining.
Example:
<syntaxhighlight lang=json copy> "minecraft:destructible_by_mining": true </syntaxhighlight>
As a JSON object:
Structure:
- Template:Nbt/sprite minecraft:destructible_by_mining: (root of component)
- Template:Nbt/sprite item_specific_speeds
- Template:Nbt/sprite An item:
- Template:Nbt/sprite destroy_speed: The hardness of the block when mined with the target item(s).
- Template:Nbt/spriteTemplate:Nbt/sprite item: A description of the item(s). Either a string item identifier or an object.
- Template:Nbt/sprite tags: A Minecraft:Molang expression defining the tags of the target item(s).
- Template:Nbt/sprite An item:
- Template:Nbt/sprite seconds_to_destroy
- Template:Nbt/sprite item_specific_speeds
Fields:
- REDIRECT Template:Code
Template:Redr: The amount of time it takes to destroy the block. Note that this sets the block's hardness value, not the actual seconds to destroy!
- REDIRECT Template:Code
Template:Redr: Optional. Specific breaking speed values for each item, it is recommended to use tags because manually defining items can make the list unnecessarily long and remove compatibility with the enchantment Efficiency. Example: <syntaxhighlight lang=json copy> "minecraft:destructible_by_mining": {
"item_specific_speeds": [
{
"item": {
"tags": "q.all_tags('minecraft:is_pickaxe') && q.any_tag('minecraft:diamond_tier','minecraft:netherite_tier')"
},
"destroy_speed": 30
},
{
"item": "minecraft:iron_axe",
"destroy_speed": 13
}
],
"seconds_to_destroy": 100
} </syntaxhighlight>
minecraft:destruction_particles
Configures the destruction particles created when the block is destroyed.
Fields:
- REDIRECT Template:Code
- Optional. Sets the number of particles created when the block destroyed. Default is
- REDIRECT Template:Code
Template:Redr, maximum is
- REDIRECT Template:Code
- REDIRECT Template:Code
- Optional. The texture to use for the particles. This is a texture name defined in
- REDIRECT Template:Code
Template:Redr. Defaults to the texture of the
- REDIRECT Template:Code
Template:Redr material instance.
- REDIRECT Template:Code
- Optional. The method with which the particles are tinted. Default is
- REDIRECT Template:Code
- Can be
- REDIRECT Template:Code
Example:
<syntaxhighlight lang=json copy> "minecraft:destruction_particles": {
"particle_count": 255, "texture": "cobblestone", "tint_method": "none"
} </syntaxhighlight>
minecraft:display_name
Sets the display name of the block. If omitted, the default display name is "tile.<block identifier>.name". The name given will try be resolved as a localization string. If it cannot be resolved, it will show as given.
This component is specified as a string.
Example:
<syntaxhighlight lang=json copy> "minecraft:display_name": "tile.wiki:custom_block.name" </syntaxhighlight>
minecraft:embedded_visual
Sets the visuals of the block when it is embedded, such as in a flowerpot. This component can not be specified in entries in the
- REDIRECT Template:Code
Template:Redr array.
Fields:
- REDIRECT Template:Code
- A [[#minecraft:geometry|
- REDIRECT Template:Code
Template:Redr]] component defining the embedded geometry.
- REDIRECT Template:Code
- A [[#minecraft:material_instances|
- REDIRECT Template:Code
Template:Redr]] component defining the embedded material.
Example:
<syntaxhighlight lang=json copy> "minecraft:embedded_visual": {
"geometry": "minecraft:geometry.full_block",
"material_instances": {
"*": {
"texture": "cobblestone"
}
}
} </syntaxhighlight>
minecraft:entity_fall_on
Configures the fall distance required to trigger the
- REDIRECT Template:Code
Template:Redr custom component script event. The distance defaults to 1 block if omitted.
Fields:
- REDIRECT Template:Code
- The distance an entity must fall to trigger the event.
Example:
<syntaxhighlight lang=json copy> "minecraft:entity_fall_on": {
"min_fall_distance": 2
} </syntaxhighlight>
minecraft:flammable
Defines how flammable the block is, in this case, all blocks with this component will burn from fire and lava, unlike vanilla where some blocks do not burn from lava. This component can be defined in two ways.
- As a boolean (
- REDIRECT Template:Code
- REDIRECT Template:Code
Template:Redr) property:
If
- REDIRECT Template:Code
Template:Redr, the block can catch fire from nearby blocks. The chance modifier for catching fire is automatically set to 5, and the chance modifier for the block being destroyed by fire is set to 20.
If
- REDIRECT Template:Code
Template:Redr (or omitted) the block will only catch fire if directly ignited.
Example:
<syntaxhighlight lang=json copy> "minecraft:flammable": true </syntaxhighlight>
- As a JSON object:
Fields:
- REDIRECT Template:Code
- Optional. The chance that the block catches fire from a nearby block. Default is 5.
- If greater than 0, fire on the block will burn until it is destroyed or the fire is put out. If
- REDIRECT Template:Code
Template:Redr is 0, the block will burn forever.
- If 0 the block will eventually burn out (if it isn't destroyed).
- REDIRECT Template:Code
- Optional. The chance the block is destroyed while on fire. Default is 20.
- If 0, the block will not be destroyed by fire.
Example:
<syntaxhighlight lang=json copy> "minecraft:flammable": {
"catch_chance_modifier": 5, "destroy_chance_modifier": 20
} </syntaxhighlight>
minecraft:flower_pottable
Indicates that this block can be placed inside a flower pot. The geometry of the block while inside a flower pot is specified by [[#minecraft:geometry|
- REDIRECT Template:Code
Template:Redr]] by default, but it can be changed with [[#minecraft:embedded_visual|
- REDIRECT Template:Code
Template:Redr]]. This component is specified as an empty object, and can not be specified in an entry to the
- REDIRECT Template:Code
Template:Redr array.
Example:
<syntaxhighlight lang=json copy> "minecraft:flower_pottable": {} </syntaxhighlight>
minecraft:friction
Describes the block's friction. This component is specified as a decimal number between
- REDIRECT Template:Code
Template:Redr and
- REDIRECT Template:Code
Example:
<syntaxhighlight lang=json copy> "minecraft:friction": 0.4 </syntaxhighlight>
minecraft:geometry
Defines the geometry of the block. There are three vanilla models that can be used:
- REDIRECT Template:Code
Template:Redr. You can also use your own model from a resource pack. This component must be included with [[#minecraft:material_instances|
- REDIRECT Template:Code
Template:Redr]]. This component can be specified in two ways.
- As a string:
The identifier of the model for the block.
Example:
<syntaxhighlight lang=json copy> "minecraft:geometry": "minecraft:geometry.full_block" </syntaxhighlight>
- As a JSON object:
Fields:
- REDIRECT Template:Code
- Optional. Defines the visibility of each bone. All bones are visible by default.
- A key-value map of bone names from the model to Minecraft:molang expressions that result in boolean values.
- REDIRECT Template:Code
- Optional. An identifier of a culling definition.
- REDIRECT Template:Code
- Optional. A string to group multiple blocks when comparing them in a culling rule. Default is
- REDIRECT Template:Code
Template:Redr but there is also
- REDIRECT Template:Code
Template:Redr as vanilla.
- REDIRECT Template:Code
Template:Redr:Template:OnlyExperimental
- Optional. An identifier of a voxel shape definition.
- Vanilla shapes are
- REDIRECT Template:Code
- REDIRECT Template:Code
- The identifier of the block model to use.
- REDIRECT Template:Code
- Optional. Sets whether UVs should be locked to their original rotations, regardless of the [[#minecraft:transformation|
- REDIRECT Template:Code
Template:Redr]] component.
- Can be an array of bone names to lock,
- REDIRECT Template:Code
Template:Redr (default) which locks none, or
- REDIRECT Template:Code
Template:Redr which locks all bones.
Example:
<syntaxhighlight lang=json copy> "minecraft:geometry": {
"identifier": "geometry.some_model",
"culling": "wiki:culling.example_block",
"culling_layer": "minecraft:culling_layer.leaves",
"bone_visibility": {
"north_top": false,
"right_corner": "q.block_state('wiki:corner') == 'right'"
},
"uv_lock": ["bottom"]
} </syntaxhighlight>
minecraft:item_visual
Defines the visuals of the block's item form.
Fields:
- REDIRECT Template:Code
- A [[#minecraft:geometry|
- REDIRECT Template:Code
Template:Redr]] component defining the geometry of the block item.
- REDIRECT Template:Code
- A [[#minecraft:material_instances|
- REDIRECT Template:Code
Template:Redr]] component defining the material of the block item.
Example:
<syntaxhighlight lang=json copy> "minecraft:item_visual": {
"geometry": "minecraft:geometry.full_block",
"material_instances": {
"*": {
"texture": "cobblestone"
}
}
} </syntaxhighlight>
minecraft:leashable
Allows a Minecraft:lead to be attached to the block like a Minecraft:fence and specifies an offset for the leash knot's location.
Fields:
offset:- A Vector3 property (array of three numbers
[x, y, z]) that sets the position of the leash knot.[0, 0, 0]represents the bottom center of the block.
- A Vector3 property (array of three numbers
Example:
<syntaxhighlight lang=json copy> "minecraft:leashable": {
"offset": [0, 8, 0]
} </syntaxhighlight>
minecraft:light_dampening
Sets the number of light levels that will be dampened by the block. This component is specified as an integer between 0 and 15, where 15 blocks all light.
Example:
<syntaxhighlight lang=json copy> "minecraft:light_dampening": 15 </syntaxhighlight>
minecraft:light_emission
Sets the light level emitted by the block. This component is specified as an integer between 0 and 15.
Example:
<syntaxhighlight lang=json copy> "minecraft:light_emission": 14 </syntaxhighlight>
minecraft:liquid_detection
Defines how the block responds to liquids.
Structure:
- Template:Nbt/sprite minecraft:liquid_detection: The component root.
- Template:Nbt/sprite detection_rules: An array of liquid rules.
- Template:Nbt/sprite: A rule
- Template:Nbt/sprite can_contain_liquid:
- Template:Nbt/sprite: A rule
- Template:Nbt/sprite detection_rules: An array of liquid rules.
- REDIRECT Template:Code
- REDIRECT Template:Code
Template:Redr whether the liquid can occupy the same space as the block. In other words, can it be waterlogged?
- Template:Nbt/sprite liquid_type: The type of liquid this rule applies to. Currently, the only available value is
- REDIRECT Template:Code
- Template:Nbt/sprite on_liquid_touches: Optional. Sets what happens when liquid touches the block. Available values are:
- Template:Nbt/sprite on_liquid_touches: Optional. Sets what happens when liquid touches the block. Available values are:
- REDIRECT Template:Code
Template:Redr: Default. The block stops liquid from flowing through it.
- REDIRECT Template:Code
Template:Redr: The block is destroyed on contact with flowing liquid.
- REDIRECT Template:Code
Template:Redr: The block breaks and drops its loot on contact with flowing liquid.
- REDIRECT Template:Code
Template:Redr: Liquids flow through the block as if it is not there.
- Template:Nbt/sprite stops_liquid_flowing_from_direction: Optional. An array of directions from which liquid can not flow out of (or in to, if
- REDIRECT Template:Code
Template:Redr is set to
- REDIRECT Template:Code
Template:Redr) the block.
- Template:Nbt/sprite use_liquid_clipping:
- REDIRECT Template:Code
Template:Redr means the block will use the [[#minecraft:collision_box|
- REDIRECT Template:Code
Template:Redr]] to visually clip the water like the Minecraft:stairs,
- REDIRECT Template:Code
Template:Redr ignores liquid clipping, which will render water across the whole block how current behavior.
Example:
<syntaxhighlight lang=json copy> "minecraft:liquid_detection": {
"detection_rules": [
{
"liquid_type": "water",
"can_contain_liquid": false,
"on_liquid_touches": "popped",
"use_liquid_clipping": true
}
]
} </syntaxhighlight>
minecraft:loot
Defines the block's loot table. This component is defined as a string path to the loot table. This component is completely ignored if the block is broken with an item enchanted by Minecraft:Silk Touch, resulting in the block dropping itself.
Example: <syntaxhighlight lang=json copy> "minecraft:loot": "loot_tables/blocks/some_block.json" </syntaxhighlight>
minecraft:map_color
Sets the block's color when seen on a Minecraft:map. This component can be defined in three ways.
- As a string:
The hex color value to use for the block's color on a map.
Example:
<syntaxhighlight lang=json copy> "minecraft:map_color": "#7A4F0C" </syntaxhighlight>
- As an array:
An array of three values between 0 and 255, representing the red, green, and blue color values respectively.
Example:
<syntaxhighlight lang=json copy> "minecraft:map_color": [50,205,25] </syntaxhighlight>
- As a JSON object:
Fields:
- REDIRECT Template:Code
- The color to use on the map.
- This is specified as an RGB array, or an hex string, as described above.
- REDIRECT Template:Code
- Optional. The method to use to tint the color based on the Minecraft:biome. Available values are
- REDIRECT Template:Code
Example:
<syntaxhighlight lang=json copy> "minecraft:map_color": {
"color": "#FEFEFE", "tint_method": "grass"
} </syntaxhighlight>
minecraft:material_instances
Defines the materials and textures of the block. This component must be included with [[#minecraft:geometry|
- REDIRECT Template:Code
Structure:
- Template:Nbt/sprite minecraft:material_instances: The component root.
- Template:Nbt/spriteTemplate:Nbt: A material instance definition, or the name of a material instance. The name of the property can be the name of a block face, a "*" to map to all block faces, or a custom name to define a material instance.
- Template:Nbt/spriteTemplate:Nbt/sprite ambient_occlusion: Optional. Whether the block should have ambient occlusion, and its intensity.
- Template:Nbt/sprite face_dimming: Optional. Sets if these faces are dimmed by their direction.
- Template:Nbt/sprite isotropic: Optional. Should the UVs for these faces be randomly rotated based on position?
- Template:Nbt/sprite render_method: Optional. The block's render method.
- Template:Nbt/spriteTemplate:Nbt: A material instance definition, or the name of a material instance. The name of the property can be the name of a block face, a "*" to map to all block faces, or a custom name to define a material instance.
- REDIRECT Template:Code
Template:Redr: Default. Non-transparent texture, viewable from the full render distance.
- REDIRECT Template:Code
Template:Redr: Allows for transparent textures, but disables backface culling, and can only be viewed from half the render distance.
- REDIRECT Template:Code
Template:Redr: Like
- REDIRECT Template:Code
Template:Redr, but reenables backface culling. Also can only be viewed from half the render distance.
- REDIRECT Template:Code
Template:Redr: Allows for texture translucency, but disables backface culling.
- REDIRECT Template:Code
Template:Redr: Like
- REDIRECT Template:Code
Template:Redr, but disables backface culling.
- REDIRECT Template:Code
- REDIRECT Template:Code
Template:Redr, but past half the render distance it shifts to
- REDIRECT Template:Code
Template:Redr, like Minecraft:leaves.
- REDIRECT Template:Code
- REDIRECT Template:Code
Template:Redr, but past half the render distance it shifts to
- REDIRECT Template:Code
- REDIRECT Template:Code
- REDIRECT Template:Code
Template:Redr, but past half the render distance it shifts to
- REDIRECT Template:Code
- Template:Nbt/sprite texture: Defines the texture for the material instance. This is the name of a texture defined within
- REDIRECT Template:Code
- Template:Nbt/sprite tint_method: Optional. Sets the method with which to tint the texture based on the biome. Available values are
- REDIRECT Template:Code
Example:
<syntaxhighlight lang=json copy> "minecraft:material_instances": {
"*": {
"isotropic": true,
"render_method": "opaque",
"texture": "cobblestone"
}
} </syntaxhighlight>
minecraft:movable
Determines the block's behavior when being pushed or pulled by a Minecraft:piston. If trait [[Minecraft:Block definition#minecraft:multi_block|
- REDIRECT Template:Code
Template:Redr]] is defined, the component cannot be used in permutations, and the only available
- REDIRECT Template:Code
Template:Redr are
- REDIRECT Template:Code
Fields:
- REDIRECT Template:Code
- How the block will react to a piston.
- Can be
- REDIRECT Template:Code
- REDIRECT Template:Code
- REDIRECT Template:Code
Template:Redr. Default is
- REDIRECT Template:Code
Example:
<syntaxhighlight lang=json copy> "minecraft:movable": {
"movement_type": "popped"
} </syntaxhighlight>
minecraft:placement_filter
Defines the conditions in which the block can survive. If the conditions are not met, the block can not be placed, and if it already exists, it will break and drop itself. If trait [[Minecraft:Block definition#minecraft:multi_block|
- REDIRECT Template:Code
Template:Redr]] is defined, the component it cannot be used in permutations.
Structure:
- Template:Nbt/sprite minecraft:placement_filter: The component root.
- Template:Nbt/sprite conditions: A list of conditions.
- Template:Nbt/sprite A condition
- Template:Nbt/sprite allowed_faces: Optional. A list of allowed faces the block can be placed on, or
- Template:Nbt/sprite A condition
- Template:Nbt/sprite conditions: A list of conditions.
- REDIRECT Template:Code
Template:Redr for all faces.
- Template:Nbt/sprite block_filter: Optional. A list of blocks that this block can be placed on.
- Template:Nbt/sprite A filter
- Template:Nbt/sprite name: Optional. The block identifier.
- Template:Nbt/sprite states: Optional. A key-value map of block states to required values.
- Template:Nbt/sprite tags: Optional. A molang expression defining the tags for the block.
- Template:Nbt/sprite A filter
- Template:Nbt/sprite block_filter: Optional. A list of blocks that this block can be placed on.
Example:
<syntaxhighlight lang=json copy> "minecraft:placement_filter": {
"conditions": [
{
"allowed_faces": ["up","down"], "block_filter": [ { "tags": "q.any_tag('stone')" } ] }
]
} </syntaxhighlight>
minecraft:precipitation_interactions
Defines how the block is affected by precipitation. If the block has [[#minecraft:collision_box|
- REDIRECT Template:Code
Template:Redr]] that is not false, it will not be possible to use
- REDIRECT Template:Code
Structure:
- Template:Nbt/sprite minecraft:precipitation_interactions: The component root.
- Template:Nbt/sprite precipitation_behavior: The block's behavior with precipitation.
- Template:Nbt/sprite precipitation_behavior: The block's behavior with precipitation.
- REDIRECT Template:Code
Template:Redr: Default. Rain particles will land on the block, and snow layers will accumulate if it is snowing.
- REDIRECT Template:Code
Template:Redr: Rain particles will land on the block, but snow will not accumulate.
- REDIRECT Template:Code
Template:Redr: Rain and snow will pass through the block.
- REDIRECT Template:Code
Template:Redr:{{#vardefine: $version | be 26.20
}}{{#vardefine: $version2 |
}}<upcoming: Template:Version link & Template:Version link></upcoming: Template:Version link & Template:Version link>Template:OnlyExperimental Snow will accumulate inside the block if it is snowing, causing it to become snowlogged.
Example:
<syntaxhighlight lang=json copy> "minecraft:precipitation_interactions": {
"precipitation_behavior": "obstruct_rain"
} </syntaxhighlight>
minecraft:random_offset
Allows the block's model to be randomly offset, similar to short grass. The chosen offset is still subject to the block model limits. Due to current limitations, this component causes the block to be shadowed if it intersects another block.
Structure:
- Template:Nbt/sprite minecraft:random_offset: The component root.
- Template:Nbt/sprite <axis>: The settings for the axis (
- REDIRECT Template:Code
- Template:Nbt/sprite steps: The number of possible values within the range to be chosen from. 0 means any value within the range can be chosen.
- Template:Nbt/sprite range: The range of values to choose from.
- Template:Nbt/sprite max: The maximum possible value.
- Template:Nbt/sprite min: The minimun possible value.
Example:
<syntaxhighlight lang=json copy> "minecraft:random_offset": {
"x": {
"steps": 0,
"range": {
"max": 5,
"min": -5
}
},
"y": {
"steps": 4,
"range": {
"max": 2,
"min": -1
}
},
"z": {
"steps": 0,
"range": {
"max": 5,
"min": -5
}
}
} </syntaxhighlight>
minecraft:redstone_conductivity
Defines how the block conducts redstone power.
Structure:
- Template:Nbt/sprite minecraft:redstone_conductivity: The component root.
- Template:Nbt/sprite allows_wire_to_step_down: Optional. Sets whether redstone wire can step down the side of this block.
- Template:Nbt/sprite redstone_conductor: Optional. Sets whether the block conducts redstone.
Example:
<syntaxhighlight lang=json copy> "minecraft:redstone_conductivity": {
"allows_wire_to_step_down": false, "redstone_conductor": false
} </syntaxhighlight>
minecraft:redstone_consumer
Allows the block to consume a redstone signal, sending the
- REDIRECT Template:Code
Template:Redr custom component event to scripts when the power changes.
Structure:
- Template:Nbt/sprite minecraft:redstone_consumer: The component root.
- Template:Nbt/sprite min_power: Optional. Sets the minimum power required to trigger the script event. Must be between 0 and 15.
- Template:Nbt/sprite propagates_power: Optional. Sets whether a redstone signal will pass through this block.
Example:
<syntaxhighlight lang=json copy> "minecraft:redstone_consumer": {
"min_power": 0, "propagates_power": true
} </syntaxhighlight>
minecraft:redstone_producer
Allows the block to produce a redstone signal. If the format version is 1.26.20+, adding it to the permutation also requires adding it to the root component.
Structure:
- Template:Nbt/sprite minecraft:redstone_producer: The component root.
- Template:Nbt/sprite power: Sets the power level that this block produces. Must be between 0 and 15.
- Template:Nbt/sprite strongly_powered_face: Optional. Determines the face of the block that strongly powers the block it is connected to.
- Template:Nbt/sprite connected_faces: Optional. A list of the faces of the block that emit redstone power.
- Template:Nbt/sprite transform_relative: Optional. Whether the faces selected should be relative to the [[#minecraft:transformation|
- REDIRECT Template:Code
Template:Redr]] component.
Example:
<syntaxhighlight lang=json copy> "minecraft:redstone_producer": {
"power": 15, "strongly_powered_face": "up", "connected_faces": ["north","south"], "transform_relative": true
} </syntaxhighlight>
minecraft:replaceable
Allows the block to be replaced when another block is placed in its position, like short grass. This component is specified as an empty object.
Example:
<syntaxhighlight lang=json copy> "minecraft:replaceable": {} </syntaxhighlight>
minecraft:selection_box
Defines the block's selection box. This component can be defined in two ways.
- As a boolean (
- REDIRECT Template:Code
- REDIRECT Template:Code
Template:Redr) value:
A value of
- REDIRECT Template:Code
Template:Redr creates the default full block selection box. A value of
- REDIRECT Template:Code
Template:Redr makes the block not selectable by players.
Example:
<syntaxhighlight lang=json copy> "minecraft:selection_box": true </syntaxhighlight>
- As a JSON object:
Fields:
- REDIRECT Template:Code
- The origin of the selection box. (0,0,0) represents the bottom center of the block.
- REDIRECT Template:Code
- The size of the selection box. The total size of the selection box may not be larger than 16×16×16.
Example (Bottom half slab):
<syntaxhighlight lang=json copy> "minecraft:selection_box": {
"origin": [-8,0,-8], "size": [16,8,16]
} </syntaxhighlight>
minecraft:support
Defines the shape of the block with regards to how it can support other blocks like torches. This component cannot be used in permutations.
Structure:
- Template:Nbt/sprite minecraft:support: The component root.
- Template:Nbt/sprite shape: The support shape of the block. If the component is omitted, the default is unit cube (all sides give support).
stair: Uses the shape of a stair (bottom and back give support). This requires theminecraft:vertical_halfblock state, and either state from theminecraft:placement_directionblock trait.fence: Uses the shape of a Minecraft:fence (bottom and top give support).
- Template:Nbt/sprite shape: The support shape of the block. If the component is omitted, the default is unit cube (all sides give support).
Example:
<syntaxhighlight lang=json copy> "minecraft:support": {
"shape": "fence"
} </syntaxhighlight>
minecraft:tags
Template:Message box Template:Article other
Defines the block's tags. Tags are used to categorize blocks and allow them to work better with vanilla blocks and items. Both vanilla and custom block tags can be added. This component is defined as an array.
Structure:
- Template:Nbt/sprite minecraft:tags: The list of tags for this block.
Example:
<syntaxhighlight lang=json copy> "minecraft:tags": ["minecraft:is_pickaxe_item_destructible","example:custom_tag"] </syntaxhighlight>
minecraft:tick
Sets the block to tick after a certain number of ticks, which will trigger the onTick custom component event.
This component is required in order to use the onTick event.
Structure:
- Template:Nbt/sprite minecraft:tick: The component root.
- Template:Nbt/sprite interval_range: The minimum and maximum possible time between block ticks. The time values are specified in ticks.
- Template:Nbt/sprite looping: Optional. Whether the block should continue to tick after the first tick.
Example:
<syntaxhighlight lang=json copy> "minecraft:tick": {
"interval_range": [20,100], "looping": true
} </syntaxhighlight>
minecraft:transformation
Transforms the block's geometry, collision box, and selection box. The transformations specified here are still subject to the block model limits.
Structure:
- Template:Nbt/sprite minecraft:transformation: The component root.
- Template:Nbt/sprite rotation: Optional. The rotation values around each axis.
- Template:Nbt/sprite rotation_pivot: Optional. The point to apply rotation around. Defaults to the center of the block.
- Template:Nbt/sprite scale: Optional. The scale amount for each axis.
- Template:Nbt/sprite scale_pivot: Optional. The point to apply scaling around. Defaults to the center of the block.
- Template:Nbt/sprite translation: Optional. The distance on each axis to translate the block's geometry.
Example:
<syntaxhighlight lang=json copy> "minecraft:transformation": {
"rotation": [0,90,0]
} </syntaxhighlight>
Custom components
Custom block components allow for custom blocks to take advantage of script API capabilities. Custom components are registered in scripts using the method
- REDIRECT Template:Code
Custom components can be added to blocks the same way as any other component, using the namespaced Minecraft:identifier the component was registered with. Custom components can have arguments of any type, which will be passed to scripts as the second argument.
Examples: <syntaxhighlight lang=json copy> "example_namespace:example_component": "foo", "example_namespace:example_component2": 4, "example_namespace:example_component3": [ "hello", "world" ], "example_namespace:example_component4": true, "example_namespace:example_component5": {
"stuff": 4
} </syntaxhighlight>
In scripts, the custom component object can have methods added to listen to any amount of the following events<ref>Template:Cite</ref>:
- REDIRECT Template:Code
Template:Redr: Called before the player places the block.
- REDIRECT Template:Code
Template:Redr: Called when an block has its state changed.{{#vardefine: $version | BE 26.20
}}{{#vardefine: $version2 |
}}<upcoming: Template:Version link & Template:Version link></upcoming: Template:Version link & Template:Version link>Template:OnlyExperimental
- REDIRECT Template:Code
Template:Redr: Called when the block is destroyed.
- REDIRECT Template:Code
Template:Redr: Called when an entity sends an event to the block.
- REDIRECT Template:Code
Template:Redr: Called when an entity falls onto the block. This requires the [[#minecraft:entity_fall_on|
- REDIRECT Template:Code
Template:Redr]] component.
- REDIRECT Template:Code
Template:Redr: Called when the block is placed.
- REDIRECT Template:Code
Template:Redr: Called when the block is destroyed by a player.
- REDIRECT Template:Code
Template:Redr: Called when a player interacts with the block.
- REDIRECT Template:Code
Template:Redr: Called when the block is randomly ticked.
- REDIRECT Template:Code
Template:Redr: Called when the block receives a redstone update. This requires the [[#minecraft:redstone_consumer|
- REDIRECT Template:Code
Template:Redr]] component, and will only be called if the signal power is greater than or equal to the
- REDIRECT Template:Code
Template:Redr set in the component.
- REDIRECT Template:Code
Template:Redr: Called when an entity steps off the block.
- REDIRECT Template:Code
Template:Redr: Called when an entity steps on to the block.
- REDIRECT Template:Code
Template:Redr: Called when the block ticks (As specified by the [[#minecraft:tick|
- REDIRECT Template:Code
Template:Redr]] component).
History
Template:Message boxTemplate:Article other Template:HistoryTable
References
<references group="">
</references>