text:
#> asset:mob/0186.ferocious_bee/hurt/1.trigger
#
# Mobの被ダメージに実行されるfunction
#
# @within tag/function asset:mob/hurt

execute if data storage asset:context {id:186} run function asset:mob/0186.ferocious_bee/hurt/2.hurt


text:
#> asset:mob/0186.ferocious_bee/attack/1.trigger
#
# Mobの攻撃時に実行されるfunction
#
# @within tag/function asset:mob/attack

execute if data storage asset:context {id:186} run function asset:mob/0186.ferocious_bee/attack/2.attack

repo_name: ProjectTSB/TheSkyBlessing

repo_language: mcfunction

mime_type: text/plain


text:
#> asset:mob/0186.ferocious_bee/attack/2.attack
#
# Mobの攻撃時の処理
#
# @within function asset:mob/0186.ferocious_bee/attack/1.trigger

# 演出
    playsound entity.bee.sting hostile @a ~ ~ ~ 1 1

# ダメージを与える
# 引数の設定
    # 与えるダメージ
        data modify storage lib: Argument.Damage set value 14.0f
    # 第一属性
        data modify storage lib: Argument.AttackType set value "Physical"
    # 第二属性
        data modify storage lib: Argument.ElementType set value "None"
# 補正functionを実行
    function lib:damage/modifier
# 対象
    execute as @p[tag=Victim] run function lib:damage/
# リセット
    function lib:damage/reset


text:
#> asset:mob/0186.ferocious_bee/tick/2.tick
#
# Mobのtick時の処理
#
# @within function asset:mob/0186.ferocious_bee/tick/1.trigger

# スコア関連
    scoreboard players add @s 56.MoveTime 1
    scoreboard players remove @s[scores={56.HurtTime=0..}] 56.HurtTime 1

# スコアによって速度が変わる、突進のときはダメージを受けても止まらない。
    execute if entity @s[scores={56.MoveTime=..179}] unless score @s 56.HurtTime matches 0.. facing entity @p feet positioned ^ ^ ^-100 rotated as @s positioned ^ ^ ^-800 facing entity @s eyes positioned as @s run tp @s ^ ^ ^0.2 ~ ~
    execute if entity @s[scores={56.MoveTime=180..}] facing entity @p feet positioned ^ ^ ^-100 rotated as @s positioned ^ ^ ^-800 facing entity @s eyes positioned as @s run tp @s ^ ^ ^1 ~ ~

# スコアリセット
    scoreboard players reset @s[scores={56.MoveTime=200..}] 56.MoveTime

# のけぞりから復帰
    data modify entity @s[scores={56.HurtTime=..0}] NoAI set value 1b

# 演出
    execute if score @s 56.MoveTime matches 180 run playsound entity.bee.hurt hostile @a ~ ~ ~ 1 1
    execute if entity @s[scores={56.MoveTime=180..200}] run particle cloud ~ ~1.25 ~ 0.25 0.25 0.25 0 0

# クールタイムを減らす 0以下にはならない
    scoreboard players remove @s[scores={56.AttackCT=1..}] 56.AttackCT 1

# クールタイム中じゃないなら突進時に攻撃
    execute if entity @s[scores={56.MoveTime=180..}] unless score @s 56.AttackCT matches 1.. positioned ~-0.5 ~0.5 ~-0.5 if entity @p[tag=!PlayerShouldInvulnerable,dx=0] run function asset:mob/0186.ferocious_bee/tick/3.damage

# カベにぶつかった際の処理はない。壁は貫通するもの

# デスポーン処理
    execute unless entity @p[distance=..40] run function asset:mob/0186.ferocious_bee/tick/remove


text:
#> asset:mob/0186.ferocious_bee/tick/3.damage
#
#
#
# @within function asset:mob/0186.ferocious_bee/tick/2.tick

# 演出
    playsound entity.bee.sting hostile @a ~ ~ ~ 1 1

# 攻撃のCT設定
    scoreboard players set @s 56.AttackCT 20
# ダメージを与える
# 引数の設定
    # 与えるダメージ
        data modify storage lib: Argument.Damage set value 7.0f
    # 第一属性
        data modify storage lib: Argument.AttackType set value "Physical"
    # 第二属性
        data modify storage lib: Argument.ElementType set value "None"
# 補正functionを実行
    function lib:damage/modifier
# 対象
    execute as @p[tag=!PlayerShouldInvulnerable,dx=0] run function lib:damage/
# リセット
    function lib:damage/reset


text:
#> asset:mob/0186.ferocious_bee/tick/remove
#
#
#
# @within function asset:mob/0186.ferocious_bee/tick/2.tick

# 消失処理
    tp @s ~ -1000 ~
    kill @s


text:
#> asset:mob/0186.ferocious_bee/tick/1.trigger
#
# Mobが生きている間毎tick実行されるfunction
#
# @within tag/function asset:mob/tick

execute if data storage asset:context {id:186} run function asset:mob/0186.ferocious_bee/tick/2.tick


text:
#> asset:mob/0204_infernal_watcher/0.load
#
# MOBに利用するスコアボード等の初期化処理
#
# @within tag/function asset:mob/load

#> 定義類はここに
# @within function asset:mob/0204_infernal_watcher/**
    scoreboard objectives add 5O.HurtTime dummy
    scoreboard objectives add 5O.MoveTime dummy
    scoreboard objectives add 5O.AttackCT dummy
    scoreboard objectives add 5O.LifeTime dummy


text:
#> asset:mob/0204_infernal_watcher/death/2.death
#
# Mobの死亡時の処理
#
# @within function asset:mob/0204_infernal_watcher/death/1.trigger

    playsound minecraft:entity.spider.step hostile @a ~ ~ ~ 1.5 1.5
    playsound minecraft:block.wart_block.break hostile @a ~ ~ ~ 1.5 1
    playsound ogg:mob.blaze.breathe2 hostile @a ~ ~ ~ 1.5 1.5
    particle block crimson_hyphae ~ ~1.68 ~ 0 0 0 0 25


text:
#> asset:mob/0204_infernal_watcher/death/1.trigger
#
# Mobの死亡時に実行されるfunction
#
# @within tag/function asset:mob/death

execute if data storage asset:context {id:204} run function asset:mob/0204_infernal_watcher/death/2.death


text:
#> asset:mob/0204_infernal_watcher/summon/2.summon
#
# Mobの召喚時の処理
#
# @within function asset:mob/0204_infernal_watcher/summon/1.trigger

# 元となるMobを召喚する
    summon zombie ~ ~-100 ~ {NoAI:1b,Tags:["MobInit","AlwaysInvisible","AlwaysSlowFall"],Silent:1b,DeathLootTable:"asset:mob/death/0204_infernal_watcher"}
# ID (int)
    data modify storage asset:mob ID set value 204
# Type (string) Wikiを参照
    data modify storage asset:mob Type set value "Enemy"
# 干渉可能か否か (boolean)
    data modify storage asset:mob Interferable set value true
# 名前 (TextComponentString) (オプション)
    data modify storage asset:mob Name set value '{"text":"ヘルズウォッチャー","color":"red","italic":false}'
# 防具
    # 頭 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Head set value {id:"minecraft:stick",Count:1b,tag:{CustomModelData:20207}}
# 体力 (double) (オプション)
    data modify storage asset:mob Health set value 800
# 攻撃力 (double) (オプション)
    data modify storage asset:mob AttackDamage set value 0
# 防御力 (double) (オプション) // 被ダメージがある程度大きい場合1ptにつき0.8%カット、小さい場合1ptにつき約4%カット 20pt以上は頭打ち
    data modify storage asset:mob Defense set value 0
# 特殊防御力 (double) (オプション) // 4pointにつきダメージを大きく減らす
    data modify storage asset:mob SpecialDefense set value 0

# 属性倍率 // 1.0fで100% 最低でも25%は軽減されずに入る
    # 物理倍率 (float) (オプション)
        data modify storage asset:mob Resist.Physical set value 1.0f
    # 魔法倍率 (float) (オプション)
        data modify storage asset:mob Resist.Magic set value 1.0f
    # 火倍率 (float) (オプション)
        data modify storage asset:mob Resist.Fire set value 0.8f
    # 水倍率 (float) (オプション)
        data modify storage asset:mob Resist.Water set value 1.0f
    # 雷倍率 (float) (オプション)
        data modify storage asset:mob Resist.Thunder set value 1.0f

# 降りてくる
    execute positioned ~ ~-100 ~ run tp @e[type=zombie,tag=MobInit,distance=..0.01] ~ ~100 ~

# こっち向く
    execute as @e[type=zombie,tag=MobInit,distance=..0.01] facing entity @p eyes run tp @s ~ ~ ~ ~ ~

# この世界に存在できる時間
    scoreboard players set @e[type=zombie,tag=MobInit,distance=..0.01] 5O.LifeTime 1000

# MobInitタグ持ちを対象にして召喚関数呼び出し
    execute as @e[type=zombie,tag=MobInit,distance=..0.01] run function asset:mob/common/summon


text:
#> asset:mob/0204_infernal_watcher/summon/1.trigger
#
# Mob召喚処理の呼び出し時に実行されるfunction
#
# @within tag/function asset:mob/summon

execute if data storage asset:context {id:204} run function asset:mob/0204_infernal_watcher/summon/2.summon


text:
#> asset:mob/0204_infernal_watcher/hurt/2.hurt
#
# Mobの被ダメージ時の処理
#
# @within function asset:mob/0204_infernal_watcher/hurt/1.trigger

playsound minecraft:entity.spider.step hostile @a ~ ~ ~ 1.5 1.5
playsound minecraft:block.soul_sand.break hostile @a ~ ~ ~ 1.5 0.75
particle block crimson_hyphae ~ ~1.68 ~ 0 0 0 0 25

# HurtTimeをスコア化したら軽いのでは？
    scoreboard players set @s 5O.HurtTime 20
    data modify entity @s[scores={5O.MoveTime=..39}] NoAI set value 0b


text:
#> asset:mob/0204_infernal_watcher/hurt/1.trigger
#
# Mobの被ダメージに実行されるfunction
#
# @within tag/function asset:mob/hurt

execute if data storage asset:context {id:204} run function asset:mob/0204_infernal_watcher/hurt/2.hurt


text:
#> asset:mob/0204_infernal_watcher/tick/2.tick
#
# Mobのtick時の処理
#
# @within function asset:mob/0204_infernal_watcher/tick/1.trigger

# デーモンアイからコピーされたのをさらにコピー。幾何学って素敵！

# スコア関連
    scoreboard players add @s 5O.MoveTime 1
    scoreboard players remove @s[scores={5O.HurtTime=0..}] 5O.HurtTime 1

# スコアによって速度が変わる、最高速のときはダメージを受けても止まらない
    execute if entity @s[scores={5O.MoveTime=..39}] unless score @s 5O.HurtTime matches 0.. facing entity @p feet positioned ^ ^ ^-100 rotated as @s positioned ^ ^ ^-800 facing entity @s eyes positioned as @s run tp @s ^ ^ ^0.2 ~ ~
    execute if entity @s[scores={5O.MoveTime=40..}] facing entity @p feet positioned ^ ^ ^-100 rotated as @s positioned ^ ^ ^-800 facing entity @s eyes positioned as @s run tp @s ^ ^ ^0.5 ~ ~

# サウンド
    execute if entity @s[scores={5O.MoveTime=40}] run function asset:mob/0204_infernal_watcher/tick/event/start_frenzy
    execute if entity @s[scores={5O.MoveTime=100}] run function asset:mob/0204_infernal_watcher/tick/event/end_frenzy

# スコアリセット
    scoreboard players reset @s[scores={5O.MoveTime=100..}] 5O.MoveTime

# のけぞりから復帰
    data modify entity @s[scores={5O.HurtTime=..0}] NoAI set value 1b

# パーティクル
    particle dust 0.761 0.267 0 1 ~ ~1.5 ~ 0.25 0.25 0.25 0 1 force @a[distance=..40]
    particle dust 0.792 0 0 1 ~ ~1.5 ~ 0.25 0.25 0.25 0 1 force @a[distance=..40]
    execute if entity @s[scores={5O.MoveTime=60..100}] run particle flame ~ ~1.5 ~ 0.25 0.25 0.25 0 1

# 接地で上を向く
    execute positioned ~ ~1.68 ~ unless block ~ ~-1 ~ #lib:no_collision at @s run tp @s ~ ~ ~ ~ ~-35
    execute positioned ~ ~1.68 ~ unless block ~ ~1 ~ #lib:no_collision at @s run tp @s ~ ~ ~ ~ ~80

# クールタイムを減らす 0以下にはならない
    scoreboard players remove @s[scores={5O.AttackCT=1..}] 5O.AttackCT 1

# クールタイム中じゃないなら接触時に攻撃
    execute if entity @s[scores={5O.MoveTime=..59}] unless score @s 5O.AttackCT matches 1.. positioned ~-0.5 ~0.5 ~-0.5 if entity @p[tag=!PlayerShouldInvulnerable,dx=0] run function asset:mob/0204_infernal_watcher/tick/event/attack
    execute if entity @s[scores={5O.MoveTime=60..}] unless score @s 5O.AttackCT matches 1.. positioned ~-0.5 ~0.5 ~-0.5 if entity @p[tag=!PlayerShouldInvulnerable,dx=0] run function asset:mob/0204_infernal_watcher/tick/event/attack_strong

# カベにぶつかった際の処理
    execute positioned ~ ~1.68 ~ unless block ^ ^ ^0.5 #lib:no_collision at @s run tp @s ~ ~ ~ ~45 ~-45
    execute positioned ~ ~1.68 ~ unless block ^ ^ ^0.2 #lib:no_collision at @s run tp @s ~ ~ ~ ~45 ~-45

# 世界に存在しすぎた場合、消滅する
    scoreboard players remove @s 5O.LifeTime 1
    execute if score @s 5O.LifeTime matches ..0 run function asset:mob/0204_infernal_watcher/tick/event/suicide


text:
#> asset:mob/0204_infernal_watcher/tick/1.trigger
#
# Mobが生きている間毎tick実行されるfunction
#
# @within tag/function asset:mob/tick

execute if data storage asset:context {id:204} run function asset:mob/0204_infernal_watcher/tick/2.tick


text:
#> asset:mob/0204_infernal_watcher/tick/event/attack
#
# 接触ダメージ 実行しているのはプレイヤー自身
#
# @within function asset:mob/0204_infernal_watcher/tick/2.tick

# VFX
    playsound minecraft:block.fire.ambient hostile @a ~ ~ ~ 1.5 1.5
    playsound minecraft:entity.spider.step hostile @a ~ ~ ~ 1.5 1.5
    playsound minecraft:block.wart_block.break hostile @a ~ ~ ~ 1.5 1

# ダメージ設定
    data modify storage lib: Argument.Damage set value 25f
    data modify storage lib: Argument.AttackType set value "Physical"
    data modify storage lib: Argument.ElementType set value "Fire"

# 補正実行
    function lib:damage/modifier

# 一番最寄りのプレイヤー（今回は接触したやつのハズ）のHurtTimeを取る
    execute as @p run function api:data_get/hurt_time

