Minecraft:Block components/Upstream
More actions
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>