手册:minecraft:projectile

来自Minecraft基岩版开发Wiki
数据驱动 实体 > minecraft:projectile
minecraft:projectile
附加包组件
组件所属
组件类型
组件ID
1922456869
加入版本
?

设置实体为弹射物

模式[编辑]

projectile:
object "minecraft:projectile" : opt
{
    int "anchor"<0-2> : opt
    float "angle_offset" : opt
    bool "catch_fire" : opt
    bool "crit_particle_on_hurt" : opt
    bool "destroy_on_hurt" : opt
    string "filter" : opt
    bool "fire_affected_by_griefing" : opt
    float "gravity" : opt
    string "hit_ground_sound" : opt
    string "hit_sound" : opt
    bool "hit_water" : opt
    bool "homing" : opt
    float "inertia" : opt
    bool "is_dangerous" : opt
    bool "knockback" : opt
    bool "lightning" : opt
    float "liquid_inertia" : opt
    bool "multiple_targets" : opt
    array "offset"[3] : opt
    {
        float "[0..0]"
        float "[1..1]"
        float "[2..2]"
    }
    float "on_fire_time"<0-*> : opt
    object "on_hit" : opt
    {
        bool "catch_fire" : opt
        object "definition_event" : opt
        {
            bool "affect_projectile" : opt
            bool "affect_target" : opt
            bool "affect_shooter" : opt
            bool "affect_splash_area" : opt
            object "event_trigger" : opt
            {
                string "event"
                enumerated_value "target" : opt
                minecraft_filter "filters" : opt
            }
            float "splash_area" : opt
        }
        bool "douse_fire" : opt
        object "douse_fire" : opt
        {
        }
        object "freeze_on_hit" : opt
        {
            enumerated_value "shape"<"sphere", "cube"> : opt
            float "size"<0-*> : opt
            bool "snap_to_block" : opt
        }
        object "grant_xp" : opt
        {
            int "minXP"<0-*> : opt
            int "maxXP"<0-*> : opt
            int "xp"<0-*> : opt
        }
        object "hurt_owner" : opt
        {
            bool "ignite" : opt
            bool "knockback" : opt
            int "owner_damage" : opt
        }
        bool "ignite" : opt
        object "impact_damage" : opt
        {
            bool "catch_fire" : opt
            bool "channeling" : opt
            int "damage" : opt
            array "damage"[2] : opt
            {
                int "[0..0]"
                int "[1..1]"
            }
            bool "destroy_on_hit_requires_damage" : opt
            bool "destroy_on_hit" : opt
            string "filter" : opt
            bool "knockback" : opt
            int "max_critical_damage" : opt
            int "min_critical_damage" : opt
            float "power_multiplier" : opt
            bool "semi_random_diff_damage" : opt
            bool "set_last_hurt_requires_damage" : opt
        }
        object "mob_effect" : opt
        {
            bool "ambient" : opt
            int "amplifier" : opt
            int "duration"<0-*> : opt
            int "durationeasy" : opt
            int "durationhard" : opt
            int "durationnormal" : opt
            string "effect" : opt
            bool "visible" : opt
        }
        float "on_fire_time"<0-*> : opt
        object "particle_on_hit" : opt
        {
            int "num_particles" : opt
            bool "on_entity_hit" : opt
            bool "on_other_hit" : opt
            string "particle_type" : opt
        }
        int "potion_effect" : opt
        object "remove_on_hit" : opt
        {
        }
        bool "spawn_aoe_cloud" : opt
        object "spawn_aoe_cloud" : opt
        {
            bool "affect_owner" : opt
            array "color" : opt
            {
                int "[0..0]"<0-255>
                int "[1..1]"<0-255>
                int "[2..2]"<0-255>
            }
            int "duration" : opt
            string "particle" : opt
            int "potion" : opt
            float "radius_on_use" : opt
            float "radius" : opt
            int "reapplication_delay" : opt
        }
        object "spawn_chance" : opt
        {
            int "first_spawn_count"<0-*> : opt
            float "first_spawn_percent_chance"<0-100> : opt
            int "second_spawn_count"<0-*> : opt
            float "second_spawn_percent_chance"<0-100> : opt
            bool "spawn_definition" : opt
            string "spawn_baby" : opt
        }
        object "stick_in_ground" : opt
        {
            float "shake_time"<0-*> : opt
        }
        bool "teleport_owner" : opt
        object "thrown_potion_effect" : opt
        {
        }
    }
    string "particle" : opt
    int "potion_effect" : opt
    float "power" : opt
    bool "reflect_on_hurt" : opt
    bool "semi_random_diff_damage" : opt
    string "shoot_sound" : opt
    bool "shoot_target" : opt
    bool "should_bounce" : opt
    bool "splash_potion" : opt
    float "splash_range" : opt
    bool "stop_on_hurt" : opt
    float "uncertainty_base" : opt
    float "uncertainty_multiplier" : opt
}

