Block Behavior¶
文档版本:1.21.50.25
The minecraft block behavior specification.
架构¶
format_version
:format_version
minecraft:block
:blocks
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
{
}
}
}
}
description
:object- The description for this block.
description
identifier
:identifier- The identifier for this block. The name must include a namespace and must not use the Minecraft namespace unless overriding a Vanilla block.
menu_category
:object- 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
category
:creative_category
group
:item_group
is_hidden_in_commands
:boolean- Determines whether or not this item can be used with commands such as /give and /setblock. Commands can use blocks by default
states
:object- 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.
<any array element>
:boolean
<any array element>
:integer
<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.
values
:object
values
min
:integer- The lowest integer this state supports. This is also used as the default state value.
max
:integer- The highest integer this state supports. This cannot be more than 15 above the minimum.
traits
:object- 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_direction
:placement_direction
placement_direction:
{
array "enabled_states" : opt
{
string "<any array element>" : opt
}
number "y_rotation_offset" : opt
}
enabled_states
:array- Block states you wish to enable
enabled_states
<any array element>
:string
y_rotation_offset
:number- This rotation offset only applies to the horizontal state values
minecraft:placement_position
:placement_position
enabled_states
:array- Block states you wish to enable
enabled_states
<any array element>
:string
components
:object- UNDOCUMENTED.
components
minecraft:collision_box
:collision_boxminecraft:collision_box
组件。UNDOCUMENTED.
minecraft:crafting_table
:crafting_tableminecraft:crafting_table
组件。UNDOCUMENTED.
minecraft:destructible_by_explosion
:destructible_by_explosionminecraft:destructible_by_explosion
组件。UNDOCUMENTED.
minecraft:destructible_by_mining
:destructible_by_miningminecraft:destructible_by_mining
组件。UNDOCUMENTED.
minecraft:display_name
:display_nameminecraft:display_name
组件。UNDOCUMENTED.
minecraft:flammable
:flammableminecraft:flammable
组件。UNDOCUMENTED.
minecraft:friction
:frictionminecraft:friction
组件。UNDOCUMENTED.
minecraft:geometry
:geometryminecraft:geometry
组件。UNDOCUMENTED.
minecraft:light_dampening
:light_dampeningminecraft:light_dampening
组件。UNDOCUMENTED.
minecraft:light_emission
:light_emissionminecraft:light_emission
组件。UNDOCUMENTED.
minecraft:loot
:lootminecraft:loot
组件。UNDOCUMENTED.
minecraft:map_color
:map_colorminecraft:map_color
组件。UNDOCUMENTED.
minecraft:material_instances
:material_instancesminecraft:material_instances
组件。UNDOCUMENTED.
minecraft:placement_filter
:placement_filterminecraft:placement_filter
组件。UNDOCUMENTED.
minecraft:redstone_conductivity
:redstone_conductivityminecraft:redstone_conductivity
组件。UNDOCUMENTED.
minecraft:selection_box
:selection_boxminecraft:selection_box
组件。UNDOCUMENTED.
minecraft:transformation
:transformationminecraft:transformation
组件。UNDOCUMENTED.
minecraft:custom_components
:custom_componentsminecraft:custom_components
组件。UNDOCUMENTED.
minecraft:tick
:tickminecraft:tick
组件。UNDOCUMENTED.
minecraft:entity_fall_on
:entity_fall_onminecraft:entity_fall_on
组件。UNDOCUMENTED.
tag:.+
:object- Applies a tag to the block, using the key without the "tag:" prefix as the tag name.
tag:.+
permutations
:array- UNDOCUMENTED.
permutations
<any array element>
:object- UNDOCUMENTED.
<any array element>