跳转至

Block Behavior

文档版本:1.21.50.25

The minecraft block behavior specification.

架构

block:
{
  format_version "format_version"
  blocks "minecraft:block"
}
format_versionformat_version
format_version:
string
minecraft:blockblocks
blocks:
{
  object "description" : opt
  {
    identifier "identifier"
    object "menu_category" : opt
    {
      creative_category "category"
      item_group "group"
      boolean "is_hidden_in_commands" : opt
    }
    object "states" : opt
    {
      enum "^([a-zA-Z0-9_]+:[a-zA-Z0-9_\-]+)$"
      integer_range "^([a-zA-Z0-9_]+:[a-zA-Z0-9_\-]+)$"
    }
    object "traits" : opt
    {
      placement_direction "minecraft:placement_direction"
      placement_position "minecraft:placement_position"
    }
  }
  object "components" : opt
  {
    collision_box "minecraft:collision_box"
    crafting_table "minecraft:crafting_table"
    destructible_by_explosion "minecraft:destructible_by_explosion"
    destructible_by_mining "minecraft:destructible_by_mining"
    display_name "minecraft:display_name"
    flammable "minecraft:flammable"
    friction "minecraft:friction"
    geometry "minecraft:geometry"
    light_dampening "minecraft:light_dampening"
    light_emission "minecraft:light_emission"
    loot "minecraft:loot"
    map_color "minecraft:map_color"
    material_instances "minecraft:material_instances"
    placement_filter "minecraft:placement_filter"
    redstone_conductivity "minecraft:redstone_conductivity"
    selection_box "minecraft:selection_box"
    transformation "minecraft:transformation"
    custom_components "minecraft:custom_components"
    tick "minecraft:tick"
    entity_fall_on "minecraft:entity_fall_on"
    object "tag:.+" : opt
    {
    }
  }
  array "permutations" : opt
  {
    object "<any array element>" : opt
    {
      0 "condition"
      object "components" : opt
      {
      }
    }
  }
}
descriptionobject
The description for this block.
description
identifieridentifier
The identifier for this block. The name must include a namespace and must not use the Minecraft namespace unless overriding a Vanilla block.
identifier:
string
menu_categoryobject
Specifies the menu category and group for the block, which determine where this block is placed in the inventory and crafting table container screens. If this field is omitted, the block will not appear in the inventory or crafting table container screens.
menu_category
categorycreative_category
creative_category:
string
groupitem_group
item_group:
string
is_hidden_in_commandsboolean
Determines whether or not this item can be used with commands such as /give and /setblock. Commands can use blocks by default
statesobject
Block states are variables that can be set to different values in order to change how your block looks or behaves.
states
^([a-zA-Z0-9_]+:[a-zA-Z0-9_\-]+)$enum
The key defines the name of a state, which must be properly namespaced. Each value is an array that contains all of the possible values of that state or an object defining a range of integers.
enum:
array
{
  boolean "<any array element>" : opt
}
<any array element>boolean
enum:
array
{
  integer "<any array element>" : opt
}
<any array element>integer
enum:
array
{
  string "<any array element>" : opt
}
<any array element>string
^([a-zA-Z0-9_]+:[a-zA-Z0-9_\-]+)$integer_range
The key defines the name of a state, which must be properly namespaced. Each value is an array that contains all of the possible values of that state or an object defining a range of integers.
integer_range:
{
  object "values" : opt
  {
    integer "min" : opt
    integer "max" : opt
  }
}
valuesobject
values
mininteger
The lowest integer this state supports. This is also used as the default state value.
maxinteger
The highest integer this state supports. This cannot be more than 15 above the minimum.
traitsobject
A shortcut for creators to use Vanilla block states without needing to define and manage a series of events or triggers on custom blocks
traits
minecraft:placement_directionplacement_direction
placement_direction:
{
  array "enabled_states" : opt
  {
    string "<any array element>" : opt
  }
  number "y_rotation_offset" : opt
}
enabled_statesarray
Block states you wish to enable
enabled_states
<any array element>string
y_rotation_offsetnumber
This rotation offset only applies to the horizontal state values
minecraft:placement_positionplacement_position
placement_position:
{
  array "enabled_states" : opt
  {
    string "<any array element>" : opt
  }
}
enabled_statesarray
Block states you wish to enable
enabled_states
<any array element>string
componentsobject
UNDOCUMENTED.
components
minecraft:collision_boxcollision_box
minecraft:collision_box组件。UNDOCUMENTED.
minecraft:crafting_tablecrafting_table
minecraft:crafting_table组件。UNDOCUMENTED.
minecraft:destructible_by_explosiondestructible_by_explosion
minecraft:destructible_by_explosion组件。UNDOCUMENTED.
minecraft:destructible_by_miningdestructible_by_mining
minecraft:destructible_by_mining组件。UNDOCUMENTED.
minecraft:display_namedisplay_name
minecraft:display_name组件。UNDOCUMENTED.
minecraft:flammableflammable
minecraft:flammable组件。UNDOCUMENTED.
minecraft:frictionfriction
minecraft:friction组件。UNDOCUMENTED.
minecraft:geometrygeometry
minecraft:geometry组件。UNDOCUMENTED.
minecraft:light_dampeninglight_dampening
minecraft:light_dampening组件。UNDOCUMENTED.
minecraft:light_emissionlight_emission
minecraft:light_emission组件。UNDOCUMENTED.
minecraft:lootloot
minecraft:loot组件。UNDOCUMENTED.
minecraft:map_colormap_color
minecraft:map_color组件。UNDOCUMENTED.
minecraft:material_instancesmaterial_instances
minecraft:material_instances组件。UNDOCUMENTED.
minecraft:placement_filterplacement_filter
minecraft:placement_filter组件。UNDOCUMENTED.
minecraft:redstone_conductivityredstone_conductivity
minecraft:redstone_conductivity组件。UNDOCUMENTED.
minecraft:selection_boxselection_box
minecraft:selection_box组件。UNDOCUMENTED.
minecraft:transformationtransformation
minecraft:transformation组件。UNDOCUMENTED.
minecraft:custom_componentscustom_components
minecraft:custom_components组件。UNDOCUMENTED.
minecraft:ticktick
minecraft:tick组件。UNDOCUMENTED.
minecraft:entity_fall_onentity_fall_on
minecraft:entity_fall_on组件。UNDOCUMENTED.
tag:.+object
Applies a tag to the block, using the key without the "tag:" prefix as the tag name.
tag:.+
permutationsarray
UNDOCUMENTED.
permutations
<any array element>object
UNDOCUMENTED.
<any array element>
condition0
A Molang expression that evaluates to true or false to determine if this permutation should be used. For permutation conditions you are limited to using one Molang query: "query.block_state()"
0:
string
0:
boolean
componentsobject
UNDOCUMENTED.
components