# HurTime取ってそれが0ならダメージを与える
    execute if data storage api: {HurtTime:0s} as @p run function lib:damage/

# リセット
    function lib:damage/reset

# クールタイム設定
    scoreboard players set @s 5O.AttackCT 20


text:
#> asset:mob/0204_infernal_watcher/tick/event/start_frenzy
#
# テンション上がって加速する時の演出
#
# @within function asset:mob/0204_infernal_watcher/tick/2.tick

item replace entity @s armor.head with minecraft:stick{CustomModelData:20208}
playsound minecraft:block.respawn_anchor.set_spawn hostile @a ~ ~ ~ 1.5 1.5
playsound ogg:mob.blaze.breathe4 hostile @a ~ ~ ~ 1.5 1.5
particle lava ~ ~1.5 ~ 0 0 0 0.2 5


text:
#> asset:mob/0204_infernal_watcher/tick/event/attack_strong
#
#
#
# @within function asset:mob/0204_infernal_watcher/tick/2.tick

# VFX
    playsound minecraft:block.fire.ambient hostile @a ~ ~ ~ 2 1.5
    playsound minecraft:entity.phantom.bite hostile @a ~ ~ ~ 1 1
    playsound minecraft:entity.blaze.hurt hostile @a ~ ~ ~ 1 1.5

# ダメージ設定
    data modify storage lib: Argument.Damage set value 40f
    data modify storage lib: Argument.AttackType set value "Physical"
    data modify storage lib: Argument.ElementType set value "Fire"

# 補正実行
    function lib:damage/modifier

# 一番最寄りのプレイヤー（今回は接触したやつのハズ）のHurtTimeを取る
    execute as @p run function api:data_get/hurt_time

# HurTime取ってそれが0ならダメージを与える
    execute if data storage api: {HurtTime:0s} as @p run function lib:damage/

# リセット
    function lib:damage/reset

# クールタイム設定
    scoreboard players set @s 5O.AttackCT 15


text:
#> asset:mob/0204_infernal_watcher/tick/event/end_frenzy
#
# つかれちゃった時の演出
#
# @within function asset:mob/0204_infernal_watcher/tick/2.tick

item replace entity @s armor.head with minecraft:stick{CustomModelData:20207}
playsound minecraft:block.soul_sand.break hostile @a ~ ~ ~ 1.5 0.75
playsound minecraft:entity.phantom.flap hostile @a ~ ~ ~ 1.5 1.5
particle large_smoke ~ ~1.5 ~ 0 0 0 0.05 5


text:
#> asset:mob/0204_infernal_watcher/tick/event/suicide
#
#
#
# @within function asset:mob/0204_infernal_watcher/tick/2.tick

# VFX
    particle reverse_portal ~ ~1.68 ~ 0.25 0.25 0.25 0.5 20 force @a[distance=..40]

# 消える
    tp @s ~ -100 ~
    kill @s


text:
#> asset:mob/1006.green_star/death/2.death
#
# Mobの死亡時の処理
#
# @within function asset:mob/1006.green_star/death/1.trigger

# 演出
    playsound entity.blaze.shoot hostile @a ~ ~ ~ 1 0.6
    playsound entity.phantom.bite hostile @a ~ ~ ~ 1 0


text:
#> asset:mob/1006.green_star/death/1.trigger
#
# Mobの死亡時に実行されるfunction
#
# @within tag/function asset:mob/death

execute if data storage asset:context {id:1006} run function asset:mob/1006.green_star/death/2.death


text:
#> asset:mob/1006.green_star/summon/2.summon
#
# Mobの召喚時の処理
#
# @within function asset:mob/1006.green_star/summon/1.trigger

# 元となるMobを召喚する
    summon vex ~ ~ ~ {Tags:["MobInit","AlwaysInvisible"],LifeTicks:1,Silent:1b,DeathLootTable:"asset:mob/death/1006.green_star"}
# ID (int)
    data modify storage asset:mob ID set value 1006
# Type (string) Wikiを参照
    data modify storage asset:mob Type set value "Enemy"
# 干渉可能か否か (boolean)
    data modify storage asset:mob Interferable set value true
# 名前 (TextComponentString) (オプション)
    data modify storage asset:mob Name set value '{"text":"翠の星","color":"green"}'
# 武器
    # メインハンド (Compound(Item)) (オプション)
        # data modify storage asset:mob Weapon.Mainhand set value
    # オフハンド (Compound(Item)) (オプション)
        # data modify storage asset:mob Weapon.Offhand set value
# 武器ドロップ率 ([float, float]) (オプション)
    # data modify storage asset:mob WeaponDropChances set value
# 防具
    # 頭 (Compound(Item)) (オプション)
        # data modify storage asset:mob Armor.Head set value
    # 胴 (Compound(Item)) (オプション)
        # data modify storage asset:mob Armor.Chest set value
    # 脚 (Compound(Item)) (オプション)
        # data modify storage asset:mob Armor.Legs set value
    # 足 (Compound(Item)) (オプション)
        # data modify storage asset:mob Armor.Feet set value
# 防具ドロップ率 ([float, float]) (オプション)
    # data modify storage asset:mob ArmorDropChances set value
# 体力 (double) (オプション)
    data modify storage asset:mob Health set value 40
# 攻撃力 (double) (オプション)
    # data modify storage asset:mob AttackDamage set value
# 防御力 (double) (オプション) // 被ダメージがある程度大きい場合1ptにつき0.8%カット、小さい場合1ptにつき約4%カット 20pt以上は頭打ち
    # data modify storage asset:mob Defense set value
# 特殊防御力 (double) (オプション) // 4pointにつきダメージを大きく減らす
    # data modify storage asset:mob SpecialDefense set value
# 移動速度 (double) (オプション)
    # data modify storage asset:mob Speed set value
# 索敵範囲 (double) (オプション)
    # data modify storage asset:mob FollowRange set value
# ノックバック耐性 (double) (オプション)
    # data modify storage asset:mob KnockBackResist set value
# 属性倍率 // 1.0fで100% 最低でも25%は軽減されずに入る
    # 物理倍率 (float) (オプション)
        # data modify storage asset:mob Resist.Physical set value
    # 魔法倍率 (float) (オプション)
        # data modify storage asset:mob Resist.Magic set value
    # 火倍率 (float) (オプション)
        # data modify storage asset:mob Resist.Fire set value
    # 水倍率 (float) (オプション)
        # data modify storage asset:mob Resist.Water set value
    # 雷倍率 (float) (オプション)
        # data modify storage asset:mob Resist.Thunder set value

# MobInitタグ持ちを対象にして召喚関数呼び出し
    execute as @e[type=vex,tag=MobInit,distance=..0.01] run function asset:mob/common/summon


text:
#> asset:mob/1006.green_star/summon/1.trigger
#
# Mob召喚処理の呼び出し時に実行されるfunction
#
# @within tag/function asset:mob/summon

execute if data storage asset:context {id:1006} run function asset:mob/1006.green_star/summon/2.summon


text:
#> asset:mob/1006.green_star/attack/1.trigger
#
# Mobの攻撃時に実行されるfunction
#
# @within tag/function asset:mob/attack

execute if data storage asset:context {id:1006} run function asset:mob/1006.green_star/attack/2.attack


text:
#> asset:mob/1006.green_star/attack/2.attack
#
# Mobの攻撃時の処理
#
# @within function asset:mob/1006.green_star/attack/1.trigger

# 効果
    effect give @a[tag=Victim,distance=..30] poison 10 2

# ダメージを与える
# ダメージ設定
    # 与えるダメージ
        data modify storage lib: Argument.Damage set value 15.0f
    # 魔法属性
        data modify storage lib: Argument.AttackType set value "Magic"
    # 属性
        data modify storage lib: Argument.ElementType set value "None"
    # ダメージ
        function lib:damage/modifier
        execute as @a[tag=Victim,distance=..30] run function lib:damage/
# リセット
    function lib:damage/reset


text:
#> asset:mob/1006.green_star/tick/2.tick
#
# Mobのtick時の処理
#
# @within function asset:mob/1006.green_star/tick/1.trigger

# 演出
    particle dust 0.647 1 0.616 1 ~ ~ ~ 0.1 0.1 0.1 0 4 force
    particle electric_spark ~ ~ ~ 0 0 0 0 1 force


text:
#> asset:mob/1006.green_star/tick/1.trigger
#
# Mobが生きている間毎tick実行されるfunction
#
# @within tag/function asset:mob/tick

execute if data storage asset:context {id:1006} run function asset:mob/1006.green_star/tick/2.tick


text:
#> asset:mob/0139.blast_eye/0.load
#
# MOBに利用するスコアボード等の初期化処理
#
# @within tag/function asset:mob/load

#> 定義類はここに
# @within function asset:mob/0139.blast_eye/**
    scoreboard objectives add 3v.Time dummy


text:
#> asset:mob/0139.blast_eye/death/2.death
#
# Mobの死亡時の処理
#
# @within function asset:mob/0139.blast_eye/death/1.trigger

# 被ダメージ音
    # playsound minecraft:block.shroomlight.break hostile @a ~ ~ ~ 2 1
    playsound minecraft:block.stem.break hostile @a ~ ~ ~ 1 0.5
    playsound minecraft:block.stone.break hostile @a ~ ~ ~ 1 0.5
    playsound minecraft:item.shovel.flatten hostile @a ~ ~ ~ 1 0.5
    playsound minecraft:item.bone_meal.use hostile @a ~ ~ ~ 1 0.5

# 物足りないのでparticle
    particle minecraft:block minecraft:magma_block ~ ~1.8 ~ 0.35 0.35 0.35 2 10
    particle minecraft:block minecraft:blackstone ~ ~1.8 ~ 0.35 0.35 0.35 2 30
    particle minecraft:large_smoke ~ ~1.8 ~ 0.5 0.5 0.5 0.04 15


text:
#> asset:mob/0139.blast_eye/death/1.trigger
#
# Mobの死亡時に実行されるfunction
#
# @within tag/function asset:mob/death

execute if data storage asset:context {id:139} run function asset:mob/0139.blast_eye/death/2.death


text:
#> asset:mob/0139.blast_eye/summon/2.summon
#
# Mobの召喚時の処理
#
# @within function asset:mob/0139.blast_eye/summon/1.trigger

# 元となるMobを召喚する
    summon zombie ~ ~ ~ {Tags:["MobInit","AlwaysInvisible","AlwaysSlowFall"],Silent:1b,DeathLootTable:"asset:mob/death/0139.blast_eye"}
# ID (int)
    data modify storage asset:mob ID set value 139
# Type (string) Wikiを参照
    data modify storage asset:mob Type set value "Enemy"
# 干渉可能か否か (boolean)
    data modify storage asset:mob Interferable set value true
# 名前 (TextComponentString) (オプション)
    data modify storage asset:mob Name set value '{"text":"ブラストアイ","color":"dark_red"}'
# 武器
    # メインハンド (Compound(Item)) (オプション)
        # data modify storage asset:mob Weapon.Mainhand set value
    # オフハンド (Compound(Item)) (オプション)
        # data modify storage asset:mob Weapon.Offhand set value
# 武器ドロップ率 ([float, float]) (オプション)
    # data modify storage asset:mob WeaponDropChances set value
# 防具
    #頭 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Head set value {id:"minecraft:player_head",Count:1b,tag:{Enchantments:[{id:"blast_protection",lvl:11}],display:{Name:'{"text":"ブラストアイの頭","color":"yellow","italic":false}'},SkullOwner:{Id:[I;1,2,139,0],Properties:{textures:[{Value:"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZWNhMjQ0ZDIwMzYwYTVkOWMzNWUwZGViZjhhMjAwYzQ2OGE2YWE2M2U1OGQ2ZjAxNTA2ODRiNjhmYWI5OTE0NyJ9fX0="}]}}}}
    # 胴 (Compound(Item)) (オプション)
        # data modify storage asset:mob Armor.Chest set value
    # 脚 (Compound(Item)) (オプション)
        # data modify storage asset:mob Armor.Legs set value
    # 足 (Compound(Item)) (オプション)
        # data modify storage asset:mob Armor.Feet set value
# 防具ドロップ率 ([float, float]) (オプション)
    data modify storage asset:mob ArmorDropChances set value [0.0f,0.0f,0.0f,0.0015f]
# 体力 (double) (オプション)
    data modify storage asset:mob Health set value 1000
# 攻撃力 (double) (オプション)
    data modify storage asset:mob AttackDamage set value 0.0
# 防御力 (double) (オプション) // 被ダメージがある程度大きい場合1ptにつき0.8%カット、小さい場合1ptにつき約4%カット 20pt以上は頭打ち
    data modify storage asset:mob Defense set value 0
# 特殊防御力 (double) (オプション) // 4pointにつきダメージを大きく減らす
    # data modify storage asset:mob SpecialDefense set value
# 移動速度 (double) (オプション)
    data modify storage asset:mob Speed set value 0.22
# 索敵範囲 (double) (オプション)
    data modify storage asset:mob FollowRange set value 32.0
# ノックバック耐性 (double) (オプション)
    data modify storage asset:mob KnockBackResist set value 1.0
# 属性倍率 // 1.0fで100% 最低でも25%は軽減されずに入る
    # 物理倍率 (float) (オプション)
        # data modify storage asset:mob Resist.Physical set value
    # 魔法倍率 (float) (オプション)
        # data modify storage asset:mob Resist.Magic set value
    # 火倍率 (float) (オプション)
        data modify storage asset:mob Resist.Fire set value 0.5
    # 水倍率 (float) (オプション)
        # data modify storage asset:mob Resist.Water set value
    # 雷倍率 (float) (オプション)
        # data modify storage asset:mob Resist.Thunder set value

# 爆破時間ランダム化
    # 取得
        execute store result score $Random Temporary run function lib:random/
    # mod100で下2桁
        scoreboard players operation $Random Temporary %= $100 Const
    # 代入
        scoreboard players operation @e[type=zombie,tag=MobInit,distance=..0.01] 3v.Time = $Random Temporary
    # Tempリセット
        scoreboard players reset $Random Temporary

# MobInitタグ持ちを対象にして召喚関数呼び出し
    execute as @e[type=zombie,tag=MobInit,distance=..0.01] run function asset:mob/common/summon


text:
#> asset:mob/0139.blast_eye/summon/1.trigger
#
# Mob召喚処理の呼び出し時に実行されるfunction
#
# @within tag/function asset:mob/summon

execute if data storage asset:context {id:139} run function asset:mob/0139.blast_eye/summon/2.summon


text:
#> asset:mob/0139.blast_eye/hurt/2.hurt
#
# Mobの被ダメージ時の処理
#
# @within function asset:mob/0139.blast_eye/hurt/1.trigger

# 被ダメージ音
    # playsound minecraft:block.shroomlight.break hostile @a ~ ~ ~ 2 0.75
    playsound minecraft:block.stem.break hostile @a ~ ~ ~ 1 0.5
    playsound minecraft:block.stone.break hostile @a ~ ~ ~ 1 0.5
    playsound minecraft:block.basalt.place hostile @a ~ ~ ~ 1 0.5

# 物足りないのでparticle
    execute anchored eyes run particle minecraft:block minecraft:magma_block ^ ^ ^ 0.1 0.1 0.1 2 5
    execute anchored eyes run particle minecraft:block minecraft:blackstone ^ ^ ^ 0.1 0.1 0.1 2 10


