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

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.

  1. redirect Template:TOC

Applying

Block components can be applied by adding them to

  1. REDIRECT Template:Code

Template:Redr within

  1. REDIRECT Template:Code

Template:Redr in the block's definition file.

Components can also be found in a

  1. REDIRECT Template:Code

Template:Redr object located in objects within the

  1. REDIRECT Template:Code

Template:Redr array. This can be used to make a component only active when the permutation's

  1. REDIRECT Template:Code

Template:Redr evaluates to

  1. REDIRECT Template:Code

Template:Redr.

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

  1. REDIRECT Template:Code

Template:Redr array within

  1. 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>

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.

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
  1. REDIRECT Template:Code

Template:Redr or

  1. REDIRECT Template:Code

Template:Redr value:

Example:

<syntaxhighlight lang=json copy> "minecraft:collision_box": true </syntaxhighlight>

  • As a JSON object:

Fields:

  1. REDIRECT Template:Code

Template:Redr:

    • The origin of the collision box. (0,0,0) represents the bottom center of the block.
  1. REDIRECT Template:Code

Template:Redr:

    • 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

  1. REDIRECT Template:Code

Template:Redr block trait.

Fields:

  1. REDIRECT Template:Code

Template:Redr:

    • Optional. Which blocks this block can connect to. If omitted, the block accepts connections from all blocks. Allowed values are
  1. REDIRECT Template:Code

Template:Redr.

  1. REDIRECT Template:Code

Template:Redr:

    • Optional. Enables connection in only certain directions, disabling others; available values are
  1. REDIRECT Template:Code

Template:Redr,

  1. REDIRECT Template:Code

Template:Redr,

  1. REDIRECT Template:Code

Template:Redr, and

  1. REDIRECT Template:Code

Template:Redr.

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:

  1. REDIRECT Template:Code

Template:Redr:

    • 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
  1. REDIRECT Template:Code

Template:Redr, and custom tags can be specified to allow crafting of recipes with that tag in their definition.

  1. REDIRECT Template:Code

Template:Redr:

    • 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 (
  1. REDIRECT Template:Code

Template:Redr or

  1. REDIRECT Template:Code

Template:Redr) value:

Example:

<syntaxhighlight lang=json copy> "minecraft:destructible_by_explosion": false </syntaxhighlight>

  • As a JSON object:

Fields:

  1. REDIRECT Template:Code

Template:Redr:

    • 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 (

  1. REDIRECT Template:Code

Template:Redr or

  1. REDIRECT Template:Code

Template:Redr) value:

A value of

  1. REDIRECT Template:Code

Template:Redr makes the block destructible in 0 seconds, making it able to be instant mined. A value of

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

Fields:

  1. 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!

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

  1. REDIRECT Template:Code

Template:Redr:

    • Optional. Sets the number of particles created when the block destroyed. Default is
  1. REDIRECT Template:Code

Template:Redr, maximum is

  1. REDIRECT Template:Code

Template:Redr.

  1. REDIRECT Template:Code

Template:Redr:

    • Optional. The texture to use for the particles. This is a texture name defined in
  1. REDIRECT Template:Code

Template:Redr. Defaults to the texture of the

  1. REDIRECT Template:Code

Template:Redr material instance.

  1. REDIRECT Template:Code

Template:Redr:

    • Optional. The method with which the particles are tinted. Default is
  1. REDIRECT Template:Code

Template:Redr.

    • Can be
  1. REDIRECT Template:Code

Template:Redr.

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

  1. REDIRECT Template:Code

Template:Redr array.

Fields:

  1. REDIRECT Template:Code

Template:Redr:

    • A [[#minecraft:geometry|
  1. REDIRECT Template:Code

Template:Redr]] component defining the embedded geometry.

  1. REDIRECT Template:Code

Template:Redr:

    • A [[#minecraft:material_instances|
  1. 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

  1. REDIRECT Template:Code

Template:Redr custom component script event. The distance defaults to 1 block if omitted.

Fields:

  1. REDIRECT Template:Code

Template:Redr:

    • 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 (
  1. REDIRECT Template:Code

Template:Redr or

  1. REDIRECT Template:Code

Template:Redr) property:

If

  1. 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

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

  1. REDIRECT Template:Code

Template:Redr:

    • 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
  1. 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).
  1. REDIRECT Template:Code

Template:Redr:

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

  1. REDIRECT Template:Code

Template:Redr]] by default, but it can be changed with [[#minecraft:embedded_visual|

  1. REDIRECT Template:Code

Template:Redr]]. This component is specified as an empty object, and can not be specified in an entry to the

  1. 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

  1. REDIRECT Template:Code