结构[编辑]

  •  minecraft:projectile:根对象。
    •  anchor:定义弹射物发射的锚点。默认值为0。
    •  angle_offset:定义弹射物垂直发射的角度偏移量,以度为单位。默认值为0.0。
    •  catch_fire:定义实体被弹射物击中时是否会着火。默认值为false
    •  crit_particle_on_hurt:定义弹射物造成伤害时是否生成暴击伤害粒子。默认值为false
    •  destroy_on_hurt:定义当弹射物受到伤害时,是否立即被摧毁。默认值为false
    •  filter:定义不会被弹射物造成伤害的实体。
    •  fire_affected_by_griefing:定义弹射物产生是否受 mobGriefing 游戏规则影响。默认值为false
    •  gravity:定义弹射物所受的重力。当弹射物不在地面时,每刻将从弹射物的垂直坐标上减去该参数的值(值越大下落速度越快)。默认值为0.05。
    •  hit_ground_sound:定义当弹射物击中地面时播放的声音。
    •  hit_sound:定义当弹射物击中某物时播放的声音。
    •  hit_water:定义弹射物是否将流体视作固体方块。默认值为false。(需开启教育版游戏玩法)
    •  homing:定义弹射物是否飞向最近的实体。默认值为false
    •  inertia:定义弹射物在空中飞行时,每一刻速度保留量的百分比(即模拟惯性,值越大惯性越大;为1时即匀速运动)。默认值为0.99。
    •  is_dangerous:定义是否在组件内响应受伤行为事件。该参数仅对凋灵之首蓝色凋灵之首生效。默认值为false
    •  knockback:定义弹射物是否能将实体击退。默认值为false
    •  lightning:定义是否在被弹射物击中的实体处生成闪电。默认值为false
    •  liquid_interia:定义弹射物在水中飞行时,每一刻速度保留量的百分比(即模拟惯性,值越大惯性越大;为1时即匀速运动)。默认值为0.6。
    •  multiple_targets:定义弹射物每次飞行时是否可击打多个实体。默认值为true
    •  offset:定义弹射物生成时基于锚点的偏移量。此参数数组包含三个浮点数([a,b,c]),分别表示x轴、y轴和z轴方向上的偏移量。浮点数单位为像素,像素大小以原版默认缩放纹理为准。默认值为[0,0,0]
    •  on_fire_time:定义击中实体后实体着火的持续时间,以秒为单位。默认值为0.0。
    •  on_hit:定义弹射物击中目标时的行为。
    •  particle:定义发生碰撞时生成粒子的类型。默认值为iconcrack
    •  potion_effect:定义药箭将赋予它所击中实体的状态效果。可填药水ID,默认值为-1。
    •  power:定义弹射物的初速度。默认值为1.3。
    •  reflect_on_hurt:定义弹射物是否能在被击中时反弹。默认值为false
    •  semi_random_diff_damage:定义弹射物所造成的伤害是否根据基础伤害和速度随机取值。默认值为false
    •  shoot_sound:定义弹射物发射时播放的声音。
    •  shoot_target:定义弹射物是否射向实体所射击的目标。默认值为true
    •  should_bounce:定义弹射物是否在击中时反弹。默认值为false
    •  splash_potion:定义是否将弹射物视作喷溅药水。默认值为false
    •  splash_range:定义弹射物造成喷溅效果的半径,以方块为单位。默认值为4。
    •  stop_on_hurt:定义弹射物是否在实体受伤时静止。默认值为false
    •  uncertainly_base:定义弹射物的基础精度。弹射物的精度计算公式为基础精度-难度等级×精度乘数
    •  uncertainly_multiplier:定义弹射物的精度乘数。

枚举值[编辑]

锚点[编辑]

弹射物锚点枚举
键名 描述
Origin 0
EyeHeight 1
Middle 2

