手册:minecraft:attack

来自Minecraft基岩版开发Wiki
(重定向自Manual:Minecraft:attack
数据驱动 实体 > minecraft:attack_(实体组件)
minecraft:attack
附加包组件
组件所属
组件类型
加入版本
?

设置实体的攻击。

模式[编辑]

object "minecraft:attack" : opt
{
    range "damage"
    float "effect_duration"<0-*> : opt
    string "effect_name" : opt
}

结构[编辑]

  •  minecraft:attack:根对象。
    • *value:定义攻击伤害的取值范围。为数字类型时同时定义最小值和最大值;为数组类型时第一个元素定义最小值,第二个元素定义最大值。
    •  effect_duration:定义所赋予的状态效果的持续时间,以秒为单位。默认值为0.0。
    •  effect_name:定义赋予受攻击实体的状态效果类型

枚举值[编辑]

状态效果[编辑]

生物效果列表
键名 接口字符串 实验性玩法 有害 颜色 粒子 图标索引 描述
资源名称 组件名称 描述ID
EMPTY_EFFECT 0 empty minecraft:effect.empty 空字符串 N/A
 #385DC6
0 空效果
MOVEMENT_SPEED 1 speed minecraft:effect.speed potion.moveSpeed N/A
 #7CAFC6
0 速度
MOVEMENT_SLOWDOWN 2 slowness minecraft:effect.slowness potion.moveSlowdown N/A
 #5A6C81
1 缓慢
DIG_SPEED 3 haste minecraft:effect.haste potion.digSpeed N/A 急迫
DIG_SLOWDOWN 4 mining_fatigue minecraft:effect.mining_fatigue potion.digSlowDown N/A 挖掘疲劳
DAMAGE_BOOST 5 strength minecraft:effect.strength potion.damageBoost N/A 力量
HEAL 6 instant_health minecraft:effect.instant_health potion.heal N/A 瞬间治疗
HARM 7 instant_damage minecraft:effect.instant_damage potion.harm N/A 瞬间伤害
JUMP 8 jump_boost minecraft:effect.jump_boost potion.jump N/A 跳跃提升
CONFUSION 9 nausea minecraft:effect.nausea potion.confusion N/A 反胃
REGENERATION 10 regeneration minecraft:effect.regeneration potion.regeneration N/A 生命恢复
DAMAGE_RESISTANCE 11 resistance minecraft:effect.resistance potion.resistance N/A 抗性提升
FIRE_RESISTANCE 12 fire_resistance minecraft:effect.fire_resistance potion.fireResistance N/A 防火
WATER_BREATHING 13 water_breathing minecraft:effect.water_breathing potion.waterBreathing N/A 水下呼吸
INVISIBILITY 14 invisibility minecraft:effect.invisibility potion.invisibility N/A 隐身
BLINDNESS 15 blindness minecraft:effect.blindness potion.blindness N/A 失明
NIGHT_VISION 16 night_vision minecraft:effect.night_vision potion.nightVision N/A 夜视
HUNGER 17 hunger minecraft:effect.hunger potion.hunger N/A 饥饿
WEAKNESS 18 weakness minecraft:effect.weakness potion.weakness N/A 虚弱
POISON 19 poison minecraft:effect.poison potion.poison N/A 中毒
WITHER 20 wither minecraft:effect.wither potion.wither N/A 凋零
HEALTH_BOOST 21 health_boost minecraft:effect.health_boost potion.healthBoost N/A 生命提升
ABSORPTION 22 absorption minecraft:effect.absorption potion.absorption N/A 伤害吸收
SATURATION 23 saturation minecraft:effect.saturation potion.saturation N/A 饱和
LEVITATION 24 levitation minecraft:effect.levitation potion.levitation N/A 飘浮
FATAL_POISON 25 fatal_poison minecraft:effect.fatal_poison potion.poison N/A 中毒
CONDUIT_POWER 26 conduit_power minecraft:effect.conduit_power potion.conduitPower N/A 潮涌能量
SLOW_FALLING 27 slow_falling minecraft:effect.slow_falling potion.slowFalling N/A 缓降
BAD_OMEN 28 bad_omen minecraft:effect.bad_omen potion.badOmen N/A 不祥之兆
HERO_OF_THE_VILLAGE 29 village_hero minecraft:effect.village_hero potion.villageHero N/A 村庄英雄
DARKNESS 30 darkness minecraft:effect.darkness potion.darkness N/A

示例[编辑]

"minecraft:attack": {
  "damage": 4,
  "effect_duration": 10.0,
  "effect_name": "wither"
}

历史[编辑]

基岩版
?加入了minecraft:attack

漏洞[编辑]

关于minecraft:attack的漏洞在国际版中由漏洞追踪器维护,请在此报告漏洞。