跳到主要内容

ℹ️ 属性

类型

提示

default 选项是可选的。

boolean

boolean 类型的属性只有两种可能值:truefalse

properties:
happy:
type: boolean
default: false

int

int 类型的属性可以取指定范围内的任何整数值。

properties:
mode:
type: int
default: 1
range: 1~3

string

string 类型的属性只能从预定义的选项集合中取值。

properties:
color:
type: string
default: red
values:
- read
- green
- blue

direction

east, south, west, north, up, down

properties:
facing:
type: direction
default: north

horizontal_direction

east, south, west, north

properties:
facing:
type: horizontal_direction
default: north

axis

x, y, z

properties:
axis:
type: axis
default: y

single_block_half

top, bottom

properties:
half:
type: single_block_half
default: bottom

double_block_half

upper, lower

properties:
half:
type: double_block_half
default: lower

hinge

left, right

properties:
hinge:
type: hinge
default: left

slab_type

top, bottom, double

properties:
type:
type: slab_type
default: bottom

stairs_shape

straight, inner_left, inner_right, outer_left, outer_right

properties:
shape:
type: stairs_shape
default: straight

硬编码名称

信息

除了下面提到的名称外,一些名称由方块的行为决定。例如,树苗行为需要一个名为 age 的属性。

waterlogged

waterlogged 决定该方块是否可以包含水。

注意

注意:当使用 waterlogged 状态时,请确保对应的视觉方块状态也包含水,否则客户端将无法正确渲染水。

properties:
waterlogged:
type: boolean
default: false

facing

当方块具有此硬编码属性名称时,其放置方向将自动适应。

properties:
facing:
type: direction
default: north

facing_clockwise

与上述不同的是,方块放置时将旋转 90 度。

properties:
facing_clockwise:
type: horizontal_direction
default: north