状态效果[编辑]

生物效果列表
键名 接口字符串 实验性玩法 有害 颜色 粒子 图标索引 描述
资源名称 组件名称 描述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

粒子类型[编辑]

粒子类型枚举
键名 值(中国版) 接口字符串 描述
Undefined 0 0 none 空粒子
Bubble 1 1 bubble
BubbleManual 2 2 bubblemanual
Crit 3 3 crit
BlockForceField 4 4 blockforcefield
Smoke 5 5 smoke
Explode 6 6 explode
Evaporation 7 7 evaporation
Flame 8 8 flame
CandleFlame 9 9 candleflame
Lava 10 10 lava
LargeSmoke 11 11 largesmoke
RedDust 12 12 reddust
RisingBorderDust 13 13 risingborderdust
IconCrack 14 14 iconcrack
SnowballPoof 15 15 snowballpoof
LargeExplode 16 16 largeexplode
HugeExplosion 17 17 hugeexplosion
BreezeWindExplosion 18 18 breezewindexplosion
MobFlame 19 19 mobflame
Heart 20 20 heart
Terrain 21 21 terrain
TownAura 22 22 townaura
Portal 23 23 portal
MobPortal 24 24
WaterSplash 25 25 watersplash
WaterSplashManual 26 26 watersplashmanual
WaterWake 27 27 waterwake
DripWater 28 28 dripwater
DripLava 29 29 driplava
DripHoney 30 30 driphoney
StalactiteDripWater 31 31 stalactitedripwater
StalactiteDripLava 32 32 stalactitedriplava
FallingDust 33 33 fallingdust
MobSpell 34 34 mobspell
MobSpellAmbient 35 35 mobspellambient
MobSpellInstantaneous 36 36 mobspellinstantaneous
Ink 37 37 ink
Slime 38 38 slime
RainSplash 39 39 rainsplash
VillagerAngry 40 40 villagerangry
VillagerHappy 41 41 villagerhappy
EnchantingTable 42 42 enchantingtable
TrackingEmitter 43 43 trackingemitter
Note 44 44 note
WitchSpell 45 45 witchspell
CarrotBoost 46 46 carrotboost
MobAppearance 47 47 mobappearance
EndRod 48 48 endrod
DragonBreath 49 49 dragonbreath
Spit 50 50 spit
Totem 51 51 totem
Food 52 52 food
FireworksStarter 53 53 fireworksstarter
Fireworks 54 54 fireworks
FireworksOverlay 55 55 fireworksoverlay
BalloonGas 56 56 balloongas
ColoredFlame 57 57 coloredflame
Sparkler 58 58 sparkler
Conduit 59 59 conduit
BubbleColumnUp 60 60 bubblecolumnup
BubbleColumnDown 61 61 bubblecolumndown
Sneeze 62 62 sneeze
CommonParticle N/A 63
ShulkerBullet 63 64 shulkerbullet
Bleach 64 65 bleach
DragonDestroyBlock 65 66 dragondestroyblock
MyceliumDust 66 67 myceliumdust
FallingBorderDust 67 68 fallingborderdust
CampfireSmoke 68 69 campfiresmoke
CampfireSmokeTall 69 70 campfiresmoketall
DragonBreathFire 70 71 dragonbreathfire
DragonBreathTrail 71 72 dragonbreathtrail
BlueFlame 72 73
Soul 73 74 soul
ObsidianTear 74 75 obsidiantear
PortalReverse 75 76 portalreverse
Snowflake 76 77 snowflake
VibrationSignal 77 78
SculkSensorRedstone 78 79
SporeBlossomShower 79 80
SporeBlossomAmbient 80 81
Wax 81 82 wax
ElectricSpark 82 83 electricspark
Shriek 83 84 shriek
SculkSoul 84 85 sculksoul
SonicExplosion 85 86 sonicexplosion
BrushDust 86 87
CherryLeaves 87 88
DustPlume 88 89 dustplume
WhiteSmoke 89 90 whitesmoke
VaultConnection 90 91 vaultconnection
WindExplosion 91 92 windexplosion
92 93 wolfarmorcrack

药水ID[编辑]