text:
#> asset:mob/0139.blast_eye/hurt/1.trigger
#
# Mobの被ダメージに実行されるfunction
#
# @within tag/function asset:mob/hurt

execute if data storage asset:context {id:139} run function asset:mob/0139.blast_eye/hurt/2.hurt


text:
#> asset:mob/0139.blast_eye/tick/2.1.active_tick
#
# Playerが近くにいる時のみ実行するtick
#
# @within function asset:mob/0139.blast_eye/tick/2.tick

# eye本体にタイマー加算
    scoreboard players add @s 3v.Time 1

# 一定確率で爆発後のクールダウン短縮
    execute if score @s 3v.Time matches 120..159 if predicate lib:random_pass_per/2 run scoreboard players set @s 3v.Time 160

# 爆破予告
    execute if score @s 3v.Time matches 160..200 anchored eyes run function asset:mob/0139.blast_eye/tick/2.1.1.prepare

# 爆破
    execute if score @s 3v.Time matches 200 anchored eyes positioned ^ ^ ^2 run function asset:mob/0139.blast_eye/tick/2.1.2.boom

# 爆破後も数tickだけ爆発particleを出し続ける
    execute if score @s 3v.Time matches 201..209 anchored eyes positioned ^ ^ ^2 run function asset:mob/0139.blast_eye/tick/2.1.3.timeshift_particle

# タイマーリセット
    execute if score @s 3v.Time matches 210 run scoreboard players set @s 3v.Time 0


text:
#> asset:mob/0139.blast_eye/tick/2.tick
#
# Mobのtick時の処理
#
# @within function asset:mob/0139.blast_eye/tick/1.trigger

# Playerが近くに居た時のみ稼働
    execute if entity @p[distance=..25] run function asset:mob/0139.blast_eye/tick/2.1.active_tick


text:
#> asset:mob/0139.blast_eye/tick/2.1.2.boom
#
# 爆発時の処理
#
# @within function asset:mob/0139.blast_eye/tick/2.1.active_tick

# 爆破演出
    playsound minecraft:entity.generic.explode hostile @a ~ ~ ~ 1 0.75
    particle minecraft:explosion ~ ~ ~ 1 1 1 0 3

# DamageAPI設定
    data modify storage lib: Argument.Damage set value 20.0f
    data modify storage lib: Argument.AttackType set value "Physical"
    data modify storage lib: Argument.ElementType set value "Fire"
    data modify storage lib: Argument.DisableParticle set value true
# 補正
    function lib:damage/modifier
# 実行
    execute as @a[tag=!PlayerShouldInvulnerable,distance=..3.5] run function lib:damage/
# リセット
    function lib:damage/reset


text:
#> asset:mob/0139.blast_eye/tick/hard_effects
#
# ハード限定の処理
#
# @within function asset:mob/0139.blast_eye/tick/2.1.1.prepare

# ハード以上なら移動速度上昇と耐性を得る
    effect give @s speed 1 2 true
    effect give @s resistance 1 7 true


text:
#> asset:mob/0139.blast_eye/tick/2.1.3.timeshift_particle
#
# 爆発後の数tick持続するparticle部分
#
# @within function asset:mob/0139.blast_eye/tick/2.1.active_tick

# 演出
    particle minecraft:explosion ~ ~ ~ 1 1 1 0 3
    execute if score @s 3v.Time matches 205.. run particle minecraft:poof ~ ~ ~ 0.8 0.8 0.8 0 6

# mob固定
    tp @s @s


text:
#> asset:mob/0139.blast_eye/tick/1.trigger
#
# Mobが生きている間毎tick実行されるfunction
#
# @within tag/function asset:mob/tick

execute if data storage asset:context {id:139} run function asset:mob/0139.blast_eye/tick/2.tick


text:
#> asset:mob/0139.blast_eye/tick/2.1.1.prepare
#
# 爆破準備演出
#
# @within function asset:mob/0139.blast_eye/tick/2.1.active_tick

# 着火し始めた瞬間の演出
    execute if score @s 3v.Time matches 160 run playsound minecraft:entity.creeper.primed hostile @a ~ ~ ~ 1 0.5
    execute if score @s 3v.Time matches 160 run particle flame ^ ^ ^ 0.2 0.2 0.2 0 5 normal

# 爆破準備中の演出
    particle large_smoke ^ ^0.5 ^ 0 0 0 0 1 normal
    particle minecraft:dust_color_transition 1.0 0.75 0.0 1.0 0.0 0.0 0.0 ^ ^ ^0.25 0.1 0.1 0.1 1 2

# ハード以上の場合の処理
    execute if predicate api:global_vars/difficulty/min/hard run function asset:mob/0139.blast_eye/tick/hard_effects


text:
#> asset:mob/0155.immorality/0.load
#
# MOBに利用するスコアボード等の初期化処理
#
# @within tag/function asset:mob/load

#> 定義類はここに
# @within function asset:mob/0155.immorality/**
    scoreboard objectives add 4B.ShotTime dummy


text:
#> asset:mob/0155.immorality/_index.d
# @private

#> tag
# @within function asset:mob/0155.immorality/**
    #declare tag Landing
    #declare tag LandingTarget


text:
#> asset:mob/0155.immorality/death/2.death
#
# Mobの死亡時の処理
#
# @within function asset:mob/0155.immorality/death/1.trigger
#> Private
# @private
    #declare score_holder $Random

# 疑似乱数取得
    execute store result score $Random Temporary run function lib:random/
# ほしい範囲に剰余算
    scoreboard players operation $Random Temporary %= $11 Const
# メッセージ出力
    execute if score $Random Temporary matches 0 run summon area_effect_cloud ~ ~0.5 ~ {CustomNameVisible:1b,Particle:"block air",Duration:40,Tags:["Object"],CustomName:'{"text":"Crime?","color":"dark_red","bold":true,"underlined":true}'}
    execute if score $Random Temporary matches 1 run summon area_effect_cloud ~ ~0.5 ~ {CustomNameVisible:1b,Particle:"block air",Duration:40,Tags:["Object"],CustomName:'{"text":"Wickedness?","color":"dark_red","bold":true,"underlined":true}'}
    execute if score $Random Temporary matches 2 run summon area_effect_cloud ~ ~0.5 ~ {CustomNameVisible:1b,Particle:"block air",Duration:40,Tags:["Object"],CustomName:'{"text":"Sad?","color":"dark_red","bold":true,"underlined":true}'}
    execute if score $Random Temporary matches 3 run summon area_effect_cloud ~ ~0.5 ~ {CustomNameVisible:1b,Particle:"block air",Duration:40,Tags:["Object"],CustomName:'{"text":"Theft?","color":"dark_red","bold":true,"underlined":true}'}
    execute if score $Random Temporary matches 4 run summon area_effect_cloud ~ ~0.5 ~ {CustomNameVisible:1b,Particle:"block air",Duration:40,Tags:["Object"],CustomName:'{"text":"Hopelessness?","color":"dark_red","bold":true,"underlined":true}'}
    execute if score $Random Temporary matches 5 run summon area_effect_cloud ~ ~0.5 ~ {CustomNameVisible:1b,Particle:"block air",Duration:40,Tags:["Object"],CustomName:'{"text":"Foolishness?","color":"dark_red","bold":true,"underlined":true}'}
    execute if score $Random Temporary matches 6 run summon area_effect_cloud ~ ~0.5 ~ {CustomNameVisible:1b,Particle:"block air",Duration:40,Tags:["Object"],CustomName:'{"text":"Violence?","color":"dark_red","bold":true,"underlined":true}'}
    execute if score $Random Temporary matches 7 run summon area_effect_cloud ~ ~0.5 ~ {CustomNameVisible:1b,Particle:"block air",Duration:40,Tags:["Object"],CustomName:'{"text":"Will?","color":"dark_red","bold":true,"underlined":true}'}
    execute if score $Random Temporary matches 8 run summon area_effect_cloud ~ ~0.5 ~ {CustomNameVisible:1b,Particle:"block air",Duration:40,Tags:["Object"],CustomName:'{"text":"Soul?","color":"dark_red","bold":true,"underlined":true}'}
    execute if score $Random Temporary matches 9 run summon area_effect_cloud ~ ~0.5 ~ {CustomNameVisible:1b,Particle:"block air",Duration:40,Tags:["Object"],CustomName:'{"text":"Ego?","color":"dark_red","bold":true,"underlined":true}'}
    execute if score $Random Temporary matches 10 run summon area_effect_cloud ~ ~0.5 ~ {CustomNameVisible:1b,Particle:"block air",Duration:40,Tags:["Object"],CustomName:'{"text":"Unity?","color":"dark_red","bold":true,"underlined":true}'}
# リセット
    scoreboard players reset $Random Temporary


text:
#> asset:mob/0155.immorality/death/1.trigger
#
# Mobの死亡時に実行されるfunction
#
# @within tag/function asset:mob/death

execute if data storage asset:context {id:155} run function asset:mob/0155.immorality/death/2.death


text:
#> asset:mob/0155.immorality/summon/2.summon
#
# Mobの召喚時の処理
#
# @within function asset:mob/0155.immorality/summon/1.trigger

# 元となるMobを召喚する
    summon wither_skeleton ~ ~ ~ {Tags:["MobInit"],DeathTime:19s,DeathLootTable:"asset:mob/death/0155.immorality"}
# ID (int)
    data modify storage asset:mob ID set value 155
# Type (string) Wikiを参照
    data modify storage asset:mob Type set value "Enemy"
# 干渉可能か否か (boolean)
    data modify storage asset:mob Interferable set value true
# 名前 (TextComponentString) (オプション)
    data modify storage asset:mob Name set value '{"text":"背徳","color":"dark_purple","bold":true,"underlined":true}'
# 武器
    # メインハンド (Compound(Item)) (オプション)
        data modify storage asset:mob Weapon.Mainhand set value {id:"stick",Count:1b,tag:{CustomModelData:20063}}
    # オフハンド (Compound(Item)) (オプション)
        # data modify storage asset:mob Weapon.Offhand set value
# 武器ドロップ率 ([float, float]) (オプション)
    # data modify storage asset:mob WeaponDropChances set value
# 防具
    # 頭 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Head set value {id:"minecraft:black_glazed_terracotta",Count:1b}
    # 胴 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Chest set value {id:"minecraft:leather_chestplate",Count:1b,tag:{display:{color:1310720}}}
    # 脚 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Legs set value {id:"minecraft:leather_leggings",Count:1b,tag:{display:{color:2490368}}}
    # 足 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Feet set value {id:"minecraft:leather_boots",Count:1b,tag:{display:{color:3538944}}}
# 防具ドロップ率 ([float, float]) (オプション)
    # data modify storage asset:mob ArmorDropChances set value
# 体力 (double) (オプション)
    data modify storage asset:mob Health set value 2900
# 攻撃力 (double) (オプション)
    data modify storage asset:mob AttackDamage set value 0
# 防御力 (double) (オプション) // 被ダメージがある程度大きい場合1ptにつき0.8%カット、小さい場合1ptにつき約4%カット 20pt以上は頭打ち
    data modify storage asset:mob Defense set value -6
# 特殊防御力 (double) (オプション) // 4pointにつきダメージを大きく減らす
    # data modify storage asset:mob SpecialDefense set value 0
# 移動速度 (double) (オプション)
    data modify storage asset:mob Speed set value 0.2
# 索敵範囲 (double) (オプション)
    # data modify storage asset:mob FollowRange set value
# ノックバック耐性 (double) (オプション)
    # data modify storage asset:mob KnockBackResist set value
# 属性倍率 // 1.0fで100% 最低でも25%は軽減されずに入る
    # 物理倍率 (float) (オプション)
        data modify storage asset:mob Resist.Physical set value 0.6
    # 魔法倍率 (float) (オプション)
        data modify storage asset:mob Resist.Magic set value 1
    # 火倍率 (float) (オプション)
        data modify storage asset:mob Resist.Fire set value 0.6
    # 水倍率 (float) (オプション)
        data modify storage asset:mob Resist.Water set value 1
    # 雷倍率 (float) (オプション)
        data modify storage asset:mob Resist.Thunder set value 0.6

# MobInitタグ持ちを対象にして召喚関数呼び出し
    execute as @e[type=wither_skeleton,tag=MobInit,distance=..0.01] run function asset:mob/common/summon


text:
#> asset:mob/0155.immorality/summon/1.trigger
#
# Mob召喚処理の呼び出し時に実行されるfunction
#
# @within tag/function asset:mob/summon

execute if data storage asset:context {id:155} run function asset:mob/0155.immorality/summon/2.summon


text:
#> asset:mob/0155.immorality/tick/2.tick
#
# Mobのtick時の処理
#
# @within function asset:mob/0155.immorality/tick/1.trigger

# スコアを増やします
    scoreboard players add @s 4B.ShotTime 1

# 発砲準備で移動できなく
    execute if score @s 4B.ShotTime matches 87 run effect give @s slowness 1 100 true

# 発砲します
    execute if entity @a[distance=..20] if score @s 4B.ShotTime matches 90 positioned ^-0.3 ^ ^0.2 run function asset:mob/0155.immorality/tick/2.1.ready

# 終了します
    execute if score @s 4B.ShotTime matches 94 run function asset:mob/0155.immorality/tick/2.4.reset


text:
#> asset:mob/0155.immorality/tick/2.4.reset
#
#
#
# @within function asset:mob/0155.immorality/tick/2.tick
#> Private
# @private
    #declare score_holder $RandomDamage

# 次に攻撃するタイミングをランダムにする
# 疑似乱数取得
    execute store result score $RandomDamage Temporary run function lib:random/
# 剰余算する
    scoreboard players operation $RandomDamage Temporary %= $11 Const
#スコアセットセット
    scoreboard players operation @s 4B.ShotTime = $RandomDamage Temporary

# リセット処理
    scoreboard players reset $RandomDamage Temporary


text:
#> asset:mob/0155.immorality/tick/2.2.shot
#
# 発砲します
#
# @within function
#   asset:mob/0155.immorality/tick/2.1.ready
#   asset:mob/0155.immorality/tick/2.2.shot

# 着弾検知
    execute if entity @a[gamemode=!spectator,distance=..2] run tag @s add Landing
    execute unless block ^ ^ ^0.5 #lib:no_collision run tag @s add Landing

# ターゲットにタグ付与
    execute if entity @a[gamemode=!spectator,distance=..2] run tag @p[gamemode=!spectator,distance=..2] add LandingTarget

# 演出
    particle dust 0.357 0 0 1 ~ ~ ~ 0 0 0 0 6
    particle dust 0.357 0 0 1 ~ ~ ~ 0.2 0.2 0.2 0 6

# 着弾
    execute if entity @s[tag=Landing] run function asset:mob/0155.immorality/tick/2.3.damage

# 再起
    execute positioned ^ ^ ^0.5 if entity @s[tag=!Landing,distance=..20] run function asset:mob/0155.immorality/tick/2.2.shot


text:
#> asset:mob/0155.immorality/tick/2.1.ready
#
# 発砲準備をします
#
# @within function asset:mob/0155.immorality/tick/2.tick
#> tag
# @private
    #declare tag SpreadMarker

