作者:Mikael Hedberg
发布日期:2023-02-08
原文链接:https://www.minecraft.net/en-us/article/minecraft-snapshot-23w06a
汉化版链接:https://silentdepth.notion.site/MINECRAFT-23W06A-5e726b6072f04b5b872b58d18280dfd4

MINECRAFT 快照 23W06A
$$
\small\textsf{一个 Minecraft Java 版快照}
$$
今天我们带来了 damage 命令和新的显示实体。
注意伤害安全!
内容改动
- 唱片机现在会在播放唱片时冒出一个音符粒子以匹配基岩版的行为
辅助功能
- 在辅助功能菜单添加了一个名为伤害抖动的新选项,用于控制受到伤害时画面的震动程度
- 在按键绑定画面添加了可显示冲突按键的信息提示
- 「通知显示时间」辅助功能选项被重命名为「通知时间」
更新的创建新世界画面
- 页签可通过 Ctrl+Tab 和 Ctrl+Shift+Tab 切换
- 页签也可通过 Ctrl+页签序号直接切换
    
- 添加了便于启用/停用实验性特性的新画面
    - 可在「更多」页签找到这个画面
- 在快照版本中的「游戏」页签会有一个快捷按钮
 
创造模式菜单
- 添加了绘画变种
- 预置变种的绘画现在会在鼠标悬停时显示作者和标题
技术性改动
- 添加了用于弹性显示物品、方块和文本的显示实体
- 添加了用于对实体造成伤害的 damage命令
- 为专用服务器命令行添加了用于输出进程 ID 到文件 的 --pidFile参数
- 添加了如下游戏事件:
    - entity_dismount(振动频率为 6)
- entity_mount(振动频率为 7)
 
- 添加了用于显示物品、方块和文本的一组实体
- 添加了用于自定义新生成实体的命令 execute summon
显示实体
游戏添加了三种新实体用于弹性显示物品、方块和文本。
- 这些实体类似 marker,不计算游戏刻,也没有碰撞和物理行为
- 模型渲染于实体位置,支持 X 轴和 Y 轴上的常规旋转(所以它可用 teleport 命令控制),还支持其他通用的模型变换
常见数据类型
这些实体的标签内容包含一些结构复杂的新数据类型。任意形式都能用于修改数据,但只有一种形式用于储存。
ROTATION
- 四元数形式(用于储存):包含 4 个数字的数组,用于描述组件(x、y、z、w)
- 轴角形式:包含如下字段的对象:
    
TRANSFORMATION
任意仿射转换。
- 矩阵形式:包含 16 个数字的数组,用于描述行优先矩阵
- 分解形式(用于储存):包含如下字段的对象:
    - translation– 3D 矢量
- left_rotation、- right_rotation–- rotation
- scale– 3D 矢量
- 变换按 translation、left_rotation、scale、right_rotation的顺序组成
 
插值
显示实体的部分属性可以插值。这表示客户端可以看到渐进式的改变而不是瞬间跳跃。
显示实体会持续记录插值的当前和上一个数值:
- 标记为「被插值」的所有属性都是一个插值组的一部分
- 对被插值属性的任何更新都会导致插值组的所有数值被储存为「当前值」
    - 数据命令的执行若不改变属性的值(即便它存在于 NBT)则不被认为是一次更新
- 更新同步到客户端的频率不高于每刻一次,因此一次命令的多次更新仍会被视为一次更新
 
- 上一个当前值被储存为「上次值」
- 插值被激活时,实体会从「上次值」随时间过渡到「当前值」
- 插值的起点(实体完全处于「上次值」的状态)由字段 interpolation_start定义(游戏时间,以刻为单位)
- 插值的终点(实体完全处于「当前值」的状态)由 interpolation_start+interpolation_duration定义(以刻为单位)
常见属性
此类每个实体都拥有如下字段:
- transformation– 应用到模型的- transformation(在确定实体朝向之后)。默认无变换。可插值
- billboard– 用于控制实体是否应在渲染时面向玩家:- fixed– 不旋转(默认值)
- vertical– 实体可沿垂直轴转动
- horizontal– 实体可沿水平轴转动
- center– 实体可沿中心点转动
 
- brightness– 若存在,覆盖渲染用的亮度值。默认省略(即使用实体所在位置的值进行渲染)。对象包含两个字段:- sky– 天光的值,0..15
- block– 方块亮度的值,0..15
 
