1. Wiki
  2. /物品
  3. /minecraft:piercing_weapon

minecraft:piercing_weapon

不想手写?在 GodCraft 里打开一个开关,就能帮你设置好 minecraft:piercing_weapon。Get GodCraft

概览

minecraft:piercing_weapon 是一个物品组件:写在自定义物品的 components 对象中。 让攻击像长矛突刺一样击中使用者前方直线上的所有生物。带有该组件的物品无法破坏方块,因为攻击总是优先。

字段

字段类型默认值说明
reachFloatRange{"max":3,"min":0}前方多远(以方块为单位)的目标可以被击中。中间有方块会挡住攻击。
creative_reachFloatRange无创造模式下的攻击距离。省略时使用 reach。
hitbox_marginnumber0瞄准线周围的额外范围,让稍微偏离中心的目标也能被击中。

示例

写在 BP/items/<name>.json 的 components 对象中(值为默认值或占位值):

BP/items/<name>.json
{
  "minecraft:piercing_weapon": {
    "reach": {
      "max": 3,
      "min": 0
    },
    "creative_reach": 1,
    "hitbox_margin": 0
  }
}

物品: 行为包

We use cookies to improve your experience and analyse site traffic. Learn more