26.60
注意
本文仍在编辑,仅供参考。
26.60 以收紧写法为主:minecraft:collision_box只接受数组,还有一批实体组件与minecraft:transformation的字段不能再写简写。命令侧与脚本侧的世界时钟在这一版转正,脚本开放2.11.0版本。
有关于 26.60 的完整更新日志,可见下方的中文 Minecraft Wiki。本文只介绍 26.60 的关键技术性更改。
基岩版26.60
命令
- 更改
/time命令改为基于世界时钟,/time query的参数与/time set的写法都有变化。/time query的可填值改为day、daytime、gametime与time。/time set改为按时间标记设置,可指定next、previous与stay。- 新增
/time pause与/time resume,用于暂停与恢复世界时钟。
物品
数据驱动物品组件
- 更改
minecraft:durability_sensor组件的sound_event参数、minecraft:swing_sounds组件的attack_miss、attack_hit与attack_critical_hit参数,以及minecraft:use_modifiers组件的start_sound参数,现在除内置音效名外也接受sound_definitions.json中定义的声音事件。
战利品表
- 更改 物品数量被设为
0后,战利品函数会继续执行,set_count等后续函数可以恢复数量并保留标识与数据。该行为需要格式版本1.26.60。
方块
数据驱动方块组件
- 更改
minecraft:collision_box组件从格式版本1.26.60起只接受数组写法,单个碰撞箱也必须写成数组中的一项。旧的单对象写法不再有效。 - 新增
minecraft:block_entity组件的container参数新增title字段,用于设置容器界面的标题,接受 1~256 个字符或本地化键名。不指定时标题为空。
方块状态
- 新增 紫颂植株与火现在暴露
minecraft:connection_north、minecraft:connection_east、minecraft:connection_south、minecraft:connection_west、minecraft:connection_up与minecraft:connection_down六个状态。 - 新增 红石粉现在暴露
minecraft:redstone_north、minecraft:redstone_east、minecraft:redstone_south与minecraft:redstone_west四个状态,取值none、side与up。
修复
- 更改
minecraft:geometry组件的n_way_visual_rotation现在能在多人世界中从房主正确同步到其他客户端。 - 更改 恢复了方块几何体中布尔型骨骼可见性字段的支持。
实体
实体组件解析更严格
- 更改 格式版本为
1.26.60或更高的实体定义,在下列组件中使用了无效数据时会加载失败:- 移动类:
minecraft:movement.basic、minecraft:movement.sway、minecraft:movement.skip、minecraft:movement.generic、minecraft:movement.amphibious、minecraft:movement.fly、minecraft:movement.hover、minecraft:movement.dolphin、minecraft:movement.glide、minecraft:pushable_by_block。 - 其他组件:
minecraft:rideable、minecraft:dash_action、minecraft:rail_movement、minecraft:scale_by_age、minecraft:strength、minecraft:teleport、minecraft:economy_trade_table、minecraft:healable、minecraft:inventory、minecraft:spell_effects、minecraft:transformation、minecraft:shareables、minecraft:trail。 - AI 意向:
minecraft:behavior.tempt、minecraft:behavior.float_tempt、minecraft:behavior.send_event、minecraft:behavior.panic。
- 移动类:
- 更改 下列参数需要改写:
minecraft:movement.jump的jump_delay、minecraft:timer的time、minecraft:economy_trade_table的cured_discount与max_cured_discount只接受带min与max的对象。minecraft:rideable的seats、minecraft:shareables的items改为只接受数组。minecraft:buoyant的movement_type只接受none、waves与bobbing,liquid_blocks的每一项必须是非空方块标识符或有效的方块描述符。minecraft:healable的items项必须是对象,其中的effects必须是效果对象组成的数组。minecraft:attack的damage只接受标量或带min与max的对象,数组写法不再有效。minecraft:transformation的delay不再接受纯数字,需写成{"value": 秒数};begin_transform_sound与transformation_sound不再接受单个字符串,需写成音效名数组。delay.value、block_radius与block_max不再接受负值,block_assist_chance与block_chance取值0.0~1.0。
数据驱动实体组件
- 新增
minecraft:trail组件的replaceable_blocks参数,用于定义轨迹可以替换的方块,不指定时只替换空气。 - 新增
minecraft:trail组件的radius参数,用于定义以spawn_offset为中心的水平方形半径,取值-1~16。取-1时沿用旧版的四角放置行为。 - 新增
minecraft:trail组件的force_replace_matched_blocks参数,为true时即使正常放置规则不允许也会替换匹配的方块。默认值为false。 - 更改
minecraft:behavior.panic不再在生物被困住时每刻反复停止与启动。
其他
- 新增 新增
look_direction脱离骑乘模式,乘客会在朝向方向上不是熔岩的相邻方块上下来。
世界生成
地物与结构
- 更改
mega_trunk的trunk_width参数现在接受浮点区间,用于配置不同厚度,例如[2, 3]。旧写法仍然有效。 - 新增 拼图结构定义新增可选的
on_placed参数,用于指定结构放置到世界后执行的回调。 - 更改 省略
may_replace参数时,矿石地物的生成规则不再被跳过。
自定义维度
- 更改
minecraft:clouds组件现在接受-512~512范围内的任意云高度,不再限于-64~320。
ScriptAPI
该版本开放了@minecraft/server的2.11.0版本与@minecraft/server-ui的2.3.0版本。
世界
- 新增 世界时钟:
WorldClockRegistry类、WorldClock类、TimeMarker类与WorldClockRegistrationOptions接口,用于注册与查询世界时钟。 - 新增 世界时钟错误:
WorldClockRegistrationError、WorldClockReloadNewWorldClockError、WorldClockNotFoundError、WorldClockTimeMarkerNotFoundError、WorldClockRewindError等类。 - 新增
WorldSoundOptions.isBroadcast属性,为true时由服务端广播播放,在广播范围内的玩家之间保持同步。 - 新增
TextPrimitive类的lineGapHeight属性,用于设置多行文本的行距。 - 世界前事件
- 新增 世界时钟重启前事件:开放了
WorldClockOnRestartBeforeEvent,以及WorldClockEventOptions接口。
- 新增 世界时钟重启前事件:开放了
- 世界后事件
- 新增 世界时钟事件:开放了
WorldClockOnTimeModifiedAfterEvent、WorldClockOnPausedAfterEvent、WorldClockOnResumedAfterEvent与WorldClockOnTimeMarkerAfterEvent,以及WorldClockTimeMarkerEventOptions接口。
- 新增 世界时钟事件:开放了
维度
- 新增
Dimension.spawnXp方法,用于在指定位置生成经验球。
实体
- 新增
EntityIsTamedComponent类的tamedToPlayer与tamedToPlayerId属性,用于获取驯服该实体的玩家。
声音
- 新增
SoundInstance类新增setVolume、setPitch、fade、seekTo、pause与resume方法。 - 新增
PlayerSoundOptions与WorldSoundOptions新增loopCount参数,取-1时只要保留对SoundInstance的引用就会一直循环。 - 更改
setVolume与fade现在把音量作为声音定义音量的乘数,而不是直接替换。
界面
- 新增 自定义表单的提示框:
DropdownOptions、SliderOptions、TextFieldOptions、TextOptions与ToggleOptions新增tooltip参数。 - 新增 按钮图标:
ButtonOptions.imageDetails、ImageDetails、MessageBoxButtonOptions,以及MessageBox.button1WithOptions与MessageBox.button2WithOptions方法。
其他
- 更改
.mcstructure结构文件支持 zlib 压缩。根级新增整型的compression标签,取1时整个结构以压缩形式存储,从游戏导出的结构现在默认压缩。 - 新增 位图字体可以在图集旁的 JSON 中用
ascii_character_height与ascii_character_y_offset配置 ASCII 字形的高度与垂直偏移。 - 更改 多选包设置现在会在下拉菜单上方显示名称,并支持用
selection_text自定义显示文本。