手冊: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的錯誤在國際版中由錯誤追蹤器維護,請在此回報錯誤。