- view_range– 实体的最大可视范围。实际距离取决于客户端渲染距离和实体距离比例。默认值为 1.0(与火球大致相等)
- shadow_radius– 阴影大小。默认为 0(无阴影)。可插值
- shadow_strength– 阴影强度。以到下方方块的距离的函数的形式控制阴影的透明度。默认为 1.可插值
- width、- height– 描述剔除边界箱 (Culling Bounding Box) 的尺寸。边界箱从实体位置在垂直方向上覆盖- y到- y+height,在水平方向上覆盖- width/2。如果任意字段设置为 0,剔除机制会被禁用。二者默认都为 0
- glow_color_override– 覆盖边框发光的颜色。默认为 0(使用团队颜色)
ITEM_DISPLAY
显示一个物品堆叠。
- 堆叠可以通过命令设定 inventory.0插槽来修改
字段:
- item– 要显示的物品堆叠。与物品栏使用的格式相同(例如:- {id: "minecraft:dirt", Count: 1})
- item_display– 描述应用到物品的物品模型变换(由模型 JSON 中的- display部分定义)- 值:none(默认值)、thirdperson_lefthand、thirdperson_righthand、firstperson_lefthand、firstperson_righthand、head、gui、ground、fixed
 
BLOCK_DISPLAY
显示一个方块状态。
- 不会显示方块实体,即使它正常情况下可以通过方块创建放置(例如箱子)
字段:
- block_state– 要显示的方块状态。与末影人手持物品的格式相同(例如- {Name:"minecraft:dirt"})
TEXT_DISPLAY
显示一个文本组件。
字段:
- text– 要显示的文本。组件会在显示实体的上下文中被解析
- line_width– 用于分割的行宽(注:新行也可通过- \\n字符添加)。默认为 200
- text_opacity– 渲染文本的透明度(alpha 组件)。默认为 255。可插值
- background– 背景色。包含 alpha 通道。默认为 0x40000000。可插值
- default_background– 若为 true,渲染会使用默认文本背景色(与聊天界面相同)。默认为 false
- shadow– 文本是否投影。默认为 false
- see_through– 文本是否能穿透方块显示。默认为 false
- alignment– 文本如何对齐
注:文本背景使用新的着色器类型 rendertype_text_background 和 rendertype_text_background_see_through
伤害类型
伤害类型是一个可通过数据包扩展的新注册表。一个伤害类型决定游戏如何处理伤害。这包括伤害包含什么属性以及实体在因该种伤害类型死亡时要使用何种死亡消息。
例如:
{
  "exhaustion": 0.1,
  "message_id": "arrow",
  "scaling": "when_caused_by_living_non_player"
}
字段:
- message_id:由此种伤害类型造成的死亡所使用的消息 ID
- exhaustion:由此种伤害类型造成的饥饿度消耗的数量
- scaling:此种伤害类型是否随着难度等级而加强。可能值:- never:伤害始终相同
- always:伤害会跟随难度而增加
- when_caused_by_living_non_player:伤害会跟随难度而增加,但仅在由非玩家活跃实体造成时
 
- effects:可选字段,控制施加到玩家的伤害如何表现。可能值:- hurt(默认值):默认的伤害音效
- thorns:荆棘伤害音效
- drowning:溺水音效
- burning:单次燃烧音效
- poking:浆果丛刺伤音效
- freezing:单次冻结音效
 
- death_message_type:可选字段,控制是否使用特殊的死亡消息变种。可能值:- default(默认值):不使用特殊的死亡消息逻辑
- fall_variants:显示跌落伤害死亡消息的变种而非常规的死亡消息,例如- death.fell.assist.item
- intentional_game_design:显示刻意的游戏设计而非常规的死亡消息
 
伤害类型标签控制如何解析不同来源的伤害的许多方面。
命令
DAMAGE
对实体造成伤害的新命令。
格式:
- damage <target> <amount> [<damageType>] [at <location>]
- damage <target> <amount> [<damageType>] [by <entity>] [from <cause>]
参数:
- target:要伤害的实体
- amount:施加伤害的量
- damageType:施加伤害的类型
- entity:施加伤害的实体
- cause:在间接伤害情况中的伤害来源- 例如:被箭击中时,entity是箭弹射物,而cause可能是一个骷髅
 
- location:伤害的施加来源位置(在没有实体施加伤害时)- 举例来说,location可能代表一个在下界中的床炸位置
 