# 前方拡散設定
    summon marker ~ ~ ~ {Tags:["SpreadMarker"]}
    data modify storage lib: Argument.Distance set value 5.0
    data modify storage lib: Argument.Spread set value 1

# 前方拡散を実行する
    execute as @e[type=marker,tag=SpreadMarker,limit=1] run function lib:forward_spreader/circle

# 発砲
    execute facing entity @e[type=marker,tag=SpreadMarker,limit=1] feet anchored eyes positioned ^ ^ ^ run function asset:mob/0155.immorality/tick/2.2.shot

# 演出
    playsound minecraft:entity.zombie.attack_wooden_door hostile @a ~ ~ ~ 1 0
    playsound minecraft:block.honey_block.hit hostile @a ~ ~ ~ 1 0
    playsound minecraft:entity.generic.explode hostile @a ~ ~ ~ 0.8 2

# リセット
    kill @e[type=marker,tag=SpreadMarker,limit=1]
    tag @s remove Landing


text:
#> asset:mob/0155.immorality/tick/1.trigger
#
# Mobが生きている間毎tick実行されるfunction
#
# @within tag/function asset:mob/tick

execute if data storage asset:context {id:155} run function asset:mob/0155.immorality/tick/2.tick


text:
#> asset:mob/0155.immorality/tick/2.3.damage
#
# ダメージを与えます
#
# @within function asset:mob/0155.immorality/tick/2.2.shot

# 演出
    particle minecraft:soul ~ ~ ~ 0 0 0 0.2 10

# ダメージ設定
    # 与えるダメージ
        data modify storage lib: Argument.Damage set value 30.0f
    # 魔法属性
        data modify storage lib: Argument.AttackType set value "Magic"
    # 雷属性
        data modify storage lib: Argument.ElementType set value "Fire"
    # ダメージ
        function lib:damage/modifier
        execute as @p[gamemode=!creative,tag=LandingTarget,distance=..50] at @s run function lib:damage/
# リセット
    function lib:damage/reset

# ウィザーを付与
    effect give @p[gamemode=!creative,tag=LandingTarget,distance=..50] wither 6 0

# 着弾タグを消す
    tag @p[tag=LandingTarget,distance=..50] remove LandingTarget


text:
#> asset:mob/0148.prismarine_atlatl/summon/2.summon
#
# Mobの召喚時の処理
#
# @within function asset:mob/0148.prismarine_atlatl/summon/1.trigger

# 元となるMobを召喚する
    summon drowned ~ ~ ~ {Silent:1b,Tags:["MobInit","AlwaysInvisible"],DeathLootTable:"asset:mob/death/0148.prismarine_atlatl"}
# ID (int)
    data modify storage asset:mob ID set value 148
# Type (string) Wikiを参照
    data modify storage asset:mob Type set value "Enemy"
# 干渉可能か否か (boolean)
    data modify storage asset:mob Interferable set value true
# 名前 (TextComponentString) (オプション)
    data modify storage asset:mob Name set value '{"text":"プリズマリンアトラトル","color":"#48DAD6"}'
# 武器
    # メインハンド (Compound(Item)) (オプション)
        data modify storage asset:mob Weapon.Mainhand set value {id:"trident",Count:1b}
    # オフハンド (Compound(Item)) (オプション)
        # data modify storage asset:mob Weapon.Offhand set value
# 武器ドロップ率 ([float, float]) (オプション)
    data modify storage asset:mob WeaponDropChances set value [0.0f,0.0f]
# 防具
    # 頭 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Head set value {id:"prismarine_bricks",Count:1b}
    # 胴 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Chest set value {id:"minecraft:leather_chestplate",Count:1b,tag:{display:{color:5231080}}}
    # 脚 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Legs set value {id:"minecraft:leather_leggings",Count:1b,tag:{display:{color:5035234}}}
    # 足 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Feet set value {id:"minecraft:leather_boots",Count:1b,tag:{display:{color:4904924}}}
# 防具ドロップ率 ([float, float]) (オプション)
    data modify storage asset:mob ArmorDropChances set value [0.0f,0.0f,0.0f,0.0f]
# 体力 (double) (オプション)
    data modify storage asset:mob Health set value 2900
# 攻撃力 (double) (オプション)
    # data modify storage asset:mob AttackDamage set value
# 防御力 (double) (オプション) // 被ダメージがある程度大きい場合1ptにつき0.8%カット、小さい場合1ptにつき約4%カット 20pt以上は頭打ち
    data modify storage asset:mob Defense set value -6
# 特殊防御力 (double) (オプション) // 4pointにつきダメージを大きく減らす
    # data modify storage asset:mob SpecialDefense set value
# 移動速度 (double) (オプション)
    data modify storage asset:mob Speed set value 0.25
# 索敵範囲 (double) (オプション)
    data modify storage asset:mob FollowRange set value 32.0
# ノックバック耐性 (double) (オプション)
    data modify storage asset:mob KnockBackResist set value 0.5
# 属性倍率 // 1.0fで100% 最低でも25%は軽減されずに入る
    # 物理倍率 (float) (オプション)
        data modify storage asset:mob Resist.Physical set value 1
    # 魔法倍率 (float) (オプション)
        data modify storage asset:mob Resist.Magic set value 1
    # 火倍率 (float) (オプション)
        data modify storage asset:mob Resist.Fire set value 0.75
    # 水倍率 (float) (オプション)
        data modify storage asset:mob Resist.Water set value 0.5
    # 雷倍率 (float) (オプション)
        data modify storage asset:mob Resist.Thunder set value 1

# MobInitタグ持ちを対象にして召喚関数呼び出し
    execute as @e[type=drowned,tag=MobInit,distance=..0.01] run function asset:mob/common/summon


text:
#> asset:mob/0148.prismarine_atlatl/summon/1.trigger
#
# Mob召喚処理の呼び出し時に実行されるfunction
#
# @within tag/function asset:mob/summon

execute if data storage asset:context {id:148} run function asset:mob/0148.prismarine_atlatl/summon/2.summon


text:
#> asset:mob/0148.prismarine_atlatl/hurt/2.hurt
#
# Mobの被ダメージ時の処理
#
# @within function asset:mob/0148.prismarine_atlatl/hurt/1.trigger

# 演出
    particle splash ~ ~1.2 ~ 0.4 0.5 0.4 0 50 normal @a
    playsound minecraft:entity.guardian.hurt hostile @a ~ ~ ~ 0.6 1 0
    playsound minecraft:entity.generic.swim hostile @a ~ ~ ~ 0.5 0.7 0


text:
#> asset:mob/0148.prismarine_atlatl/hurt/1.trigger
#
# Mobの被ダメージに実行されるfunction
#
# @within tag/function asset:mob/hurt

execute if data storage asset:context {id:148} run function asset:mob/0148.prismarine_atlatl/hurt/2.hurt


text:
#> asset:mob/0148.prismarine_atlatl/attack/1.trigger
#
# Mobの攻撃時に実行されるfunction
#
# @within tag/function asset:mob/attack

execute if data storage asset:context {id:148} run function asset:mob/0148.prismarine_atlatl/attack/2.attack


text:
#> asset:mob/0148.prismarine_atlatl/attack/2.attack
#
# Mobの攻撃時の処理
#
# @within function asset:mob/0148.prismarine_atlatl/attack/1.trigger

# 演出
    execute at @p[tag=Victim,distance=..32] run particle splash ~ ~1.2 ~ 0.6 0.5 0.6 0 50 normal @a
    execute at @p[tag=Victim,distance=..32] run particle dust 0.145 0.792 0.812 1.3 ~ ~1.2 ~ 0.5 0.4 0.5 1 30 normal @a
    execute at @p[tag=Victim,distance=..32] run playsound minecraft:entity.guardian.attack hostile @a ~ ~ ~ 0.8 1.5 0
    execute at @p[tag=Victim,distance=..32] run playsound entity.player.splash.high_speed hostile @a ~ ~ ~ 0.4 1.7 0
    execute at @p[tag=Victim,distance=..32] run playsound minecraft:item.trident.return hostile @a ~ ~ ~ 0.5 0 0

# バフを解除
    effect clear @p[tag=Victim,distance=..32] water_breathing
    effect clear @p[tag=Victim,distance=..32] night_vision
    effect clear @p[tag=Victim,distance=..32] dolphins_grace

# 与えるダメージ
    data modify storage lib: Argument.Damage set value 21f
# 属性
    data modify storage lib: Argument.AttackType set value "Physical"
    data modify storage lib: Argument.ElementType set value "Water"
# デスログ
    data modify storage lib: Argument.DeathMessage append value '{"translate": "%1$sは%2$sによって水底に沈んだ","with":[{"selector":"@s"},{"nbt":"Return.AttackerName","storage":"lib:","interpret":true}]}'
    data modify storage lib: Argument.DeathMessage append value '{"translate": "%1$sは%2$sによって貫かれ海の藻屑となった","with":[{"selector":"@s"},{"nbt":"Return.AttackerName","storage":"lib:","interpret":true}]}'
# 補正functionを実行
    function lib:damage/modifier
# 対象
    execute as @p[tag=Victim,distance=..32] run function lib:damage/
# リセット
    function lib:damage/reset


text:
#> asset:mob/sandbag4a/summon/2.summon
# @private

# 元となるMobを召喚する
    summon skeleton ~ ~ ~ {Tags:["MobInit"],DeathLootTable:"empty"}
# ID (int)
    data modify storage asset:mob ID set value 10013
# Type (string) Wikiを参照
    data modify storage asset:mob Type set value "Enemy.Boss"
# 干渉可能か否か (boolean)
    data modify storage asset:mob Interferable set value true
# 名前 (TextComponentString) (オプション)
    data modify storage asset:mob Name set value '{"text":"天使サンドバッグ4"}'
# 武器
    # メインハンド (Compound(Item)) (オプション)
        # data modify storage asset:mob Weapon.Mainhand set value
    # オフハンド (Compound(Item)) (オプション)
        # data modify storage asset:mob Weapon.Offhand set value
# 武器ドロップ率 ([float, float]) (オプション)
    # data modify storage asset:mob WeaponDropChances set value
# 防具
    # 頭 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Head set value {id:"minecraft:glass",Count:1b}
    # 胴 (Compound(Item)) (オプション)
        # data modify storage asset:mob Armor.Chest set value
    # 脚 (Compound(Item)) (オプション)
        # data modify storage asset:mob Armor.Legs set value
    # 足 (Compound(Item)) (オプション)
        # data modify storage asset:mob Armor.Feet set value
# 防具ドロップ率 ([float, float]) (オプション)
    # data modify storage asset:mob ArmorDropChances set value
# 体力 (double) (オプション)
    data modify storage asset:mob Health set value 73000
# 攻撃力 (double) (オプション)
    data modify storage asset:mob AttackDamage set value 50
# 防御力 (double) (オプション) // 被ダメージがある程度大きい場合1ptにつき0.8%カット、小さい場合1ptにつき約4%カット 20pt以上は頭打ち
    data modify storage asset:mob Defense set value 0
# 特殊防御力 (double) (オプション) // 4pointにつきダメージを大きく減らす
    data modify storage asset:mob SpecialDefense set value 0
# 移動速度 (double) (オプション)
    data modify storage asset:mob Speed set value 0
# 索敵範囲 (double) (オプション)
    # data modify storage asset:mob FollowRange set value
# ノックバック耐性 (double) (オプション)
    # data modify storage asset:mob KnockBackResist set value
# 属性倍率 // 1.0fで100% 最低でも25%は軽減されずに入る
    # 物理倍率 (float) (オプション)
        data modify storage asset:mob Resist.Physical set value 1.0
    # 魔法倍率 (float) (オプション)
        data modify storage asset:mob Resist.Magic set value 1.0
    # 火倍率 (float) (オプション)
        data modify storage asset:mob Resist.Fire set value 1.0
    # 水倍率 (float) (オプション)
        data modify storage asset:mob Resist.Water set value 1.0
    # 雷倍率 (float) (オプション)
        data modify storage asset:mob Resist.Thunder set value 1.0

# MobInitタグ持ちを対象にして召喚関数呼び出し
    execute as @e[type=skeleton,tag=MobInit,distance=..0.01] run function asset:mob/common/summon


text:
#> asset:mob/0178.vindicator/summon/2.summon
#
# Mobの召喚時の処理
#
# @within function asset:mob/0178.vindicator/summon/1.trigger

# 元となるMobを召喚する
    summon vindicator ~ ~ ~ {Tags:["MobInit"],DeathLootTable:"asset:mob/death/0178.vindicator"}
# ID (int)
    data modify storage asset:mob ID set value 178
# Type (string) Wikiを参照
    data modify storage asset:mob Type set value "Enemy"
# 干渉可能か否か (boolean)
    data modify storage asset:mob Interferable set value true
# 名前 (TextComponentString) (オプション)
    data modify storage asset:mob Name set value '{"translate":"entity.minecraft.vindicator","color":"gray"}'
# 武器
    # メインハンド (Compound(Item)) (オプション)
        data modify storage asset:mob Weapon.Mainhand set value {id:"stick",Count:1b,tag:{CustomModelData:319}}
    # オフハンド (Compound(Item)) (オプション)
        # data modify storage asset:mob Weapon.Offhand set value
# 武器ドロップ率 ([float, float]) (オプション)
    # data modify storage asset:mob WeaponDropChances set value
# 防具
    # 頭 (Compound(Item)) (オプション)
        # data modify storage asset:mob Armor.Head set value
    # 胴 (Compound(Item)) (オプション)
        # data modify storage asset:mob Armor.Chest set value
    # 脚 (Compound(Item)) (オプション)
        # data modify storage asset:mob Armor.Legs set value
    # 足 (Compound(Item)) (オプション)
        # data modify storage asset:mob Armor.Feet set value
# 防具ドロップ率 ([float, float]) (オプション)
    # data modify storage asset:mob ArmorDropChances set value
# 体力 (double) (オプション)
    data modify storage asset:mob Health set value 300
# 攻撃力 (double) (オプション)
    data modify storage asset:mob AttackDamage set value 1
# 防御力 (double) (オプション) // 被ダメージがある程度大きい場合1ptにつき0.8%カット、小さい場合1ptにつき約4%カット 20pt以上は頭打ち
    data modify storage asset:mob Defense set value 0
# 特殊防御力 (double) (オプション) // 4pointにつきダメージを大きく減らす
    # data modify storage asset:mob SpecialDefense set value
# 移動速度 (double) (オプション)
    data modify storage asset:mob Speed set value 0.27
# 索敵範囲 (double) (オプション)
    data modify storage asset:mob FollowRange set value 32
# ノックバック耐性 (double) (オプション)
    data modify storage asset:mob KnockBackResist set value 0.3
# 属性倍率 // 1.0fで100% 最低でも25%は軽減されずに入る
    # 物理倍率 (float) (オプション)
        # data modify storage asset:mob Resist.Physical set value
    # 魔法倍率 (float) (オプション)
        # data modify storage asset:mob Resist.Magic set value
    # 火倍率 (float) (オプション)
        # data modify storage asset:mob Resist.Fire set value
    # 水倍率 (float) (オプション)
        # data modify storage asset:mob Resist.Water set value
    # 雷倍率 (float) (オプション)
        data modify storage asset:mob Resist.Thunder set value 0.5

