Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Minecraft:Block components/Upstream

From SAS Gaming Wiki
Revision as of 15:39, 9 April 2026 by SyncBot (talk | contribs) (Remove broken links to missing pages)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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

Template:In development

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>

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.

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.

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:

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.

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:

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:

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:

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.

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:

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.

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:

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:

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:

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:

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:

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:

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:

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.

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 the minecraft:vertical_half block state, and either state from the minecraft:placement_direction block trait.
      • fence: Uses the shape of a Minecraft:fence (bottom and top give support).

Example:

<syntaxhighlight lang=json copy> "minecraft:support": {

 "shape": "fence"

} </syntaxhighlight>

minecraft:tags

Template:In development

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:

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>:

History

Template:Missing information Template:HistoryTable

References

Template:Reflist

External links

More information about components

Navigation

Template:Navbox Bedrock Edition