Template:Redr and

  1. REDIRECT Template:Code

Template:Redr.

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:

  1. 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|

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

  1. REDIRECT Template:Code

Template:Redr:

    • 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.
  1. REDIRECT Template:Code

Template:Redr:

    • Optional. An identifier of a culling definition.
  1. REDIRECT Template:Code

Template:Redr:

    • Optional. A string to group multiple blocks when comparing them in a culling rule. Default is
  1. REDIRECT Template:Code

Template:Redr but there is also

  1. REDIRECT Template:Code

Template:Redr as vanilla.

  1. REDIRECT Template:Code

Template:Redr:Template:OnlyExperimental

    • Optional. An identifier of a voxel shape definition.
    • Vanilla shapes are
  1. REDIRECT Template:Code

Template:Redr.

  1. REDIRECT Template:Code

Template:Redr:

    • The identifier of the block model to use.
  1. REDIRECT Template:Code

Template:Redr:

    • Optional. Sets whether UVs should be locked to their original rotations, regardless of the [[#minecraft:transformation|
  1. REDIRECT Template:Code

Template:Redr]] component.

    • Can be an array of bone names to lock,
  1. REDIRECT Template:Code

Template:Redr (default) which locks none, or

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

  1. REDIRECT Template:Code

Template:Redr:

    • A [[#minecraft:geometry|
  1. REDIRECT Template:Code

Template:Redr]] component defining the geometry of the block item.

  1. REDIRECT Template:Code

Template:Redr:

    • A [[#minecraft:material_instances|
  1. 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.

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:

  1. REDIRECT Template:Code

Template:Redr or

  1. 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
  1. REDIRECT Template:Code

Template:Redr.

        • Template:Nbt/sprite on_liquid_touches: Optional. Sets what happens when liquid touches the block. Available values are:
  1. REDIRECT Template:Code

Template:Redr: Default. The block stops liquid from flowing through it.

  1. REDIRECT Template:Code

Template:Redr: The block is destroyed on contact with flowing liquid.

  1. REDIRECT Template:Code

Template:Redr: The block breaks and drops its loot on contact with flowing liquid.

  1. 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
  1. REDIRECT Template:Code

Template:Redr is set to

  1. REDIRECT Template:Code

Template:Redr) the block.

  1. REDIRECT Template:Code

Template:Redr means the block will use the [[#minecraft:collision_box|

  1. REDIRECT Template:Code

Template:Redr]] to visually clip the water like the Minecraft:stairs,

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

  1. REDIRECT Template:Code

Template:Redr:

    • The color to use on the map.
    • This is specified as an RGB array, or an hex string, as described above.
  1. REDIRECT Template:Code

Template:Redr:

    • Optional. The method to use to tint the color based on the Minecraft:biome. Available values are
  1. REDIRECT Template:Code

Template:Redr.

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|

  1. REDIRECT Template:Code

Template:Redr]].

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.
  1. REDIRECT Template:Code

Template:Redr: Default. Non-transparent texture, viewable from the full render distance.

  1. REDIRECT Template:Code

Template:Redr: Allows for transparent textures, but disables backface culling, and can only be viewed from half the render distance.

  1. REDIRECT Template:Code

Template:Redr: Like

  1. REDIRECT Template:Code

Template:Redr, but reenables backface culling. Also can only be viewed from half the render distance.

  1. REDIRECT Template:Code

Template:Redr: Allows for texture translucency, but disables backface culling.

  1. REDIRECT Template:Code

Template:Redr: Like

  1. REDIRECT Template:Code

Template:Redr, but disables backface culling.

  1. REDIRECT Template:Code

Template:Redr:

  1. REDIRECT Template:Code

Template:Redr, but past half the render distance it shifts to

  1. REDIRECT Template:Code

Template:Redr, like Minecraft:leaves.

  1. REDIRECT Template:Code

Template:Redr:

  1. REDIRECT Template:Code

Template:Redr, but past half the render distance it shifts to

  1. REDIRECT Template:Code

Template:Redr.

  1. REDIRECT Template:Code