# MobInitタグ持ちを対象にして召喚関数呼び出し
    execute as @e[type=vindicator,tag=MobInit,distance=..0.01] run function asset:mob/common/summon


text:
#> asset:mob/0178.vindicator/summon/1.trigger
#
# Mob召喚処理の呼び出し時に実行されるfunction
#
# @within tag/function asset:mob/summon

execute if data storage asset:context {id:178} run function asset:mob/0178.vindicator/summon/2.summon


text:
#> asset:mob/0178.vindicator/attack/1.trigger
#
# Mobの攻撃時に実行されるfunction
#
# @within tag/function asset:mob/attack

execute if data storage asset:context {id:178} run function asset:mob/0178.vindicator/attack/2.attack


text:
#> asset:mob/0178.vindicator/attack/2.attack
#
# Mobの攻撃時の処理
#
# @within function asset:mob/0178.vindicator/attack/1.trigger

# 演出
    execute at @p[tag=Victim,distance=..6] run particle dust 0.867 0.667 0.161 1 ~ ~2 ~ 0 2.5 0 0 100
    execute at @p[tag=Victim,distance=..6] run particle minecraft:explosion ~ ~ ~ 0.7 0.1 0.7 0 10
    execute at @p[tag=Victim,distance=..6] run playsound minecraft:entity.lightning_bolt.thunder hostile @a ~ ~ ~ 0.7 2
    execute at @p[tag=Victim,distance=..6] run playsound minecraft:entity.lightning_bolt.impact hostile @a ~ ~ ~ 0.7 1

# 与えるダメージ
    data modify storage lib: Argument.Damage set value 9f
# 属性
    data modify storage lib: Argument.AttackType set value "Physical"
    data modify storage lib: Argument.ElementType set value "Thunder"
# 補正functionを実行
    function lib:damage/modifier
# 対象
    execute as @p[tag=Victim,distance=..6] run function lib:damage/
# リセット
    function lib:damage/reset


text:
#> asset:mob/0176.killer_bee/0.load
#
# MOBに利用するスコアボード等の初期化処理
#
# @within tag/function asset:mob/load

#> 定義類はここに
# @within function asset:mob/0176.killer_bee/**
    scoreboard objectives add 4W.HurtTime dummy
    scoreboard objectives add 4W.MoveTime dummy
    scoreboard objectives add 4W.AttackCT dummy


text:
#> asset:mob/0176.killer_bee/summon/2.summon
#
# Mobの召喚時の処理
#
# @within function asset:mob/0176.killer_bee/summon/1.trigger

# 元となるMobを召喚する
    summon zombie ~ ~ ~ {Tags:["MobInit","AlwaysInvisible"],NoGravity:1b,NoAI:1b,Silent:1b,IsBaby:1b,DeathLootTable:"asset:mob/death/0176.killer_bee"}
# ID (int)
    data modify storage asset:mob ID set value 176
# Type (string) Wikiを参照
    data modify storage asset:mob Type set value "Enemy"
# 干渉可能か否か (boolean)
    data modify storage asset:mob Interferable set value true
# 名前 (TextComponentString) (オプション)
    data modify storage asset:mob Name set value '{"text":"キラービー"}'
# 武器
    # メインハンド (Compound(Item)) (オプション)
        # data modify storage asset:mob Weapon.Mainhand set value
    # オフハンド (Compound(Item)) (オプション)
        # data modify storage asset:mob Weapon.Offhand set value
# 武器ドロップ率 ([float, float]) (オプション)
    # data modify storage asset:mob WeaponDropChances set value
# 防具
    # 頭 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Head set value {id:"minecraft:stone",Count:1b,tag:{CustomModelData:20054}}
    # 胴 (Compound(Item)) (オプション)
        # data modify storage asset:mob Armor.Chest set value
    # 脚 (Compound(Item)) (オプション)
        # data modify storage asset:mob Armor.Legs set value
    # 足 (Compound(Item)) (オプション)
        # data modify storage asset:mob Armor.Feet set value
# 防具ドロップ率 ([float, float]) (オプション)
    # data modify storage asset:mob ArmorDropChances set value
# 体力 (double) (オプション)
    data modify storage asset:mob Health set value 200
# 攻撃力 (double) (オプション)
    data modify storage asset:mob AttackDamage set value 1
# 防御力 (double) (オプション) // 被ダメージがある程度大きい場合1ptにつき0.8%カット、小さい場合1ptにつき約4%カット 20pt以上は頭打ち
    # data modify storage asset:mob Defense set value
# 特殊防御力 (double) (オプション) // 4pointにつきダメージを大きく減らす
    # data modify storage asset:mob SpecialDefense set value
# 移動速度 (double) (オプション)
    # data modify storage asset:mob Speed set value
# 索敵範囲 (double) (オプション)
    # data modify storage asset:mob FollowRange set value
# ノックバック耐性 (double) (オプション)
    # data modify storage asset:mob KnockBackResist set value
# 属性倍率 // 1.0fで100% 最低でも25%は軽減されずに入る
    # 物理倍率 (float) (オプション)
        data modify storage asset:mob Resist.Physical set value 1
    # 魔法倍率 (float) (オプション)
        data modify storage asset:mob Resist.Magic set value 1
    # 火倍率 (float) (オプション)
        data modify storage asset:mob Resist.Fire set value 1
    # 水倍率 (float) (オプション)
        data modify storage asset:mob Resist.Water set value 1
    # 雷倍率 (float) (オプション)
        data modify storage asset:mob Resist.Thunder set value 1

# MobInitタグ持ちを対象にして召喚関数呼び出し
    execute as @e[type=zombie,tag=MobInit,distance=..0.01] run function asset:mob/common/summon


text:
#> asset:mob/0176.killer_bee/summon/1.trigger
#
# Mob召喚処理の呼び出し時に実行されるfunction
#
# @within tag/function asset:mob/summon

execute if data storage asset:context {id:176} run function asset:mob/0176.killer_bee/summon/2.summon


text:
#> asset:mob/0176.killer_bee/hurt/2.hurt
#
# Mobの被ダメージ時の処理
#
# @within function asset:mob/0176.killer_bee/hurt/1.trigger

# 演出
    playsound entity.bee.hurt hostile @a ~ ~ ~ 1 1

# HurtTimeをスコア化
    scoreboard players set @s 4W.HurtTime 20
    data modify entity @s[scores={4W.MoveTime=..49}] NoAI set value 0b


text:
#> asset:mob/0176.killer_bee/hurt/1.trigger
#
# Mobの被ダメージに実行されるfunction
#
# @within tag/function asset:mob/hurt

execute if data storage asset:context {id:176} run function asset:mob/0176.killer_bee/hurt/2.hurt


text:
#> asset:mob/0176.killer_bee/tick/2.tick
#
# Mobのtick時の処理
#
# @within function asset:mob/0176.killer_bee/tick/1.trigger

# スコア関連
    scoreboard players add @s 4W.MoveTime 1
    scoreboard players remove @s[scores={4W.HurtTime=0..}] 4W.HurtTime 1

# スコアによって速度が変わる、突進のときはダメージを受けても止まらない。
    execute if entity @s[scores={4W.MoveTime=..49}] unless score @s 4W.HurtTime matches 0.. facing entity @p feet positioned ^ ^ ^-100 rotated as @s positioned ^ ^ ^-800 facing entity @s eyes positioned as @s run tp @s ^ ^ ^0.5 ~ ~
    execute if entity @s[scores={4W.MoveTime=50..}] facing entity @p feet positioned ^ ^ ^-100 rotated as @s positioned ^ ^ ^-400 facing entity @s eyes positioned as @s run tp @s ^ ^ ^1 ~ ~

# スコアリセット
    scoreboard players reset @s[scores={4W.MoveTime=100..}] 4W.MoveTime

# のけぞりから復帰
    data modify entity @s[scores={4W.HurtTime=..0}] NoAI set value 1b

# 演出
    execute if score @s 4W.MoveTime matches 50 run playsound entity.bee.hurt hostile @a ~ ~ ~ 1 1
    execute if entity @s[scores={4W.MoveTime=50..100}] run particle cloud ~ ~1.25 ~ 0.25 0.25 0.25 0 0

# クールタイムを減らす 0以下にはならない
    scoreboard players remove @s[scores={4W.AttackCT=1..}] 4W.AttackCT 1

# クールタイム中じゃないなら突進時に攻撃
    execute if entity @s[scores={4W.MoveTime=50..}] unless score @s 4W.AttackCT matches 1.. positioned ~-0.5 ~0.5 ~-0.5 if entity @p[tag=!PlayerShouldInvulnerable,dx=0] run function asset:mob/0176.killer_bee/tick/3.damage

# カベにぶつかった際の処理はない。壁は貫通するもの

# デスポーン処理
    execute unless entity @p[distance=..40] run function asset:mob/0176.killer_bee/tick/remove


text:
#> asset:mob/0176.killer_bee/tick/3.damage
#
#
#
# @within function asset:mob/0176.killer_bee/tick/2.tick

# 演出
    playsound entity.bee.sting hostile @a ~ ~ ~ 1 1

# 攻撃のCT設定
    scoreboard players set @s 4W.AttackCT 20
# ダメージを与える
# 引数の設定
    # 与えるダメージ
        data modify storage lib: Argument.Damage set value 37
    # 第一属性
        data modify storage lib: Argument.AttackType set value "Physical"
    # 第二属性
        data modify storage lib: Argument.ElementType set value "None"
# 補正functionを実行
    function lib:damage/modifier
# 対象
    execute as @p[tag=!PlayerShouldInvulnerable,dx=0] run function lib:damage/
# リセット
    function lib:damage/reset

# 自爆ダメージ
    data modify storage lib: Argument.Damage set value 103
# 第一属性
    data modify storage lib: Argument.AttackType set value "Magic"
# 耐性を無視する
    data modify storage lib: Argument.FixedDamage set value true
# 自爆する
    function lib:damage/
# リセット
    function lib:damage/reset


text:
#> asset:mob/0176.killer_bee/tick/remove
#
#
#
# @within function asset:mob/0176.killer_bee/tick/2.tick

# 消失処理
    tp @s ~ -1000 ~
    kill @s


text:
#> asset:mob/0176.killer_bee/tick/1.trigger
#
# Mobが生きている間毎tick実行されるfunction
#
# @within tag/function asset:mob/tick

execute if data storage asset:context {id:176} run function asset:mob/0176.killer_bee/tick/2.tick


text:
#> asset:mob/1009.ancient_light/summon/2.summon
#
# Mobの召喚時の処理
#
# @within function asset:mob/1009.ancient_light/summon/1.trigger

# 元となるMobを召喚する
    summon area_effect_cloud ~ ~ ~ {Tags:["MobInit"],CustomNameVisible:0b,Particle:"block air",Duration:50}
# ID (int)
    data modify storage asset:mob ID set value 1009
# Type (string) Wikiを参照
    data modify storage asset:mob Type set value "Projectile"
# 干渉可能か否か (boolean)
    data modify storage asset:mob Interferable set value false
# 名前 (TextComponentString) (オプション)
    data modify storage asset:mob Name set value '{"text":"古代の光","color":"aqua"}'

# 召喚者の反対方向を見る
    execute facing entity @s eyes run tp @e[type=area_effect_cloud,tag=MobInit,distance=..0.01] ~ ~ ~ ~180 -10

# MobInitタグ持ちを対象にして召喚関数呼び出し
    execute as @e[type=area_effect_cloud,tag=MobInit,distance=..0.01] run function asset:mob/common/summon


text:
#> asset:mob/1009.ancient_light/summon/1.trigger
#
# Mob召喚処理の呼び出し時に実行されるfunction
#
# @within tag/function asset:mob/summon

execute if data storage asset:context {id:1009} run function asset:mob/1009.ancient_light/summon/2.summon


text:
#> asset:mob/1009.ancient_light/tick/2.tick
#
# Mobのtick時の処理
#
# @within function asset:mob/1009.ancient_light/tick/1.trigger

# 追尾する
    execute if entity @p[distance=..32] facing entity @p eyes positioned ^ ^ ^-100 rotated as @s positioned ^ ^ ^-1000 facing entity @s eyes positioned as @s run tp @s ^ ^ ^0.5 ~ ~

# particle
    particle dust 1 1000000000 1000000000 1 ~ ~ ~ 0.3 0.3 0.3 1 20 normal @a

# ダメージ
    execute if entity @a[gamemode=!spectator,distance=..2] run function asset:mob/1009.ancient_light/tick/3.damage


text:
#> asset:mob/1009.ancient_light/tick/3.damage
#
#
#
# @within function asset:mob/1009.ancient_light/tick/2.tick

# 演出
    playsound minecraft:block.glass.break hostile @a ~ ~ ~ 1 0
    playsound item.trident.riptide_3 hostile @a ~ ~ ~ 1 2

# ダメージを与える
# ダメージ設定
    # 与えるダメージ
        data modify storage lib: Argument.Damage set value 40.0f
    # 魔法属性
        data modify storage lib: Argument.AttackType set value "Magic"
    # 属性
        data modify storage lib: Argument.ElementType set value "Water"
    # ダメージ
        function lib:damage/modifier
        execute as @a[tag=!PlayerShouldInvulnerable,distance=..3] run function lib:damage/
# リセット
    function lib:damage/reset

# キル
    kill @s


text:
#> asset:mob/1009.ancient_light/tick/1.trigger
#
# Mobが生きている間毎tick実行されるfunction
#
# @within tag/function asset:mob/tick

execute if data storage asset:context {id:1009} run function asset:mob/1009.ancient_light/tick/2.tick


text:
#> asset:mob/0013.cluster_creeper/death/2.death
#
# Mobの死亡時の処理
#
# @within function asset:mob/0013.cluster_creeper/death/1.trigger

 # 死亡時クリーパー召喚
    execute positioned ~ ~ ~3 run summon creeper ~ ~ ~
    execute positioned ~-2.598 ~ ~-1.5 run summon creeper ~ ~ ~
    execute positioned ~2.598 ~ ~-1.5 run summon creeper ~ ~ ~


text:
#> asset:mob/0013.cluster_creeper/death/1.trigger
#
# Mobの死亡時に実行されるfunction
#
# @within tag/function asset:mob/death

execute if data storage asset:context {id:13} run function asset:mob/0013.cluster_creeper/death/2.death


text:
#> asset:mob/0013.cluster_creeper/summon/2.summon
#
# Mobの召喚時の処理
#
# @within function asset:mob/0013.cluster_creeper/summon/1.trigger

# 元となるMobを召喚する
    summon creeper ~ ~ ~ {Tags:["MobInit"],DeathLootTable:"asset:mob/death/0013.cluster_creeper"}
# ID (int)
    data modify storage asset:mob ID set value 13
# Type (string) Wikiを参照
    data modify storage asset:mob Type set value "Enemy"
# 干渉可能か否か (boolean)
    data modify storage asset:mob Interferable set value true
# 名前 (TextComponentString) (オプション)
    data modify storage asset:mob Name set value '{"text":"クラスタークリーパー","color":"green"}'
