Minecraft:Block components/Upstream
More actions
Template:For Template: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. Template:TOC
Applying
Block components can be applied by adding them to Template:Cd within Template:Cd in the block's definition file.
Components can also be found in a Template:Cd object located in objects within the Template:Cd array. This can be used to make a component only active when the permutation's Template:Cd evaluates to Template:Cd.
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. 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 Template:Cd array within Template:Cd, and consist of two properties:
- Template:Nbt: 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: 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:Experimental Defines how the block should obstruct Minecraft:chests from opening when placed above one.
Structure:
- Template:Nbt: The component root.
- Template:Nbt: 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: 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 Template:Cd or Template:Cd value:
Example:
<syntaxhighlight lang=json copy> "minecraft:collision_box": true </syntaxhighlight>
- As a JSON object:
Fields:
- Template:Cd:
- The origin of the collision box. (0,0,0) represents the bottom center of the block.
- Template:Cd:
- 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 Template:Cd block trait.
Fields:
- Template:Cd:
- Optional. Which blocks this block can connect to. If omitted, the block accepts connections from all blocks. Allowed values are Template:Cd.
- Template:Cd:
- Optional. Enables connection in only certain directions, disabling others; available values are Template:Cd, Template:Cd, Template:Cd, and Template:Cd.
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:
- Template:Cd:
- 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 Template:Cd, and custom tags can be specified to allow crafting of recipes with that tag in their definition.
- Template:Cd:
- 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 (Template:Cd or Template:Cd) value:
Example:
<syntaxhighlight lang=json copy> "minecraft:destructible_by_explosion": false </syntaxhighlight>
- As a JSON object:
Fields:
- Template:Cd:
- 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 (Template:Cd or Template:Cd) value:
A value of Template:Cd makes the block destructible in 0 seconds, making it able to be instant mined. A value of Template:Cd makes the block indestructible by mining.
Example:
<syntaxhighlight lang=json copy> "minecraft:destructible_by_mining": true </syntaxhighlight>
As a JSON object:
Structure:
- Template:Nbt: (root of component)
- Template:Nbt
- Template:Nbt:
- Template:Nbt: The hardness of the block when mined with the target item(s).
- Template:NbtTemplate:Nbt: A description of the item(s). Either a string item identifier or an object.
- Template:Nbt: A Minecraft:Molang expression defining the tags of the target item(s).
- Template:Nbt:
- Template:Nbt
- Template:Nbt
Fields:
- Template:Cd: 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!
- Template:Cd: 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:
- Template:Cd:
- Optional. Sets the number of particles created when the block destroyed. Default is Template:Cd, maximum is Template:Cd.
- Template:Cd:
- Optional. The texture to use for the particles. This is a texture name defined in Template:Cd. Defaults to the texture of the Template:Cd material instance.
- Template:Cd:
- Optional. The method with which the particles are tinted. Default is Template:Cd.
- Can be Template:Cd.
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 Template:Cd array.
Fields:
- Template:Cd:
- A [[#minecraft:geometry|Template:Cd]] component defining the embedded geometry.
- Template:Cd:
- A [[#minecraft:material_instances|Template:Cd]] 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 Template:Cd custom component script event. The distance defaults to 1 block if omitted.
Fields:
- Template:Cd:
- 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 (Template:Cd or Template:Cd) property:
If Template:Cd, 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 Template:Cd (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:
- Template:Cd:
- 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 Template:Cd is 0, the block will burn forever.
- If 0 the block will eventually burn out (if it isn't destroyed).
- Template:Cd:
- 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|Template:Cd]] by default, but it can be changed with [[#minecraft:embedded_visual|Template:Cd]]. This component is specified as an empty object, and can not be specified in an entry to the Template:Cd 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 Template:Cd and Template:Cd.
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: Template:Cd. You can also use your own model from a resource pack. This component must be included with [[#minecraft:material_instances|Template:Cd]]. 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:
- Template:Cd:
- 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.
- Template:Cd:
- Optional. An identifier of a culling definition.
- Template:Cd:
- Optional. A string to group multiple blocks when comparing them in a culling rule. Default is Template:Cd but there is also Template:Cd as vanilla.
- Template:Cd:Template:OnlyExperimental
- Optional. An identifier of a voxel shape definition.
- Vanilla shapes are Template:Cd.
- Template:Cd:
- The identifier of the block model to use.
- Template:Cd:
- Optional. Sets whether UVs should be locked to their original rotations, regardless of the [[#minecraft:transformation|Template:Cd]] component.
- Can be an array of bone names to lock, Template:Cd (default) which locks none, or Template:Cd 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:
- Template:Cd:
- A [[#minecraft:geometry|Template:Cd]] component defining the geometry of the block item.
- Template:Cd:
- A [[#minecraft:material_instances|Template:Cd]] 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: The component root.
- Template:Nbt: An array of liquid rules.
- Template:Nbt: A rule
- Template:Nbt: Template:Cd or Template:Cd whether the liquid can occupy the same space as the block. In other words, can it be waterlogged?
- Template:Nbt: The type of liquid this rule applies to. Currently, the only available value is Template:Cd.
- Template:Nbt: Optional. Sets what happens when liquid touches the block. Available values are:
- Template:Cd: Default. The block stops liquid from flowing through it.
- Template:Cd: The block is destroyed on contact with flowing liquid.
- Template:Cd: The block breaks and drops its loot on contact with flowing liquid.
- Template:Cd: Liquids flow through the block as if it is not there.
- Template:Nbt: Optional. An array of directions from which liquid can not flow out of (or in to, if Template:Cd is set to Template:Cd) the block.
- Template:Nbt: Template:Cd means the block will use the [[#minecraft:collision_box|Template:Cd]] to visually clip the water like the Minecraft:stairs, Template:Cd ignores liquid clipping, which will render water across the whole block how current behavior.
- Template:Nbt: A rule
- Template:Nbt: An array of liquid rules.
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:
- Template:Cd:
- The color to use on the map.
- This is specified as an RGB array, or an hex string, as described above.
- Template:Cd:
- Optional. The method to use to tint the color based on the Minecraft:biome. Available values are Template:Cd.
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|Template:Cd]].
Structure:
- Template:Nbt: The component root.
- Template:NbtTemplate: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:NbtTemplate:Nbt: Optional. Whether the block should have ambient occlusion, and its intensity.
- Template:Nbt: Optional. Sets if these faces are dimmed by their direction.
- Template:Nbt: Optional. Should the UVs for these faces be randomly rotated based on position?
- Template:Nbt: Optional. The block's render method.
- Template:Cd: Default. Non-transparent texture, viewable from the full render distance.
- Template:Cd: Allows for transparent textures, but disables backface culling, and can only be viewed from half the render distance.
- Template:Cd: Like Template:Cd, but reenables backface culling. Also can only be viewed from half the render distance.
- Template:Cd: Allows for texture translucency, but disables backface culling.
- Template:Cd: Like Template:Cd, but disables backface culling.
- Template:Cd: Template:Cd, but past half the render distance it shifts to Template:Cd, like Minecraft:leaves.
- Template:Cd: Template:Cd, but past half the render distance it shifts to Template:Cd.
- Template:Cd: Template:Cd, but past half the render distance it shifts to Template:Cd.
- Template:Nbt: Defines the texture for the material instance. This is the name of a texture defined within Template:Cd.
- Template:Nbt: Optional. Sets the method with which to tint the texture based on the biome. Available values are Template:Cd.
- Template:NbtTemplate: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.
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| Template:Cd]] is defined, the component cannot be used in permutations, and the only available Template:Cd are Template:Cd.
Fields:
- Template:Cd:
- How the block will react to a piston.
- Can be Template:Cd.
- Template:Cd:
- Optional. Whether or not the block affects nearby blocks when pushed or pulled, allowing behavior similar to slime or honey blocks.
- Can be Template:Cd. Default is Template:Cd.
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| Template:Cd]] is defined, the component it cannot be used in permutations.
Structure:
- Template:Nbt: The component root.
- Template:Nbt: A list of conditions.
- Template:Nbt A condition
- Template:Nbt: Optional. A list of allowed faces the block can be placed on, or Template:Cd for all faces.
- Template:Nbt: Optional. A list of blocks that this block can be placed on.
- Template:Nbt A filter
- Template:Nbt: Optional. The block identifier.
- Template:Nbt: Optional. A key-value map of block states to required values.
- Template:Nbt: Optional. A molang expression defining the tags for the block.
- Template:Nbt A filter
- Template:Nbt A condition
- Template:Nbt: A list of conditions.
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|Template:Cd]] that is not false, it will not be possible to use Template:Cd.
Structure:
- Template:Nbt: The component root.
- Template:Nbt: The block's behavior with precipitation.
- Template:Cd: Default. Rain particles will land on the block, and snow layers will accumulate if it is snowing.
- Template:Cd: Rain particles will land on the block, but snow will not accumulate.
- Template:Cd: Rain and snow will pass through the block.
- Template:Cd:Template:UpcomingTemplate:OnlyExperimental Snow will accumulate inside the block if it is snowing, causing it to become snowlogged.
- Template:Nbt: The block's behavior with precipitation.
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: The component root.
- Template:Nbt: The settings for the axis (Template:Cd).
- Template:Nbt: The number of possible values within the range to be chosen from. 0 means any value within the range can be chosen.
- Template:Nbt: The range of values to choose from.
- Template:Nbt: The maximum possible value.
- Template:Nbt: The minimun possible value.
- Template:Nbt: The settings for the axis (Template:Cd).
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: The component root.
- Template:Nbt: Optional. Sets whether redstone wire can step down the side of this block.
- Template:Nbt: 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 Template:Cd custom component event to scripts when the power changes.
Structure:
- Template:Nbt: The component root.
- Template:Nbt: Optional. Sets the minimum power required to trigger the script event. Must be between 0 and 15.
- Template:Nbt: 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: The component root.
- Template:Nbt: Sets the power level that this block produces. Must be between 0 and 15.
- Template:Nbt: Optional. Determines the face of the block that strongly powers the block it is connected to.
- Template:Nbt: Optional. A list of the faces of the block that emit redstone power.
- Template:Nbt: Optional. Whether the faces selected should be relative to the [[#minecraft:transformation|Template:Cd]] 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 (Template:Cd or Template:Cd) value:
A value of Template:Cd creates the default full block selection box. A value of Template:Cd makes the block not selectable by players.
Example:
<syntaxhighlight lang=json copy> "minecraft:selection_box": true </syntaxhighlight>
- As a JSON object:
Fields:
- Template:Cd:
- The origin of the selection box. (0,0,0) represents the bottom center of the block.
- Template:Cd:
- 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: The component root.
- Template:Nbt: 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: 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
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: 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: The component root.
- Template:Nbt: The minimum and maximum possible time between block ticks. The time values are specified in ticks.
- Template:Nbt: 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: The component root.
- Template:Nbt: Optional. The rotation values around each axis.
- Template:Nbt: Optional. The point to apply rotation around. Defaults to the center of the block.
- Template:Nbt: Optional. The scale amount for each axis.
- Template:Nbt: Optional. The point to apply scaling around. Defaults to the center of the block.
- Template:Nbt: 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 Template:Cd.
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>:
- Template:Cd: Called before the player places the block.
- Template:Cd: Called when an block has its state changed.Template:UpcomingTemplate:OnlyExperimental
- Template:Cd: Called when the block is destroyed.
- Template:Cd: Called when an entity sends an event to the block.
- Template:Cd: Called when an entity falls onto the block. This requires the [[#minecraft:entity_fall_on|Template:Cd]] component.
- Template:Cd: Called when the block is placed.
- Template:Cd: Called when the block is destroyed by a player.
- Template:Cd: Called when a player interacts with the block.
- Template:Cd: Called when the block is randomly ticked.
- Template:Cd: Called when the block receives a redstone update. This requires the [[#minecraft:redstone_consumer|Template:Cd]] component, and will only be called if the signal power is greater than or equal to the Template:Cd set in the component.
- Template:Cd: Called when an entity steps off the block.
- Template:Cd: Called when an entity steps on to the block.
- Template:Cd: Called when the block ticks (As specified by the [[#minecraft:tick|Template:Cd]] component).