Template:Redr:

  1. REDIRECT Template:Code

Template:Redr, but past half the render distance it shifts to

  1. REDIRECT Template:Code

Template:Redr.

      • Template:Nbt/sprite texture: Defines the texture for the material instance. This is the name of a texture defined within
  1. REDIRECT Template:Code

Template:Redr.

      • Template:Nbt/sprite tint_method: Optional. Sets the method with which to tint the texture based on the biome. Available values are
  1. REDIRECT Template:Code

Template:Redr.

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|

  1. REDIRECT Template:Code

Template:Redr]] is defined, the component cannot be used in permutations, and the only available

  1. REDIRECT Template:Code

Template:Redr are

  1. REDIRECT Template:Code

Template:Redr.

Fields:

  1. REDIRECT Template:Code

Template:Redr:

    • How the block will react to a piston.
    • Can be
  1. REDIRECT Template:Code

Template:Redr.

  1. REDIRECT Template:Code

Template:Redr:

    • Optional. Whether or not the block affects nearby blocks when pushed or pulled, allowing behavior similar to slime or honey blocks.
    • Can be
  1. REDIRECT Template:Code

Template:Redr. Default is

  1. REDIRECT Template:Code

Template:Redr.

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|

  1. REDIRECT Template:Code

Template:Redr]] is defined, the component it cannot be used in permutations.

Structure:

  1. REDIRECT Template:Code

Template:Redr for all faces.

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|

  1. REDIRECT Template:Code

Template:Redr]] that is not false, it will not be possible to use

  1. REDIRECT Template:Code

Template:Redr.

Structure:

  1. REDIRECT Template:Code

Template:Redr: Default. Rain particles will land on the block, and snow layers will accumulate if it is snowing.

  1. REDIRECT Template:Code

Template:Redr: Rain particles will land on the block, but snow will not accumulate.

  1. REDIRECT Template:Code

Template:Redr: Rain and snow will pass through the block.

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

  1. REDIRECT Template:Code

Template:Redr).

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

  1. 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|
  1. 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 (
  1. REDIRECT Template:Code

Template:Redr or

  1. REDIRECT Template:Code

Template:Redr) value:

A value of

  1. REDIRECT Template:Code

Template:Redr creates the default full block selection box. A value of

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

  1. REDIRECT Template:Code

Template:Redr:

    • The origin of the selection box. (0,0,0) represents the bottom center of the block.
  1. REDIRECT Template:Code

Template:Redr:

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

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:

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

  1. REDIRECT Template:Code

Template:Redr.

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

  1. REDIRECT Template:Code

Template:Redr: Called before the player places the block.

  1. 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

  1. REDIRECT Template:Code

Template:Redr: Called when the block is destroyed.

  1. REDIRECT Template:Code

Template:Redr: Called when an entity sends an event to the block.

  1. REDIRECT Template:Code

Template:Redr: Called when an entity falls onto the block. This requires the [[#minecraft:entity_fall_on|

  1. REDIRECT Template:Code

Template:Redr]] component.

  1. REDIRECT Template:Code

Template:Redr: Called when the block is placed.

  1. REDIRECT Template:Code

Template:Redr: Called when the block is destroyed by a player.

  1. REDIRECT Template:Code

Template:Redr: Called when a player interacts with the block.

  1. REDIRECT Template:Code

Template:Redr: Called when the block is randomly ticked.

  1. REDIRECT Template:Code

Template:Redr: Called when the block receives a redstone update. This requires the [[#minecraft:redstone_consumer|

  1. REDIRECT Template:Code

Template:Redr]] component, and will only be called if the signal power is greater than or equal to the

  1. REDIRECT Template:Code

Template:Redr set in the component.

  1. REDIRECT Template:Code

Template:Redr: Called when an entity steps off the block.

  1. REDIRECT Template:Code

Template:Redr: Called when an entity steps on to the block.

  1. REDIRECT Template:Code

Template:Redr: Called when the block ticks (As specified by the [[#minecraft:tick|

  1. REDIRECT Template:Code

Template:Redr]] component).

History

Template:Message boxTemplate:Article other Template:HistoryTable

References

<references group="">

 </references>

External links

More information about components

Navigation

Editions
Merged
Ports to consoles
Discontinued
Development
Version history
Technical
Creator
Add-ons
Multiplayer
Exclusive features
Blocks
Mobs
Effects
Unused
Removed