# 武器
    # メインハンド (Compound(Item)) (オプション)
        # data modify storage asset:mob Weapon.Mainhand set value
    # オフハンド (Compound(Item)) (オプション)
        # data modify storage asset:mob Weapon.Offhand set value
# 武器ドロップ率 ([float, float]) (オプション)
    # data modify storage asset:mob WeaponDropChances set value
# 防具
    # 頭 (Compound(Item)) (オプション)
        # data modify storage asset:mob Armor.Head set value
    # 胴 (Compound(Item)) (オプション)
        # data modify storage asset:mob Armor.Chest set value
    # 脚 (Compound(Item)) (オプション)
        # data modify storage asset:mob Armor.Legs set value
    # 足 (Compound(Item)) (オプション)
        # data modify storage asset:mob Armor.Feet set value
# 防具ドロップ率 ([float, float]) (オプション)
    # data modify storage asset:mob ArmorDropChances set value
# 体力 (double) (オプション)
    data modify storage asset:mob Health set value 1.0
# 攻撃力 (double) (オプション)
    data modify storage asset:mob AttackDamage set value 0.0
# 防御力 (double) (オプション) // 被ダメージがある程度大きい場合1ptにつき0.8%カット、小さい場合1ptにつき約4%カット 20pt以上は頭打ち
    # data modify storage asset:mob Defense set value
# 特殊防御力 (double) (オプション) // 4pointにつきダメージを大きく減らす
    # data modify storage asset:mob SpecialDefense set value
# 移動速度 (double) (オプション)
    data modify storage asset:mob Speed set value 0.50
# 索敵範囲 (double) (オプション)
    data modify storage asset:mob FollowRange set value 25.0
# ノックバック耐性 (double) (オプション)
    data modify storage asset:mob KnockBackResist set value 1.0
# 属性倍率 // 1.0fで100% 最低でも25%は軽減されずに入る
    # 物理倍率 (float) (オプション)
        data modify storage asset:mob Resist.Physical set value 1.0
    # 魔法倍率 (float) (オプション)
        data modify storage asset:mob Resist.Magic set value 1.0
    # 火倍率 (float) (オプション)
        data modify storage asset:mob Resist.Fire set value 1.0
    # 水倍率 (float) (オプション)
        data modify storage asset:mob Resist.Water set value 1.0
    # 雷倍率 (float) (オプション)
        data modify storage asset:mob Resist.Thunder set value 1.0

# MobInitタグ持ちを対象にして召喚関数呼び出し
    execute as @e[type=creeper,tag=MobInit,distance=..0.01] run function asset:mob/common/summon


text:
#> asset:mob/0013.cluster_creeper/summon/1.trigger
#
# Mob召喚処理の呼び出し時に実行されるfunction
#
# @within tag/function asset:mob/summon

execute if data storage asset:context {id:13} run function asset:mob/0013.cluster_creeper/summon/2.summon


text:
#> asset:mob/0026.vein/summon/2.summon
#
# Mobの召喚時の処理
#
# @within function asset:mob/0026.vein/summon/1.trigger

# 元となるMobを召喚する
    summon zombie ~ ~ ~ {Silent:1b,Tags:["MobInit"],DeathLootTable:"asset:mob/death/0026.vein"}
# ID (int)
    data modify storage asset:mob ID set value 26
# Type (string) Wikiを参照
    data modify storage asset:mob Type set value "Enemy"
# 干渉可能か否か (boolean)
    data modify storage asset:mob Interferable set value true
# 名前 (TextComponentString) (オプション)
    data modify storage asset:mob Name set value '{"text":"静脈","color":"blue"}'
# 武器
    # メインハンド (Compound(Item)) (オプション)
        # data modify storage asset:mob Weapon.Mainhand set value
    # オフハンド (Compound(Item)) (オプション)
        # data modify storage asset:mob Weapon.Offhand set value
# 武器ドロップ率 ([float, float]) (オプション)
    # data modify storage asset:mob WeaponDropChances set value
# 防具
    # 頭 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Head set value {id:"minecraft:warped_wart_block",Count:1b}
    # 胴 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Chest set value {id:"minecraft:leather_chestplate",Count:1b,tag:{display:{color:2536876}}}
    # 脚 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Legs set value {id:"minecraft:leather_leggings",Count:1b,tag:{display:{color:2536876}}}
    # 足 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Feet set value {id:"minecraft:leather_boots",Count:1b,tag:{display:{color:2536876}}}
# 防具ドロップ率 ([float, float]) (オプション)
    # data modify storage asset:mob ArmorDropChances set value
# 体力 (double) (オプション)
    data modify storage asset:mob Health set value 127.0
# 攻撃力 (double) (オプション)
    data modify storage asset:mob AttackDamage set value 3.7
# 防御力 (double) (オプション) // 被ダメージがある程度大きい場合1ptにつき0.8%カット、小さい場合1ptにつき約4%カット 20pt以上は頭打ち
    #data modify storage asset:mob Defense set value
# 特殊防御力 (double) (オプション) // 4pointにつきダメージを大きく減らす
    #data modify storage asset:mob SpecialDefense set value
# 移動速度 (double) (オプション)
    data modify storage asset:mob Speed set value 0.30
# 索敵範囲 (double) (オプション)
    data modify storage asset:mob FollowRange set value 32.0
# ノックバック耐性 (double) (オプション)
    data modify storage asset:mob KnockBackResist set value 0.0
# 属性倍率 // 1.0fで100% 最低でも25%は軽減されずに入る
    # 物理倍率 (float) (オプション)
        data modify storage asset:mob Resist.Physical set value 1.0
    # 魔法倍率 (float) (オプション)
        data modify storage asset:mob Resist.Magic set value 0.9
    # 火倍率 (float) (オプション)
        data modify storage asset:mob Resist.Fire set value 0.9
    # 水倍率 (float) (オプション)
        data modify storage asset:mob Resist.Water set value 0.9
    # 雷倍率 (float) (オプション)
        data modify storage asset:mob Resist.Thunder set value 1.0

# MobInitタグ持ちを対象にして召喚関数呼び出し
    execute as @e[type=zombie,tag=MobInit,distance=..0.01] run function asset:mob/common/summon


text:
#> asset:mob/0026.vein/summon/1.trigger
#
# Mob召喚処理の呼び出し時に実行されるfunction
#
# @within tag/function asset:mob/summon

execute if data storage asset:context {id:26} run function asset:mob/0026.vein/summon/2.summon


text:
#> asset:mob/0026.vein/attack/1.trigger
#
# Mobの攻撃時に実行されるfunction
#
# @within tag/function asset:mob/attack

execute if data storage asset:context {id:26} run function asset:mob/0026.vein/attack/2.attack


text:
#> asset:mob/0026.vein/attack/2.attack
#
# Mobの攻撃時の処理
#
# @within function asset:mob/0026.vein/attack/1.trigger

# 弱化を付与
    execute at @p[tag=Victim] run effect give @a[tag=!PlayerShouldInvulnerable,distance=..2.5] weakness 4 2 true

# 演出
    playsound minecraft:block.note_block.basedrum hostile @a ~ ~ ~ 2 1.7 0
    execute at @p[tag=Victim] run particle dust 0.149 0.682 0.741 1 ~ ~ ~ 0.6 0.6 0.6 0 20 normal @a


text:
#> asset:mob/0080.fukotsu/summon/2.summon
#
# Mobの召喚時の処理
#
# @within function asset:mob/0080.fukotsu/summon/1.trigger

# 元となるMobを召喚する
    summon skeleton ~ ~ ~ {Tags:["MobInit"],DeathLootTable:"asset:mob/death/0080.fukotsu"}
# ID (int)
    data modify storage asset:mob ID set value 80
# Type (string) Wikiを参照
    data modify storage asset:mob Type set value "Enemy"
# 干渉可能か否か (boolean)
    data modify storage asset:mob Interferable set value true
# 名前 (TextComponentString) (オプション)
    data modify storage asset:mob Name set value '{"text":"富骨","color":"yellow"}'
# 武器
    # メインハンド (Compound(Item)) (オプション)
        data modify storage asset:mob Weapon.Mainhand set value {id:"minecraft:stick",Count:1b,tag:{CustomModelData:318}}
    # オフハンド (Compound(Item)) (オプション)
        # data modify storage asset:mob Weapon.Offhand set value
# 武器ドロップ率 ([float, float]) (オプション)
    # data modify storage asset:mob WeaponDropChances set value
# 防具
    # 頭 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Head set value {id:"minecraft:player_head",Count:1b,tag:{display:{Name:'{"text":"富骨の頭蓋骨","color":"yellow","italic":false}'},SkullOwner:{Id:[I;1,2,80,0],Properties:{textures:[{Value:"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNDAxYjM1ZDkwYmFmMGM3NzA2OTU0YmEwYmFiOTE2M2EyNDNiZjU0MGZmN2Q1ZGE0NzdjMzcyOTE3YTEyMTg4In19fQ=="}]}}}}
    # 胴 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Chest set value {id:"minecraft:golden_chestplate",Count:1b}
    # 脚 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Legs set value {id:"minecraft:golden_leggings",Count:1b}
    # 足 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Feet set value {id:"minecraft:golden_boots",Count:1b}
# 防具ドロップ率 ([float, float]) (オプション)
    data modify storage asset:mob ArmorDropChances set value [0.0f,0.0f,0.0f,0.0015f]
# 体力 (double) (オプション)
    data modify storage asset:mob Health set value 1060.0
# 攻撃力 (double) (オプション)
    data modify storage asset:mob AttackDamage set value 4.0
# 防御力 (double) (オプション) // 被ダメージがある程度大きい場合1ptにつき0.8%カット、小さい場合1ptにつき約4%カット 20pt以上は頭打ち
    # data modify storage asset:mob Defense set value
# 特殊防御力 (double) (オプション) // 4pointにつきダメージを大きく減らす
    # data modify storage asset:mob SpecialDefense set value
# 移動速度 (double) (オプション)
    data modify storage asset:mob Speed set value 0.26
# 索敵範囲 (double) (オプション)
    data modify storage asset:mob FollowRange set value 25.0
# ノックバック耐性 (double) (オプション)
    data modify storage asset:mob KnockBackResist set value 0.5
# 属性倍率 // 1.0fで100% 最低でも25%は軽減されずに入る
    # 物理倍率 (float) (オプション)
        data modify storage asset:mob Resist.Physical set value 1.0f
    # 魔法倍率 (float) (オプション)
        data modify storage asset:mob Resist.Magic set value 0.7f
    # 火倍率 (float) (オプション)
        data modify storage asset:mob Resist.Fire set value 0.8f
    # 水倍率 (float) (オプション)
        data modify storage asset:mob Resist.Water set value 0.25f
    # 雷倍率 (float) (オプション)
        data modify storage asset:mob Resist.Thunder set value 1.0f

# MobInitタグ持ちを対象にして召喚関数呼び出し
    execute as @e[type=skeleton,tag=MobInit,distance=..0.01] run function asset:mob/common/summon


text:
#> asset:mob/0080.fukotsu/summon/1.trigger
#
# Mob召喚処理の呼び出し時に実行されるfunction
#
# @within tag/function asset:mob/summon

execute if data storage asset:context {id:80} run function asset:mob/0080.fukotsu/summon/2.summon


text:
#> asset:mob/0080.fukotsu/attack/1.trigger
#
# Mobの攻撃時に実行されるfunction
#
# @within tag/function asset:mob/attack

execute if data storage asset:context {id:80} run function asset:mob/0080.fukotsu/attack/2.attack


text:
#> asset:mob/0080.fukotsu/attack/2.attack
#
# Mobの攻撃時の処理
#
# @within function asset:mob/0080.fukotsu/attack/1.trigger

    execute at @a[tag=Victim,distance=..5] run particle dust 1 1 0 1 ~ ~2 ~ 0 2.5 0 0 100
    playsound minecraft:entity.lightning_bolt.thunder hostile @a ~ ~ ~ 1 2

# 引数の設定
    # 与えるダメージ = 7.5
        data modify storage lib: Argument.Damage set value 19.5f
    # 第一属性
        data modify storage lib: Argument.AttackType set value "Physical"
    # 第二属性
        data modify storage lib: Argument.ElementType set value "Thunder"
# 補正functionを実行
    function lib:damage/modifier
# 範囲5m以内の攻撃先を対象に
    execute as @a[tag=Victim,distance=..5] run function lib:damage/
# リセット
    function lib:damage/reset


text:
#> asset:mob/0027.skull_sniper/0.load
#
# MOBに利用するスコアボード等の初期化処理
#
# @within tag/function asset:mob/load

#> 定義類はここに
# @within function asset:mob/0027.skull_sniper/**
    scoreboard objectives add R.Attackcool dummy


text:
#> asset:mob/0027.skull_sniper/summon/2.summon
#
# Mobの召喚時の処理
#
# @within function asset:mob/0027.skull_sniper/summon/1.trigger

# 元となるMobを召喚する
    summon skeleton ~ ~ ~ {Tags:["MobInit"],DeathLootTable:"asset:mob/death/0027.skull_sniper"}
# ID (int)
    data modify storage asset:mob ID set value 27
# Type (string) Wikiを参照
    data modify storage asset:mob Type set value "Enemy"
# 干渉可能か否か (boolean)
    data modify storage asset:mob Interferable set value true
# 名前 (TextComponentString) (オプション)
    data modify storage asset:mob Name set value '{"text":"スカルスナイパー","color":"white"}'
# 武器
    # メインハンド (Compound(Item)) (オプション)
        data modify storage asset:mob Weapon.Mainhand set value {id:"minecraft:carrot_on_a_stick",Count:1b,tag:{CustomModelData:212}}
    # オフハンド (Compound(Item)) (オプション)
        data modify storage asset:mob Weapon.Offhand set value {}
# 防具
    # 頭 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Head set value {id:"minecraft:dragon_egg",Count:1b}
    # 胴 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Chest set value {id:"minecraft:leather_chestplate",Count:1b,tag:{display:{color:2377487}}}
    # 脚 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Legs set value {}
    # 足 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Feet set value {}
# 体力 (double) (オプション)
    data modify storage asset:mob Health set value 200
# 攻撃力 (double) (オプション)
    data modify storage asset:mob AttackDamage set value 0
# 防御力 (double) (オプション) // 被ダメージがある程度大きい場合1ptにつき0.8%カット、小さい場合1ptにつき約4%カット 20pt以上は頭打ち
    data modify storage asset:mob Defense set value 0
# 特殊防御力 (double) (オプション) // 4pointにつきダメージを大きく減らす
    # data modify storage asset:mob SpecialDefense set value
# 移動速度 (double) (オプション)
    data modify storage asset:mob Speed set value 0.1
# 索敵範囲 (double) (オプション)
    data modify storage asset:mob FollowRange set value 100
# ノックバック耐性 (double) (オプション)
    data modify storage asset:mob KnockBackResist set value 0
# 属性倍率 // 1.0fで100% 最低でも25%は軽減されずに入る
    # 物理耐性 (int) (オプション)
        data modify storage asset:mob Resist.Physical set value 1
    # 魔法耐性 (int) (オプション)
        data modify storage asset:mob Resist.Magic set value 1
    # 火耐性 (int) (オプション)
        data modify storage asset:mob Resist.Fire set value 1
    # 水耐性 (int) (オプション)
        data modify storage asset:mob Resist.Water set value 1
    # 雷耐性 (int) (オプション)
        data modify storage asset:mob Resist.Thunder set value 1