EXECUTE SUMMON
execute 的新子命令,用于召唤新实体并同时附加上下文(@s)。这旨在简化实体配置和减少编辑原始 NBT 的需要。
- execute summon <entity id>
谓词
伤害类型谓词
以下字段已从伤害类型谓词中移除:
is_projectile、is_explosion、bypasses_armor、bypasses_invulnerability、bypasses_magic、is_fire、is_magic、is_lightning。
添加了一个新的数组型字段 tags。其中的元素有两个字段:
- id:伤害类型标签的 ID
- expected:用于谓词匹配的伤害是否包含该标签的情况
游戏规则
- 添加了 doVinesSpread游戏规则,用于控制藤蔓是否蔓延到临近方块
23W06A 错误修复
- MC-12729 - Z-fighting can be seen on leggings and boots worn by entities
- MC-145765 - Both "Text Background" settings strings are overflowing the buttons
- MC-156443 - In some languages, text is too long and escapes buttons
- MC-198874 - Opening a Minecart with Hopper provokes Piglins, even though opening a Hopper doesn't provoke them
- MC-209622 - Sculk sensors do not detect item frame / glow item frame interactions
- MC-209896 - Sculk sensors are not activated upon placing glowstone into respawn anchors
- MC-209929 - Sculk sensors are not activated upon filling composters
- MC-210276 - Sculk sensors are not activated upon trampling farmland
- MC-210294 - Sculk sensors are not activated upon mounting or dismounting any non-biological entities
- MC-210334 - Sculk sensors are not activated upon sheep being dyed
- MC-210707 - Sculk sensors are not activated upon closing chest boats, chest rafts, or chest minecarts
- MC-210715 - Sculk sensors are not activated upon attaching or removing leads from entities
- MC-212501 - Sculk sensors are not activated upon collecting books from lecterns
- MC-213803 - Sculk sensors are not activated upon harvesting glow berries from cave vines
- MC-215767 - Sculk sensors do not detect turtles laying an egg
- MC-233972 - Text can appear outside of buttons in the key binds menu when assigning keys to functions or when multiple functions are assigned to the same key
- MC-236988 - Sculk sensors are not activated upon using shears on cave/twisting/weeping vines or kelp
- MC-237450 - The "Simulation Distance" text can appear outside of its slider
- MC-237879 - Sculk sensors are not activated upon villagers working with composters
- MC-249878 - Text can appear outside of the "Device" button within the music and sound options menu
- MC-251917 - No gear equipping sound or subtitle when a shield is placed into the offhand slot
- MC-251934 - Sculk sensors are not activated upon frogs laying frogspawn
- MC-252434 - Sculk sensors are activated when interacting with fences while holding leads
- MC-257873 - Swapping an armor piece with an armor piece of the same type doesn't play its equipping sound
- MC-258156 - The Warden does not deal the same amount of damage to the player and entities in difficult mode
- MC-258622 - Fire charge isn't in the Ingredients tab in creative inventory
- MC-259193 - The "Notification Display Time" text can appear outside of its slider
- MC-259195 - Using /ride on an entity in another dimension causes client/server desync
- MC-259197 - The damage tilt effect isn't accessible-friendly
- MC-259221 - Using the "/ride" command on invalid entities teleports players to their position
- MC-259224 - Blocking attacks with shields causes the damage tilt to play and red damage tint to show
- MC-259227 - /execute if loaded alone always fails
- MC-259233 - Argument error messages for low values are inconsistently spelled
- MC-259245 - An enderman ridden with /ride constantly teleports if the player looks at the enderman's eyes
- MC-259247 - The execute on owner sub-command does not select the owner of a horse, donkey, llama, or mule
- MC-259360 - The "selectWorld.mapFeatures.info" string is missing a comma after the word "Shipwrecks"
- MC-259432 - Single missing pixel in 'chestplate_trim' item texture
- MC-259442 - Can't shift click items into second anvil slot
- MC-259454 - Loot table for hoglin stable chests uses the loot table for bridge chests instead
- MC-259468 - empty_slot_amethyst_shard does not show in Smithing Table slot
- MC-259599 - Curse of Binding armor can be removed by swapping armor with right click in hotbar
- MC-259635 - The color palettes for "iron" and "iron_darker" trims are flipped
- MC-259640 - The lightest three colors of "iron" and "iron_darker" color palettes are identical