方块Block文档

版本: 1.16.200.2(正式版)


块组件

NameTypeDefault ValueDescription
minecraft:block_light_absorptionInteger0The amount of light this block will absorb.
minecraft:block_light_emissionDecimal0.0The amount of light this block will emit in a range [0.0, 1.0].
minecraft:breakonpushBooleanWhen pushed by a piston the block breaks
minecraft:breathabilityEnumeratorsolidProperty describing the breathability of this block and whether it is treated as a solid or as air.
minecraft:destroy_timeDecimal0.0Sets the destroy time property for the block. Greater numbers result in greater mining times.
minecraft:display_nameStringSpecifies the display name id for the block.
minecraft:entity_collisionBooleanfalseCan only be set to false, it disables the collision of the block with entities
NameTypeDefault ValueDescription
------------
originArray[-8.0, 0.0, -8.0]Minimal position Bounds of the collision box
sizeArray[16.0, 16.0, 16.0]Size of each side of the box of the component
minecraft:explosion_resistanceDecimal0.0Sets the explosion resistance for this block.
minecraft:flammableJSON ObjectDescribes the flammable properties for this block.
NameTypeDefault ValueDescription
------------
burn_oddsInteger0How likely the block will be destroyed by flames when on fire.
flame_oddsInteger0How likely the block will catch flame when next to a fire.
minecraft:frictionDecimal0.1Property describing the friction for this block. Friction effects an entities movements when it walks on the block.
minecraft:geometryStringThe geometry definition name to use.
minecraft:immovableBooleanAn Immovable block cannot be pushed by pistons
minecraft:map_colorStringA color represented as a hex value. This will be the color rendered to a map.
minecraft:material_instancesJSON ObjectMaps face or material_instance names in a geometry file to an actual material instance. Material instance can either be a full material instance or a name to another already defined instance
minecraft:onlypistonpushBooleanBlocks with those components won't stick to stickyPistons
minecraft:pick_collisionBooleanfalseCan only be set to false, it disables the collision of the block with entities
NameTypeDefault ValueDescription
------------
originArray[-8.0, 0.0, -8.0]Minimal position Bounds of the collision box
sizeArray[16.0, 16.0, 16.0]Size of each side of the box of the component
minecraft:placement_filterJSON ObjectSets rules for under what conditions the block can be placed/survive

条件

List of conditions where the block can be placed/survive

NameTypeDefault ValueDescription
allowed_facesArrayList of any of the following strings: up, down, north, south, east, west, side, all
block_filterArrayList of blocks (can use tags to specify them) that this block can be placed against in the allowed_faces direction
minecraft:preventsjumpingBooleanthis component makes it so actors can't jump when walking on this block
minecraft:random_tickingJSON ObjectDescribes the component that will trigger an even at a regular interval between two values
NameTypeDefault ValueDescription
------------
Triggeron_tick
NameTypeDefault ValueDescription
------------
conditionString1The condition of event to be executed on the block.
eventStringset_block_propertyThe type of event executed on the block.
rangeArray[10, 10]The Range between which the component will trigger his event.
targetStringselfThe target of event executed on the block.
minecraft:rotationVector [a, b, c]rotation[0, 0, 0]This is the block's rotation around the center of the cube in degrees. The rotation order is x-y-z.
minecraft:tickingJSON ObjectDescribes the component that will trigger an even at a regular interval between two values
NameTypeDefault ValueDescription
Triggeron_tick
NameTypeDefault ValueDescription
------------
conditionString1The condition of event to be executed on the block.
eventStringset_block_propertyThe type of event executed on the block.
rangeArray[10, 10]The Range between which the component will trigger his event.
targetStringselfThe target of event executed on the block.
loopingBooleantrueDoes the event loop
rangeArray[10, 10]The Range between which the component will trigger his event.
minecraft:unit_cubeStringSpecifies that a unit cube is to be used with tessellation.
minecraft:unwalkableBooleanthis component sets a block as unwalkable. Most mobs will not try to jump over it if the value is set to true

示例

Example

{
  "format_version": "1.10.0",
  "minecraft:block": {
   "components": {
      ...
    }
    ...
  }
}

方块描述

TypeNameDefault ValueDescription
StringidentifierThe identifier for this block. The name must include a namespace and must not use the Minecraft namespace unless overriding a Vanilla block.
Booleanregister_to_creative_menufalseWhether or not to register this block to the creative inventory menu.
Booleanis_experimentalfalseIf this block is experimental, it will only be registered if the world is marked as experimental.

阻止事件响应

Event responses for block trigger components.