# MobInitタグ持ちを対象にして召喚関数呼び出し
    execute as @e[type=skeleton,tag=MobInit,distance=..0.01] run function asset:mob/common/summon


text:
#> asset:mob/0027.skull_sniper/summon/1.trigger
#
# Mob召喚処理の呼び出し時に実行されるfunction
#
# @within tag/function asset:mob/summon

execute if data storage asset:context {id:27} run function asset:mob/0027.skull_sniper/summon/2.summon


text:
#> asset:mob/0027.skull_sniper/tick/2.tick
#
# Mobのtick時の処理
#
# @within function asset:mob/0027.skull_sniper/tick/1.trigger

# 発泡後は正数になるまでスコアを増やす。
    execute positioned ^ ^ ^30 unless entity @p[gamemode=!spectator,distance=..30] run scoreboard players add @s[scores={R.Attackcool=..0}] R.Attackcool 1
# 視点先にプレイヤーがいたらスコアを増やす
    execute positioned ^ ^ ^30 if entity @p[gamemode=!spectator,distance=..30] run scoreboard players add @s R.Attackcool 1
# プレイヤーに警告を吐く
    execute if entity @s[scores={R.Attackcool=1..}] positioned ^ ^ ^30 if entity @p[gamemode=!spectator,distance=..30] positioned ^ ^ ^-30 positioned ~ ~1.5 ~0 facing entity @p[gamemode=!spectator,distance=..30] eyes run function asset:mob/0027.skull_sniper/tick/2.3.check
# 視点先にいない場合諦める
    execute positioned ^ ^ ^30 unless entity @p[gamemode=!spectator,distance=..30] run scoreboard players reset @s[scores={R.Attackcool=1..}] R.Attackcool

# 発泡処理
    execute if score @s R.Attackcool matches 90 positioned ~ ~1.5 ~ facing entity @p[gamemode=!spectator,distance=..30] eyes run function asset:mob/0027.skull_sniper/tick/2.1.shot
    tag @s[tag=Landing,scores={R.Attackcool=90}] remove Landing
    scoreboard players set @s[scores={R.Attackcool=90}] R.Attackcool -80


text:
#> asset:mob/0027.skull_sniper/tick/2.2.hit
#
# Mobのtick時の処理
#
# @within function
#       asset:mob/0027.skull_sniper/tick/2.tick
#       asset:mob/0027.skull_sniper/tick/2.1.shot

# 着弾の演出
    playsound minecraft:entity.generic.explode hostile @a

# 演出
    execute at @p[tag=LandingTarget] run particle minecraft:block redstone_block ~ ~1.2 ~ 0.4 0.4 0.4 0 99

# ダメージ設定
    # 与えるダメージ = 10
        data modify storage lib: Argument.Damage set value 15.0f
    # 第一属性
        data modify storage lib: Argument.AttackType set value "Physical"
    # ダメージ
        function lib:damage/modifier
        execute as @p[gamemode=!creative,tag=LandingTarget] run function lib:damage/
# リセット
    function lib:damage/reset

# 着弾タグを消す
    tag @p[tag=LandingTarget] remove LandingTarget


text:
#> asset:mob/0027.skull_sniper/tick/2.3.check
#
# Mobのtick時の処理
#
# @within function
#       asset:mob/0027.skull_sniper/tick/2.tick
#       asset:mob/0027.skull_sniper/tick/2.3.check
# レーザー投射
    execute if entity @p[gamemode=!spectator,distance=..2] run tag @s add Landing
    execute unless block ^ ^ ^1 #lib:no_collision run tag @s add Landing

# 演出
    execute if entity @p[gamemode=!spectator,distance=..2] run playsound block.note_block.bit hostile @p ~ ~ ~ 0.5 2
    particle minecraft:dust 0.58 0 0 0.75 ~ ~ ~ 0 0 0 0 1

# 再起
    execute positioned ^ ^ ^1 if entity @s[tag=!Landing,distance=..30] run function asset:mob/0027.skull_sniper/tick/2.3.check

# タグ消し
    tag @s[tag=Landing] remove Landing


text:
#> asset:mob/0027.skull_sniper/tick/1.trigger
#
# Mobが生きている間毎tick実行されるfunction
#
# @within tag/function asset:mob/tick

execute if data storage asset:context {id:27} run function asset:mob/0027.skull_sniper/tick/2.tick


text:
#> asset:mob/0027.skull_sniper/tick/2.1.shot
#
# Mobのtick時の処理
#
# @within function
#       asset:mob/0027.skull_sniper/tick/2.tick
#       asset:mob/0027.skull_sniper/tick/2.1.shot
# 着弾検知
    execute if entity @p[gamemode=!spectator,distance=..2] run tag @s add Landing
    execute unless block ^ ^ ^1 #lib:no_collision run tag @s add Landing

# ターゲットにタグ付与
    execute if entity @p[gamemode=!spectator,distance=..2] run tag @p[gamemode=!spectator,distance=..2] add LandingTarget

# 演出
    particle minecraft:dust 0.145 0.18 0.153 0.75 ~ ~ ~ 0 0 0 0 1

# 着弾
    execute if entity @s[tag=Landing] run function asset:mob/0027.skull_sniper/tick/2.2.hit

# 再起
    execute positioned ^ ^ ^1 if entity @s[tag=!Landing,distance=..30] run function asset:mob/0027.skull_sniper/tick/2.1.shot


text:
#> asset:mob/0027.skull_sniper/tick/_index.d
# @private

#> tag
# @within function
#   asset:mob/0027.skull_sniper/tick/**
    #declare tag Landing
    #declare tag LandingTarget


text:
#> asset:mob/0259.shadow_stalker/_index.d
# @private

#> tag
# @within function asset:mob/0259.shadow_stalker/**
    #declare tag 77.Dark


text:
#> asset:mob/0259.shadow_stalker/summon/2.summon
#
# Mobの召喚時の処理
#
# @within function asset:mob/0259.shadow_stalker/summon/1.trigger

# 元となるMobを召喚する
    summon zombie ~ ~ ~ {Tags:["MobInit","AlwaysInvisible","77.Dark"],Silent:1b,DeathLootTable:"asset:mob/death/0259.shadow_stalker"}
# ID (int)
    data modify storage asset:mob ID set value 259
# Type (string) Wikiを参照
    data modify storage asset:mob Type set value "Enemy"
# 干渉可能か否か (boolean)
    data modify storage asset:mob Interferable set value true
# 名前 (TextComponentString) (オプション)
    data modify storage asset:mob Name set value '{"text":"シャドウストーカー","color":"gray"}'
# 武器
    # メインハンド (Compound(Item)) (オプション)
        # data modify storage asset:mob Weapon.Mainhand set value
    # オフハンド (Compound(Item)) (オプション)
        # data modify storage asset:mob Weapon.Offhand set value
# 武器ドロップ率 ([float, float]) (オプション)
    # data modify storage asset:mob WeaponDropChances set value
# 防具
    # 頭 (Compound(Item)) (オプション)
        # data modify storage asset:mob Armor.Head set value
    # 胴 (Compound(Item)) (オプション)
        # data modify storage asset:mob Armor.Chest set value
    # 脚 (Compound(Item)) (オプション)
        # data modify storage asset:mob Armor.Legs set value
    # 足 (Compound(Item)) (オプション)
        # data modify storage asset:mob Armor.Feet set value
# 防具ドロップ率 ([float, float]) (オプション)
    # data modify storage asset:mob ArmorDropChances set value
# 体力 (double) (オプション)
    data modify storage asset:mob Health set value 200
# 攻撃力 (double) (オプション)
    # data modify storage asset:mob AttackDamage set value
# 防御力 (double) (オプション) // 被ダメージがある程度大きい場合1ptにつき0.8%カット、小さい場合1ptにつき約4%カット 20pt以上は頭打ち
    data modify storage asset:mob Defense set value -6
# 特殊防御力 (double) (オプション) // 4pointにつきダメージを大きく減らす
    # data modify storage asset:mob SpecialDefense set value
# 移動速度 (double) (オプション)
    data modify storage asset:mob Speed set value 0.28
# 索敵範囲 (double) (オプション)
    # data modify storage asset:mob FollowRange set value
# ノックバック耐性 (double) (オプション)
    data modify storage asset:mob KnockBackResist set value 1
# 属性倍率 // 1.0fで100% 最低でも25%は軽減されずに入る
    # 物理倍率 (float) (オプション)
        data modify storage asset:mob Resist.Physical set value 0.25
    # 魔法倍率 (float) (オプション)
        data modify storage asset:mob Resist.Magic set value 0.25
    # 火倍率 (float) (オプション)
        data modify storage asset:mob Resist.Fire set value 1
    # 水倍率 (float) (オプション)
        data modify storage asset:mob Resist.Water set value 1
    # 雷倍率 (float) (オプション)
        data modify storage asset:mob Resist.Thunder set value 1

# MobInitタグ持ちを対象にして召喚関数呼び出し
    execute as @e[type=zombie,tag=MobInit,distance=..0.01] run function asset:mob/common/summon


text:
#> asset:mob/0259.shadow_stalker/summon/1.trigger
#
# Mob召喚処理の呼び出し時に実行されるfunction
#
# @within tag/function asset:mob/summon

execute if data storage asset:context {id:259} run function asset:mob/0259.shadow_stalker/summon/2.summon


text:
#> asset:mob/0259.shadow_stalker/hurt/2.hurt
#
# Mobの被ダメージ時の処理
#
# @within function asset:mob/0259.shadow_stalker/hurt/1.trigger

# 透明状態の時、被ダメ時にテレポート
# 拡散値
    execute if entity @s[tag=77.Dark] run data modify storage lib: Argument.Bounds set value [[5d,5d],[0d,1d],[5d,5d]]
# 拡散する
    execute if entity @s[tag=77.Dark] at @a[gamemode=!spectator,distance=..30,sort=random,limit=1] run function lib:spread_entity/

# 演出
    playsound minecraft:entity.vex.charge hostile @a ~ ~ ~ 1 2
    playsound minecraft:entity.spider.hurt hostile @a ~ ~ ~ 1 1.5


text:
#> asset:mob/0259.shadow_stalker/hurt/1.trigger
#
# Mobの被ダメージに実行されるfunction
#
# @within tag/function asset:mob/hurt

execute if data storage asset:context {id:259} run function asset:mob/0259.shadow_stalker/hurt/2.hurt


text:
#> asset:mob/0259.shadow_stalker/attack/1.trigger
#
# Mobの攻撃時に実行されるfunction
#
# @within tag/function asset:mob/attack

execute if data storage asset:context {id:259} run function asset:mob/0259.shadow_stalker/attack/2.attack


text:
#> asset:mob/0259.shadow_stalker/attack/2.attack
#
# Mobの攻撃時の処理
#
# @within function asset:mob/0259.shadow_stalker/attack/1.trigger

# 属性ダメージ
   # 与えるダメージ
        data modify storage lib: Argument.Damage set value 11.0f
    # 第一属性
        data modify storage lib: Argument.AttackType set value "Physical"
    # 第二属性
        data modify storage lib: Argument.ElementType set value "None"
    # 補正functionを実行
        function lib:damage/modifier
    # プレイヤー対象に
        execute as @p[tag=Victim] run function lib:damage/
    # リセット
        function lib:damage/reset


text:
#> asset:mob/0259.shadow_stalker/tick/2.tick
#
# Mobのtick時の処理
#
# @within function asset:mob/0259.shadow_stalker/tick/1.trigger

# 暗いと完全に透明化する
    execute unless entity @s[tag=77.Dark] unless predicate lib:light_level/min/5 run function asset:mob/0259.shadow_stalker/tick/armor_dis_equip

# 明るいと出現する
    execute if entity @s[tag=77.Dark] if predicate lib:light_level/min/5 run function asset:mob/0259.shadow_stalker/tick/armor_equip


text:
#> asset:mob/0259.shadow_stalker/tick/armor_equip
#
#
#
# @within function asset:mob/0259.shadow_stalker/tick/2.tick

# タグけし
    tag @s remove 77.Dark

# 装備
    item replace entity @s armor.head with cracked_deepslate_bricks 1
    item replace entity @s armor.chest with leather_chestplate{display:{color:3552822}} 1
    item replace entity @s armor.legs with leather_leggings{display:{color:3552822}} 1
    item replace entity @s armor.feet with leather_boots{display:{color:3552822}} 1

# 演出
    particle smoke ~ ~1 ~ 0.3 1 0.3 0 30


text:
#> asset:mob/0259.shadow_stalker/tick/armor_dis_equip
#
#
#
# @within function asset:mob/0259.shadow_stalker/tick/2.tick

# タグつけ
    tag @s add 77.Dark

# 装備
    item replace entity @s armor.head with air
    item replace entity @s armor.chest with air
    item replace entity @s armor.legs with air
    item replace entity @s armor.feet with air

# 演出
    particle smoke ~ ~1 ~ 0.3 1 0.3 0 30


text:
#> asset:mob/0259.shadow_stalker/tick/1.trigger
#
# Mobが生きている間毎tick実行されるfunction
#
# @within tag/function asset:mob/tick

execute if data storage asset:context {id:259} run function asset:mob/0259.shadow_stalker/tick/2.tick


text:
#> asset:mob/0124.skull_harpy/0.load
#
# MOBに利用するスコアボード等の初期化処理
#
# @within tag/function asset:mob/load

#> 定義類はここに
# @within function asset:mob/0124.skull_harpy/**
    scoreboard objectives add 3G.Tick dummy


text:
#> asset:mob/0124.skull_harpy/summon/2.summon
#
# Mobの召喚時の処理
#
# @within function asset:mob/0124.skull_harpy/summon/1.trigger

# 元となるMobを召喚する
    summon skeleton ~ ~ ~ {Tags:["MobInit","AlwaysSlowFall"],NoGravity:1b,DeathLootTable:"asset:mob/death/0124.skull_harpy"}
# ID (int)
    data modify storage asset:mob ID set value 124
# Type (string) Wikiを参照
    data modify storage asset:mob Type set value "Enemy"
# 干渉可能か否か (boolean)
    data modify storage asset:mob Interferable set value true
# 名前 (TextComponentString) (オプション)
    data modify storage asset:mob Name set value '{"text":"スカルハーピィ","color":"gray"}'
# 武器
    # メインハンド (Compound(Item)) (オプション)
        data modify storage asset:mob Weapon.Mainhand set value {id:"minecraft:bow",Count:1b}
    # オフハンド (Compound(Item)) (オプション)
        # data modify storage asset:mob Weapon.Offhand set value
# 武器ドロップ率 ([float, float]) (オプション)
    # data modify storage asset:mob WeaponDropChances set value
# 防具
    # 頭 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Head set value {id:"minecraft:stone",Count:1b,tag:{CustomModelData:20019}}
    # 胴 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Chest set value {id:"minecraft:elytra",Count:1b}
    # 脚 (Compound(Item)) (オプション)
        # data modify storage asset:mob Armor.Legs set value
    # 足 (Compound(Item)) (オプション)
        # data modify storage asset:mob Armor.Feet set value