药水列表
键名 接口字符串 对应的状态效果 对应的变体 描述
名称ID 描述ID前缀 名称ID 放大率 持续时间(刻)
Water 0 water 空字符串 基底(26)
Mundane 1 mundane mundane 基底(26)
LongMundane 2 long_mundane mundane.extended 基底(26)
Thick 3 thick thick 基底(26)
Awkward 4 awkward awkward 基底(26)
Nightvision 5 nightvision nightVision night_vision 0 3600 夜视(15)
LongNightvision 6 long_nightvision nightVision night_vision 0 9600 夜视(15)
Invisibility 7 invisibility invisibility invisibility 0 3600 隐身(13)
LongInvisibility 8 long_invisibility invisibility invisibility 0 9600 隐身(13)
Leaping 9 leaping jump jump_boost 0 3600 跳跃(7)
LongLeaping 10 long_leaping jump jump_boost 0 9600 跳跃(7)
StrongLeaping 11 strong_leaping jump jump_boost 1 1800 跳跃(7)
FireResistance 12 fire_resistance fireResistance fire_resistance 0 3600 抗火(11)
LongFireResistance 13 long_fire_resistance fireResistance fire_resistance 0 9600 抗火(11)
Swiftness 14 swiftness moveSpeed speed 0 3600 迅捷(1)
LongSwiftness 15 long_swiftness moveSpeed speed 0 9600 迅捷(1)
StrongSwiftness 16 strong_swiftness moveSpeed speed 1 1800 迅捷(1)
Slowness 17 slowness moveSlowdown slowness 0 1800 迟缓(0)
LongSlowness 18 long_slowness moveSlowdown slowness 0 4800 迟缓(0)
WaterBreathing 19 water_breathing waterBreathing water_breathing 0 3600 水肺(12)
LongWaterBreathing 20 long_water_breathing waterBreathing water_breathing 0 9600 水肺(12)
Healing 21 healing heal instant_health 0 1 治疗(5)
StrongHealing 22 strong_healing heal instant_health 1 1 治疗(5)
Harming 23 harming harm instant_damage 0 1 伤害(6)
StrongHarming 24 strong_harming harm instant_damage 1 1 伤害(6)
Poison 25 poison poison poison 0 900 剧毒(18)
LongPoison 26 long_poison poison poison 0 2400 剧毒(18)
StrongPoison 27 strong_poison poison poison 1 450 剧毒(18)
Regeneration 28 regeneration regeneration regeneration 0 900 再生(9)
LongRegeneration 29 long_regeneration regeneration regeneration 0 2400 再生(9)
StrongRegeneration 30 strong_regeneration regeneration regeneration 1 450 再生(9)
Strength 31 strength damageBoost strength 0 3600 力量(4)
LongStrength 32 long_strength damageBoost strength 0 9600 力量(4)
StrongStrength 33 strong_strength damageBoost strength 1 1800 力量(4)
Weakness 34 weakness weakness weakness 0 1800 虚弱(17)
LongWeakness 35 long_weakness weakness weakness 0 4800 虚弱(17)
Wither 36 wither wither wither 1 800 衰变(19)
TurtleMaster 37 turtle_master turtleMaster slowness 3 400 神龟(24)
turtleMaster2 resistance 2 400
LongTurtleMaster 38 long_turtle_master turtleMaster slowness 3 800 神龟(24)
turtleMaster2 resistance 2 800
StrongTurtleMaster 39 strong_turtle_master turtleMaster slowness 5 400 神龟(24)
turtleMaster2 resistance 3 400
SlowFalling 40 slow_falling slowFalling slow_falling 0 1800 缓降(25)
LongSlowFalling 41 long_slow_falling slowFalling slow_falling 0 4800 缓降(25)
StrongSlowness 42 strong_slowness moveSlowdown slowness 3 400 迟缓(0)

示例[编辑]

"minecraft:projectile": {
  "on_hit": {
    "impact_damage": {
      "damage": [ 3, 5 ],
      "knockback": true,
      "semi_random_diff_damage": false,
      "destroy_on_hit": true
    },
    "stick_in_ground": {
      "shake_time" : 0.35
    }
  },
  "hit_sound": "projectile.example",
  "power": 1.6,
  "gravity": 0.05,
  "uncertainty_base": 16,
  "uncertainty_multiplier": 4,
  "anchor": 1,
  "should_bounce": true,
  "offset": [ 0, -0.2, 0 ]
}

历史[编辑]

基岩版
?加入了minecraft:projectile

漏洞[编辑]

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