箭矢穿玻璃(数据包)
适用于 Minecraft Java Edition 1.21.11(数据包格式 94)。
飞行速度足够快的箭矢会击碎玻璃板并继续飞行,但会损失大部分速度。
满蓄力的弓或弩射击可以在较远距离上击碎一块玻璃板;弱蓄力射击、骷髅射出的箭或发射器射出的箭则无法做到。在正常速度下,箭矢只能击碎一块玻璃板,因为之后它的速度会变得太慢;如果给箭矢赋予极高的速度(例如通过命令),它可以穿过多个玻璃板。
安装
将 zip 文件放入世界的 datapacks 文件夹中,然后运行 /reload 或重新打开世界。
启用 / 禁用
该数据包遵循原版游戏规则:
/gamerule minecraft:projectiles_can_break_blocks false
配置
数值为计分板分数,可随时更改:
| 设置项 |
默认值 |
含义 |
#min_speed |
250 |
击碎方块所需的速度,单位为“每刻百分之一格”(250 = 每刻 2.5 格)。满蓄力弓射击起始速度为 3.0,弩为 3.15。 |
#kept_speed |
40 |
projectiles 击碎方块后保留的速度百分比。 |
/scoreboard players set #min_speed agtg.config 200
/scoreboard players set #kept_speed agtg.config 40
/function arrows_go_through_glass:config/show
/function arrows_go_through_glass:config/reset
可破坏的方块与投射物
- 可破坏的方块:方块标签
arrows_go_through_glass:breakable(所有玻璃板,以及当加载器提供时包含 #c:glass_panes)。
- 投射物:实体类型标签
arrows_go_through_glass:projectiles(#minecraft:arrows,即箭矢和光灵箭)。可以添加三叉戟(minecraft:trident);其他投射物如雪球不受此数据包支持。
- 路径扫描穿透的方块:方块标签
arrows_go_through_glass:passable(空气、流体、植物、火把、铁轨等)。
要更改这些设置,请从另一个加载在此数据包之上的数据包中覆盖这些标签。
被破坏的方块不会掉落任何物品。
已知限制
- 数据包按单元格检查箭矢路径上的方块,而不是玻璃板的薄碰撞箱:如果箭矢非常靠近玻璃板且经过相同的单元格,可能会将其击碎。
- 站在玻璃板正前方的生物并不能保护它:即使箭矢击中生物,玻璃板仍可能被击碎。
- 路径上的部分方块(台阶、栅栏、地毯等)会停止扫描,因此紧挨着它们后面的玻璃板可能不会被击碎。
卸载
/function arrows_go_through_glass:uninstall
/datapack disable "file/arrows-go-through-glass-datapack-1.0.0.zip"

Arrows Go Through Glass (datapack)
Minecraft Java Edition 1.21.11 (data pack format 94).
Arrows flying fast enough shatter glass panes and keep flying, losing most of their speed.
A full-power bow or crossbow shot breaks a pane over a long distance; a weak shot, a skeleton
arrow or a dispenser arrow does not. At normal speeds an arrow can only break one pane, since it
is too slow afterwards; an arrow given an extreme speed (for example with commands) can go
through several.
Installation
Put the zip file in the datapacks folder of your world, then run /reload or reopen the world.
Enabling / disabling
The datapack follows the vanilla gamerule:
/gamerule minecraft:projectiles_can_break_blocks false
Configuration
Values are scoreboard scores and can be changed at any time:
| Setting |
Default |
Meaning |
#min_speed |
250 |
Speed needed to break a block, in hundredths of a block per tick (250 = 2.5 blocks/tick). A full-power bow shot starts at 3.0, a crossbow at 3.15. |
#kept_speed |
40 |
Percentage of its speed the projectile keeps after breaking a block. |
/scoreboard players set #min_speed agtg.config 200
/scoreboard players set #kept_speed agtg.config 40
/function arrows_go_through_glass:config/show
/function arrows_go_through_glass:config/reset
Breakable blocks and projectiles
- Breakable blocks: block tag
arrows_go_through_glass:breakable (all glass panes, plus #c:glass_panes
when a mod loader provides it).
- Projectiles: entity type tag
arrows_go_through_glass:projectiles (#minecraft:arrows, i.e. arrows
and spectral arrows). Tridents can be added (minecraft:trident); other projectiles such as snowballs
are not supported by the datapack.
- Blocks the path scan sees through: block tag
arrows_go_through_glass:passable (air, fluids, plants,
torches, rails...).
To change them, override these tags from another datapack loaded above this one.
Broken blocks never drop anything.
Known limitations
- The datapack checks the blocks on the arrow's path cell by cell, not the pane's thin hitbox:
an arrow passing very close to a pane, through the same block cell, can break it.
- A mob standing right in front of a pane does not protect it: the pane can break even if the
arrow hits the mob.
- Partial blocks (slabs, fences, carpets...) on the path stop the scan, so a pane right behind
them may not break.
Uninstalling
/function arrows_go_through_glass:uninstall
/datapack disable "file/arrows-go-through-glass-datapack-1.0.0.zip"

评论 0
登录后参与评分
还没有评论,来抢沙发吧