# 防具ドロップ率 ([float, float]) (オプション)
    # data modify storage asset:mob ArmorDropChances set value
# 体力 (double) (オプション)
    data modify storage asset:mob Health set value 310
# 攻撃力 (double) (オプション)
    data modify storage asset:mob AttackDamage set value 0
# 防御力 (double) (オプション) // 被ダメージがある程度大きい場合1ptにつき0.8%カット、小さい場合1ptにつき約4%カット 20pt以上は頭打ち
    data modify storage asset:mob Defense set value 0
# 特殊防御力 (double) (オプション) // 4pointにつきダメージを大きく減らす
    # data modify storage asset:mob SpecialDefense set value
# 移動速度 (double) (オプション)
    # data modify storage asset:mob Speed set value
# 索敵範囲 (double) (オプション)
    data modify storage asset:mob FollowRange set value 32
# ノックバック耐性 (double) (オプション)
    data modify storage asset:mob KnockBackResist set value 1
# 属性倍率 // 1.0fで100% 最低でも25%は軽減されずに入る
    # 物理倍率 (float) (オプション)
        data modify storage asset:mob Resist.Physical set value 1
    # 魔法倍率 (float) (オプション)
        data modify storage asset:mob Resist.Magic set value 1
    # 火倍率 (float) (オプション)
        data modify storage asset:mob Resist.Fire set value 0.80
    # 水倍率 (float) (オプション)
        data modify storage asset:mob Resist.Water set value 0.80
    # 雷倍率 (float) (オプション)
        data modify storage asset:mob Resist.Thunder set value 1

# MobInitタグ持ちを対象にして召喚関数呼び出し
    execute as @e[type=skeleton,tag=MobInit,distance=..0.01] run function asset:mob/common/summon


text:
#> asset:mob/0124.skull_harpy/summon/1.trigger
#
# Mob召喚処理の呼び出し時に実行されるfunction
#
# @within tag/function asset:mob/summon

execute if data storage asset:context {id:124} run function asset:mob/0124.skull_harpy/summon/2.summon


text:
#> asset:mob/0124.skull_harpy/hurt/2.hurt
#
# Mobの被ダメージ時の処理
#
# @within function asset:mob/0124.skull_harpy/hurt/1.trigger

# 演出
    particle minecraft:cloud ~ ~1 ~ 0 0 0 0.4 20
    playsound entity.ender_dragon.flap hostile @a ~ ~ ~ 1 1.3

# プレイヤーから離れる
    data modify storage lib: Argument.VectorMagnitude set value 1
    execute facing entity @p eyes rotated ~180 -10 run function lib:motion/

# リセット
    data remove storage lib: Argument


text:
#> asset:mob/0124.skull_harpy/hurt/1.trigger
#
# Mobの被ダメージに実行されるfunction
#
# @within tag/function asset:mob/hurt

execute if data storage asset:context {id:124} run function asset:mob/0124.skull_harpy/hurt/2.hurt


text:
#> asset:mob/0124.skull_harpy/attack/1.trigger
#
# Mobの攻撃時に実行されるfunction
#
# @within tag/function asset:mob/attack

execute if data storage asset:context {id:124} run function asset:mob/0124.skull_harpy/attack/2.attack


text:
#> asset:mob/0124.skull_harpy/attack/2.attack
#
# Mobの攻撃時の処理
#
# @within function asset:mob/0124.skull_harpy/attack/1.trigger

# 演出
   execute at @a[tag=Victim] run particle minecraft:dust 1 1 0 2 ~ ~ ~ 0.8 0.8 0.8 0.1 20 normal @a
   execute at @a[tag=Victim] run playsound minecraft:entity.firework_rocket.twinkle hostile @a ~ ~ ~ 0.7 1.5 0

# 引数の設定
    # 与えるダメージ
        data modify storage lib: Argument.Damage set value 8.0d
    # 第一属性
        data modify storage lib: Argument.AttackType set value "Magic"
    # 第二属性
        data modify storage lib: Argument.ElementType set value "Thunder"
# 補正functionを実行
    function lib:damage/modifier
# ダメージ対象
    execute as @a[tag=Victim] run function lib:damage/
# リセット
    function lib:damage/reset


text:
#> asset:mob/0124.skull_harpy/tick/2.tick
#
# Mobのtick時の処理
#
# @within function asset:mob/0124.skull_harpy/tick/1.trigger

# スコア付与
    scoreboard players add @s 3G.Tick 1

# 周囲にプレイヤーがいる時、80tickに一度実行する
    execute if score @s 3G.Tick matches 80.. if entity @a[gamemode=!spectator,distance=..60] run function asset:mob/0124.skull_harpy/tick/2.1.motion


text:
#> asset:mob/0124.skull_harpy/tick/2.1.motion
#
#
#
# @within function asset:mob/0124.skull_harpy/tick/2.tick
#> private
# @private
    #declare tag Target

# 最寄りのプレイヤーにタグをつける
    tag @p[gamemode=!spectator] add Target

# 数値
    # デフォルト
        data modify storage lib: Argument.VectorMagnitude set value 0.8
    # かなり離れてる時に実行
        execute if entity @p[tag=Target,distance=30..60] run data modify storage lib: Argument.VectorMagnitude set value 1.5
    # 近い時に実行する
        execute if entity @p[tag=Target,distance=..9] run data modify storage lib: Argument.VectorMagnitude set value 0.6
# 実行
    # 適正距離の場合
        execute if entity @p[tag=Target,distance=9..60] facing entity @p eyes rotated ~ ~10 run function lib:motion/
    # 近い場合
        execute if entity @p[tag=Target,distance=..9] facing entity @p eyes rotated ~180 ~-10 run function lib:motion/

# リセット
    data remove storage lib: Argument
# タグを消す
    tag @a remove Target
# スコアを消す
    scoreboard players reset @s 3G.Tick


text:
#> asset:mob/0124.skull_harpy/tick/1.trigger
#
# Mobが生きている間毎tick実行されるfunction
#
# @within tag/function asset:mob/tick

execute if data storage asset:context {id:124} run function asset:mob/0124.skull_harpy/tick/2.tick


text:
#> asset:mob/0060.self_destructor/0.load
#
# MOBに利用するスコアボード等の初期化処理
#
# @within tag/function asset:mob/load

#> 定義類はここに
# @within function asset:mob/0060.self_destructor/**
    scoreboard objectives add 1O.ExplodeCnt dummy
    scoreboard objectives add 1O.ExplodeFuse dummy


text:
#> asset:mob/0060.self_destructor/death/2.death
#
# Mobの死亡時の処理
#
# @within function asset:mob/0060.self_destructor/death/1.trigger

# 演出
   playsound entity.tnt.primed hostile @a ~ ~ ~ 1 0 0
   particle smoke ~ ~1 ~ 0.4 0.8 0.4 0 30 normal @a


text:
#> asset:mob/0060.self_destructor/death/1.trigger
#
# Mobの死亡時に実行されるfunction
#
# @within tag/function asset:mob/death

execute if data storage asset:context {id:60} run function asset:mob/0060.self_destructor/death/2.death


text:
#> asset:mob/0060.self_destructor/summon/2.summon
#
# Mobの召喚時の処理
#
# @within function asset:mob/0060.self_destructor/summon/1.trigger

# 元となるMobを召喚する
    summon zombie ~ ~ ~ {Silent:1b,Tags:["MobInit","AlwaysInvisible"],DeathLootTable:"asset:mob/death/0060.self_destructor"}
# ID (int)
    data modify storage asset:mob ID set value 60
# Type (string) Wikiを参照
    data modify storage asset:mob Type set value "Enemy"
# 干渉可能か否か (boolean)
    data modify storage asset:mob Interferable set value true
# 名前 (TextComponentString) (オプション)
    data modify storage asset:mob Name set value '{"text":"自爆者","color":"red"}'
# 武器
    # メインハンド (Compound(Item)) (オプション)
        data modify storage asset:mob Weapon.Mainhand set value {id:"minecraft:tnt",Count:1b}
    # オフハンド (Compound(Item)) (オプション)
        data modify storage asset:mob Weapon.Offhand set value {id:"minecraft:tnt",Count:1b}
# 武器ドロップ率 ([float, float]) (オプション)
    data modify storage asset:mob WeaponDropChances set value [0.0f,0.0f]
# 防具
    # 頭 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Head set value {id:"minecraft:tnt",Count:1b}
    # 胴 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Chest set value {id:"minecraft:leather_chestplate",Count:1b,tag:{display:{color:14221312}}}
    # 脚 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Legs set value {id:"minecraft:leather_leggings",Count:1b,tag:{display:{color:14221312}}}
    # 足 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Feet set value {id:"minecraft:leather_boots",Count:1b,tag:{display:{color:14221312}}}
# 防具ドロップ率 ([float, float]) (オプション)
    data modify storage asset:mob ArmorDropChances set value [0.0f,0.0f,0.f,0.0f]
# 体力 (double) (オプション)
    data modify storage asset:mob Health set value 250
# 攻撃力 (double) (オプション)
    data modify storage asset:mob AttackDamage set value 6.0
# 防御力 (double) (オプション) // 被ダメージがある程度大きい場合1ptにつき0.8%カット、小さい場合1ptにつき約4%カット 20pt以上は頭打ち
    data modify storage asset:mob Defense set value 0
# 特殊防御力 (double) (オプション) // 4pointにつきダメージを大きく減らす
    # data modify storage asset:mob SpecialDefense set value
# 移動速度 (double) (オプション)
    data modify storage asset:mob Speed set value 0.28
# 索敵範囲 (double) (オプション)
    data modify storage asset:mob FollowRange set value 20
# ノックバック耐性 (double) (オプション)
    data modify storage asset:mob KnockBackResist set value 0.2
# 属性倍率 // 1.0fで100% 最低でも25%は軽減されずに入る
    # 物理倍率 (float) (オプション)
        data modify storage asset:mob Resist.Physical set value 1.0
    # 魔法倍率 (float) (オプション)
        data modify storage asset:mob Resist.Magic set value 0.5
    # 火倍率 (float) (オプション)
        data modify storage asset:mob Resist.Fire set value 1.0
    # 水倍率 (float) (オプション)
        data modify storage asset:mob Resist.Water set value 0.5
    # 雷倍率 (float) (オプション)
        data modify storage asset:mob Resist.Thunder set value 0.8

# MobInitタグ持ちを対象にして召喚関数呼び出し
    execute as @e[type=zombie,tag=MobInit,distance=..0.01] run function asset:mob/common/summon


text:
#> asset:mob/0060.self_destructor/summon/1.trigger
#
# Mob召喚処理の呼び出し時に実行されるfunction
#
# @within tag/function asset:mob/summon

execute if data storage asset:context {id:60} run function asset:mob/0060.self_destructor/summon/2.summon


text:
#> asset:mob/0060.self_destructor/hurt/2.hurt
#
# Mobの被ダメージ時の処理
#
# @within function asset:mob/0060.self_destructor/hurt/1.trigger

# 演出
   execute unless block ~ ~ ~ water run playsound entity.tnt.primed hostile @a ~ ~ ~ 1 0.7 0
   execute unless block ~ ~ ~ water run particle smoke ~ ~1.8 ~ 0.3 0.25 0.3 0 15 normal @a
   execute unless block ~ ~ ~ water run particle flame ~ ~1.8 ~ 0.3 0.25 0.3 0 5 normal @a

# 自爆カウント
   execute unless block ~ ~ ~ water run scoreboard players add @s 1O.ExplodeCnt 1


text:
#> asset:mob/0060.self_destructor/hurt/1.trigger
#
# Mobの被ダメージに実行されるfunction
#
# @within tag/function asset:mob/hurt

execute if data storage asset:context {id:60} run function asset:mob/0060.self_destructor/hurt/2.hurt


text:
#> asset:mob/0060.self_destructor/attack/1.trigger
#
# Mobの攻撃時に実行されるfunction
#
# @within tag/function asset:mob/attack

execute if data storage asset:context {id:60} run function asset:mob/0060.self_destructor/attack/2.attack


text:
#> asset:mob/0060.self_destructor/attack/2.attack
#
# Mobの攻撃時の処理
#
# @within function asset:mob/0060.self_destructor/attack/1.trigger

# 演出
   execute unless block ~ ~ ~ water run playsound entity.tnt.primed hostile @a ~ ~ ~ 1 0.7 0
   execute unless block ~ ~ ~ water run particle smoke ~ ~1.8 ~ 0.3 0.25 0.3 0 15 normal @a
   execute unless block ~ ~ ~ water run particle flame ~ ~1.8 ~ 0.3 0.25 0.3 0 5 normal @a

# 自爆カウント
   execute unless block ~ ~ ~ water run scoreboard players add @s 1O.ExplodeCnt 2


text:
#> asset:mob/0060.self_destructor/tick/2.tick
#
# Mobのtick時の処理
#
# @within function asset:mob/0060.self_destructor/tick/1.trigger

# 燃えてる場合爆発
     execute if predicate lib:is_burning run scoreboard players set @s 1O.ExplodeFuse 40
# 信号のあるレッドストーンパウダーに触れると爆発
     execute if block ~ ~ ~ redstone_wire unless block ~ ~ ~ redstone_wire[power=0] run scoreboard players set @s 1O.ExplodeFuse 40

# 自爆
  # 爆破待機
     execute if entity @s[scores={1O.ExplodeCnt=5..}] run function asset:mob/0060.self_destructor/tick/3.waiting_explode

  # 演出
     execute if entity @s[scores={1O.ExplodeFuse=1..39}] run particle smoke ~ ~1.2 ~ 0.4 0.5 0.4 0 6 normal @a

   # 爆破
     execute if entity @s[scores={1O.ExplodeFuse=40..}] run function asset:mob/0060.self_destructor/tick/4.self-desruct


text:
#> asset:mob/0060.self_destructor/tick/4.self-desruct
#
#
#
# @within function asset:mob/0060.self_destructor/tick/2.tick

# 演出
    particle explosion ~ ~ ~ 5 5 5 1 140 normal @a
    particle flame ~ ~ ~ 5 5 5 0 140 normal @a
    playsound entity.generic.explode hostile @a[distance=..20] ~ ~ ~ 2 1.2 0
    playsound entity.generic.explode hostile @a[distance=..20] ~ ~ ~ 2 0.6 0

# ダメージ
    execute as @a[tag=!PlayerShouldInvulnerable,distance=..7.5] run function asset:mob/0060.self_destructor/tick/5.damage_distance

# 連鎖爆発
   scoreboard players set @e[type=zombie,scores={MobID=60},distance=..7.5] 1O.ExplodeFuse 36
   scoreboard players set @e[type=zombie,scores={MobID=60},distance=..7.5] 1O.ExplodeCnt 8

  # 消滅
      tp @s ~ -10 ~
      kill @s


text:
#> asset:mob/0060.self_destructor/tick/1.trigger
#
# Mobが生きている間毎tick実行されるfunction
#
# @within tag/function asset:mob/tick

execute if data storage asset:context {id:60} run function asset:mob/0060.self_destructor/tick/2.tick