NameTypeDefault ValueDescription
add_mob_effectJSON ObjectApply mob effect to target.
NameTypeDefault ValueDescription
------------
amplifierInteger0The amplifier for the mob effect.
durationDecimal0.0The duration of the mob effect.
effectStringThe mob effect to apply.
targetMinecraft FilterselfThe target context to execute against.
damageJSON ObjectDeals damage to the target.
NameTypeDefault ValueDescription
amountInteger0The amount of damage to deal.
targetMinecraft FilterselfThe target context to execute against.
typeStringThe type of damage to deal.
decrement_stackJSON ObjectDecrement item stack.
dieJSON ObjectKill target. If target is self and this is run from a block then destroy the block.
NameTypeDefault ValueDescription
targetMinecraft FilterselfThe target context to execute against.
play_effectJSON ObjectSpawns a particle effect relative to target position.
NameTypeDefault ValueDescription
dataInteger0Particle data value.
effectStringThe name of the particle effect to create.
targetMinecraft FilterselfThe target context to execute against.
play_soundJSON ObjectPlay a sound relative to target position.
NameTypeDefault ValueDescription
soundStringThe name of the sound to play.
targetMinecraft FilterselfThe target context to execute against.
remove_mob_effectJSON ObjectRemoves mob effect from target.
NameTypeDefault ValueDescription
effectStringThe mob effect to remove. Use 'all' to remove all mob effects from target.
targetMinecraft FilterselfThe target context to execute against.
run_commandJSON ObjectTriggers a slash command or a list of slash commands.
NameTypeDefault ValueDescription
commandStringSlash command to run.
command arrayArrayList of slash commands to run.
targetMinecraft FilterselfThe target context to execute against.
set_blockJSON ObjectSets this block to another block type.
NameTypeDefault ValueDescription
block_typeStringThe type of block to set.

|
| set_block_at_pos | JSON Object | | Sets a block relative to this block to another block type.

NameTypeDefault ValueDescription
block_offsetVector [a, b, c][0.0, 0.0, 0.0]The offset from the block's center.
block_typeStringThe type of block to set.
set_block_propertyJSON ObjectSets a block property on this block.
NameTypeDefault ValueDescription
propertyMoLangBlock property to set on the block.
spawn_lootJSON ObjectSpawn loot from block.
NameTypeDefault ValueDescription
tableStringFile path, relative to the Behavior Pack's path, to the loot table file.
swingJSON ObjectEvent causes the actor to swing.
teleportJSON ObjectTeleport target randomly around destination point.
NameTypeDefault ValueDescription
avoid_waterBooleantrueDetermines if the teleport avoids putting the target in water.
destinationVector [a, b, c][0.0, 0.0, 0.0]Origin destination of the teleport.
land_on_blockBooleantrueDetermines if the teleport places the target on a block.
max_rangeVector [a, b, c][8.0, 8.0, 8.0]Max range the target can teleport relative to the origin destination.
targetMinecraft FilterselfThe target context to execute against.
transform_itemJSON ObjectTransforms item into another item.
NameTypeDefault ValueDescription
transformStringName of the item it should transform into

示例

Event Response Example

    "minecraft:block": {
      "description": {
        "identifier": "test:on_interact_change_state_block",
        "properties": {
          "minecraft:direction": {
          }
        }
      },
      "components": {
        "minecraft:on_interact": {
          "event": "test_event"
        }
      },
      "events": {
        "test_event": {
          "set_block_property": {
            "minecraft:direction": "1"
          }
        }
      }
    }

方块触发器组件

NameTypeDefault ValueDescription
minecraft:on_fall_onJSON ObjectDescribes event for this block.
NameTypeDefault ValueDescription
------------
conditionStringThe condition of event to be executed on the block.
eventStringThe event executed on the block.
min_fall_distanceDecimal0.0The minimum distance in blocks that an actor needs to fall to trigger this event.
targetStringselfThe target of event executed on the block.
minecraft:on_interactJSON ObjectDescribes event for this block.
NameTypeDefault ValueDescription
conditionStringThe condition of event to be executed on the block.
eventStringThe event executed on the block.
targetStringselfThe target of event executed on the block.
minecraft:on_placedJSON ObjectDescribes event for this block.
NameTypeDefault ValueDescription
conditionStringThe condition of event to be executed on the block.
eventStringThe event executed on the block.
targetStringselfThe target of event executed on the block.
minecraft:on_player_destroyedJSON ObjectDescribes event for this block.
NameTypeDefault ValueDescription
conditionStringThe condition of event to be executed on the block.
eventStringThe event executed on the block.
targetStringselfThe target of event executed on the block.
minecraft:on_player_placingJSON ObjectDescribes event for this block.
NameTypeDefault ValueDescription
conditionStringThe condition of event to be executed on the block.
eventStringThe event executed on the block.
targetStringselfThe target of event executed on the block.
minecraft:on_step_offJSON ObjectDescribes event for this block.
NameTypeDefault ValueDescription
conditionStringThe condition of event to be executed on the block.
eventStringThe event executed on the block.
targetStringselfThe target of event executed on the block.
minecraft:on_step_onJSON ObjectDescribes event for this block.
NameTypeDefault ValueDescription
conditionStringThe condition of event to be executed on the block.
eventStringThe event executed on the block.
targetStringselfThe target of event executed on the block.