text:
#> asset:mob/0060.self_destructor/tick/5.damage_distance
#
# ダメージによる距離減衰
#
# @within function asset:mob/0060.self_destructor/tick/4.self-desruct

# 火属性ダメージ
    # 与えるダメージ
        data modify storage lib: Argument.Damage set value 12
    # 第一属性
        data modify storage lib: Argument.AttackType set value "Physical"
    # 第二属性
        data modify storage lib: Argument.ElementType set value "Fire"
    # デスログ
        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}]}]'

# ダメージ量
    execute if entity @s[distance=..7] run data modify storage lib: Argument.Damage set value 12f
    execute if entity @s[distance=..4] run data modify storage lib: Argument.Damage set value 18f
    execute if entity @s[distance=..3] run data modify storage lib: Argument.Damage set value 24f
    execute if entity @s[distance=..2] run data modify storage lib: Argument.Damage set value 28f
    execute if entity @s[distance=..1] run data modify storage lib: Argument.Damage set value 32f

# modifier
    execute as @e[type=zombie,tag=this,distance=..7,limit=1] run function lib:damage/modifier

# ダメージ
    function lib:damage/
# リセット
    function lib:damage/reset


text:
#> asset:mob/0060.self_destructor/tick/3.waiting_explode
#
#
#
# @within function asset:mob/0060.self_destructor/tick/2.tick

# 爆破カウントスコア
    scoreboard players add @s 1O.ExplodeFuse 1

# 爆破待機のバフ
    effect give @s resistance 10 5 true
    effect give @s slowness 10 5 true

repo_name: ProjectTSB/TheSkyBlessing

repo_language: mcfunction

mime_type: text/plain


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

#> 定義類はここに
# @within function asset:mob/0220.vena_cana/**
    scoreboard objectives add 64.DebuffTime dummy


text:
#> asset:mob/0220.vena_cana/rejoin_process
#
# 使い方は必ずwikiを見ること
#
# @within tag/function asset:rejoin

# スケジュールループ再開
    execute if entity @s[tag=64.ElementReduct] run schedule function asset:mob/0220.vena_cana/attack/03.schedule_loop 1t replace


text:
#> asset:mob/0220.vena_cana/_index.d
# @private

#> tag
# @within function asset:mob/0220.vena_cana/**
    #declare tag 64.ElementReduct


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

# 演出
    playsound entity.drowned.death hostile @a ~ ~ ~ 0.8 1.2 0
    particle block warped_wart_block ~ ~1.2 ~ 0.3 0.4 0.3 0 60 normal @a


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

execute if data storage asset:context {id:220} run function asset:mob/0220.vena_cana/death/2.death


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

# 元となるMobを召喚する
    summon zombie ~ ~ ~ {Silent:1b,Tags:["MobInit","AntiBurn","AntiFallDamage"],DeathLootTable:"asset:mob/death/0220.vena_cana"}
# ID (int)
    data modify storage asset:mob ID set value 220
# 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,tag:{Enchantments:[{}]}}
    # 胴 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Chest set value {id:"minecraft:leather_chestplate",Count:1b,tag:{Enchantments:[{}],display:{color:2536876}}}
    # 脚 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Legs set value {id:"minecraft:leather_leggings",Count:1b,tag:{Enchantments:[{}],display:{color:2536876}}}
    # 足 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Feet set value {id:"minecraft:leather_boots",Count:1b,tag:{Enchantments:[{}],display:{color:2536876}}}
# 防具ドロップ率 ([float, float]) (オプション)
    # data modify storage asset:mob ArmorDropChances set value
# 体力 (double) (オプション)
    data modify storage asset:mob Health set value 2200
# 攻撃力 (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 -6
# 特殊防御力 (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 1.0
# 属性倍率 // 1.0fで100% 最低でも25%は軽減されずに入る
    # 物理倍率 (float) (オプション)
        data modify storage asset:mob Resist.Physical set value 0.5
    # 魔法倍率 (float) (オプション)
        data modify storage asset:mob Resist.Magic set value 1.0
    # 火倍率 (float) (オプション)
        data modify storage asset:mob Resist.Fire set value 0.8
    # 水倍率 (float) (オプション)
        data modify storage asset:mob Resist.Water set value 0.75
    # 雷倍率 (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/0220.vena_cana/summon/1.trigger
#
# Mob召喚処理の呼び出し時に実行されるfunction
#
# @within tag/function asset:mob/summon

execute if data storage asset:context {id:220} run function asset:mob/0220.vena_cana/summon/2.summon


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

# 演出
    playsound minecraft:block.conduit.ambient hostile @a ~ ~ ~ 0.7 0.8 0
    particle dust 0.149 0.682 0.741 1 ~ ~1.2 ~ 2 0.4 2 0 150 normal @a

# バフ消し
    effect clear @a[gamemode=!spectator,distance=..5] speed
    effect clear @a[gamemode=!spectator,distance=..5] jump_boost
    effect clear @a[gamemode=!spectator,distance=..5] strength
    effect clear @a[gamemode=!spectator,distance=..5] haste
    effect clear @a[gamemode=!spectator,distance=..5] saturation
    effect clear @a[gamemode=!spectator,distance=..5] regeneration


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

execute if data storage asset:context {id:220} run function asset:mob/0220.vena_cana/hurt/2.hurt


text:
#> asset:mob/0220.vena_cana/attack/03.schedule_loop
#
# スケジュールループをするよ
#
# @within function
#   asset:mob/0220.vena_cana/attack/2.attack
#   asset:mob/0220.vena_cana/attack/03.schedule_loop
#   asset:mob/0220.vena_cana/rejoin_process

# プレイヤー処理
    execute as @a[tag=64.ElementReduct] at @s run function asset:mob/0220.vena_cana/attack/04.player

# スケジュールループ
    execute if entity @a[tag=64.ElementReduct,limit=1] run schedule function asset:mob/0220.vena_cana/attack/03.schedule_loop 1t replace


text:
#> asset:mob/0220.vena_cana/attack/04.player
#
# プレイヤーの処理(演出など)をするよ
#
# @within function asset:mob/0220.vena_cana/attack/03.schedule_loop

# 演出
    particle dust 0.149 0.682 0.741 1 ~ ~1.2 ~ 0.6 0.3 0.6 0 3 normal @a

# 効果時間スコア減少
    scoreboard players remove @s 64.DebuffTime 1

# 死亡で終了
    execute if entity @s[tag=Death] run function asset:mob/0220.vena_cana/attack/05.end_debuff

# 効果時間が0以下で終了の処理
    execute if score @s 64.DebuffTime matches ..0 run function asset:mob/0220.vena_cana/attack/05.end_debuff


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

execute if data storage asset:context {id:220} as @a[tag=Victim,distance=..6] at @s run function asset:mob/0220.vena_cana/attack/2.attack


text:
#> asset:mob/0220.vena_cana/attack/2.attack
#
# Mobの攻撃時の処理 実行者はプレイヤー
#
# @within function asset:mob/0220.vena_cana/attack/1.trigger

# 演出
    playsound minecraft:block.conduit.ambient hostile @a ~ ~ ~ 0.7 0.8 0
    particle dust 0.149 0.682 0.741 1 ~ ~1.2 ~ 0.6 0.3 0.6 0 30 normal @a

# 第一に攻撃対象の全effectをclear
    effect clear @s

# 次にデバフ
    effect give @s slowness 5 1 true
    effect give @s mining_fatigue 5 1 true

# ダメージ
    data modify storage lib: Argument.Damage set value 37f
    data modify storage lib: Argument.AttackType set value "Physical"
# 補正functionを実行
    execute as @e[type=zombie,tag=this,distance=..6,sort=nearest,limit=1] run function lib:damage/modifier
# 対象
    function lib:damage/
# リセット
    function lib:damage/reset

# 最後に属性攻撃力半減
    # 引数の設定
    # UUID
        data modify storage api: Argument.UUID set value [I;1,2,220,0]
    # 補正値
        data modify storage api: Argument.Amount set value -0.5
    # 補正方法
        data modify storage api: Argument.Operation set value "multiply"
# 補正の追加
    function api:modifier/attack/base/add

# タグを付与
    tag @s[tag=!64.ElementReduct] add 64.ElementReduct

# 効果時間を設定
    scoreboard players set @s 64.DebuffTime 100

# スケジュールループ開始
    schedule function asset:mob/0220.vena_cana/attack/03.schedule_loop 1t replace


text:
#> asset:mob/0220.vena_cana/attack/05.end_debuff
#
# デバフの終了処理を行うよ
#
# @within function asset:mob/0220.vena_cana/attack/04.player

# UUID
    data modify storage api: Argument.UUID set value [I;1,2,220,0]

# 補正の削除
    function api:modifier/attack/base/remove

# タグ削除
    tag @s remove 64.ElementReduct

# スコアリセット
    scoreboard players reset @s 64.DebuffTime


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

# 元となるMobを召喚する
    summon vex ~ ~ ~ {Tags:["MobInit"],DeathLootTable:"asset:mob/death/0007.ectoplasm"}
# ID (int)
    data modify storage asset:mob ID set value 7
# 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_aqua","underlined":true}'
# 武器
    # メインハンド (Compound(Item)) (オプション)
        data modify storage asset:mob Weapon.Mainhand set value {}
    # オフハンド (Compound(Item)) (オプション)
        data modify storage asset:mob Weapon.Offhand set value {}
# 防具
    # 頭 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Head set value {id:"minecraft:sea_lantern",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 {}
# 体力 (double) (オプション)
    data modify storage asset:mob Health set value 60
# 攻撃力 (double) (オプション)
    data modify storage asset:mob AttackDamage set value 2
# 防御力 (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 20
# ノックバック耐性 (double) (オプション)
    data modify storage asset:mob KnockBackResist set value 0
# 属性倍率 // 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=vex,tag=MobInit,distance=..0.01] run function asset:mob/common/summon


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

execute if data storage asset:context {id:7} run function asset:mob/0007.ectoplasm/summon/2.summon


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

execute if data storage asset:context {id:7} run function asset:mob/0007.ectoplasm/attack/2.attack


text:
#> asset:mob/0007.ectoplasm/attack/2.attack
#
# Mobの攻撃時の処理
#
# @within function asset:mob/0007.ectoplasm/attack/1.trigger
#> private
# @private
    #declare score_holder $EctoplasmMPCheck
    #declare tag EmptyMP

# プレイヤーのマナを検知する
    execute as @p[tag=Victim] store result score $EctoplasmMPCheck Temporary run function lib:mp/get
    execute if score $EctoplasmMPCheck Temporary matches ..15 run tag @p[tag=Victim] add EmptyMP

# マナが無いプレイヤーを殴った時
    # ダメージ設定
        data modify storage lib: Argument.Damage set value 7.5f
        data modify storage lib: Argument.AttackType set value "Magic"
        data modify storage lib: Argument.ElementType set value "None"
    # ダメージを与える
        function lib:damage/modifier
        execute as @p[tag=EmptyMP] run function lib:damage/
        function lib:damage/reset
    # 演出
        execute as @p[tag=EmptyMP] at @s run playsound entity.puffer_fish.hurt hostile @a ~ ~ ~ 1 0
        execute as @p[tag=EmptyMP] at @s run particle soul ~ ~1 ~ 0 0 0 0.1 10

# マナを吸い取る
    scoreboard players set $Fluctuation Lib -15
    execute as @p[tag=Victim] run function lib:mp/fluctuation

# タグリセット
    tag @p[tag=EmptyMP] remove EmptyMP
    scoreboard players reset $EctoplasmMPCheck


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

#> Objective
# @within asset:mob/0021.demon_eye/**
    scoreboard objectives add L.Rot dummy
    scoreboard objectives add L.LifeTime dummy
    scoreboard objectives add L.AttackCT dummy


text:
#> asset:mob/0021.demon_eye/_index.d
# @private

#> tags
# @within function asset:mob/0021.demon_eye/**
    #declare tag 21.Rotater
    #declare score_holder $L.RotX
    #declare score_holder $L.RotY
    #declare score_holder $L.AngleX
    #declare score_holder $L.AngleY


text:
#> asset:mob/0021.demon_eye/death/2.death
#
# Mobの死亡時の処理
#
# @within function asset:mob/0021.demon_eye/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
    particle block redstone_wire ~ ~1.68 ~ 0 0 0 0 25


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

execute if data storage asset:context {id:21} run function asset:mob/0021.demon_eye/death/2.death


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

# 元となるMobを召喚する
    summon zombie ~ ~ ~ {Silent:1b,DeathLootTable:"asset:mob/death/0021.demon_eye",Tags:["MobInit","Enemy","AlwaysInvisible","AlwaysSlowFall"],Passengers:[{id:"minecraft:area_effect_cloud",Duration:-1,Age:-2147483648,WaitTime:-2147483648,Tags:["21.Rotater","AutoKillWhenDieVehicle","AssetMob"]}]}
# ID (int)
    data modify storage asset:mob ID set value 21
# 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","italic":false}'
# 武器
    # メインハンド (Compound(Item)) (オプション)
        data modify storage asset:mob Weapon.Mainhand set value {}
    # オフハンド (Compound(Item)) (オプション)
        data modify storage asset:mob Weapon.Offhand set value {}
# 防具
    # 頭 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Head set value {id:"minecraft:player_head",Count:1b,tag:{SkullOwner:{Id:[I;-2096771334,1747471520,-1307822589,862786690],Properties:{textures:[{Value:"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNGVhZDg5NDNhMDkyMWY4MWEwYWE5NWZlOWRlYTA5MTE3MjI4OGMyMjMwNzVjOGJlOTI5ZGVmMWVhNzdjNzQ1YyJ9fX0="}]}}}}
    # 胴 (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 {}
# 体力 (double) (オプション)
    data modify storage asset:mob Health set value 125
# 攻撃力 (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

# この世界に存在できる時間
    scoreboard players set @e[type=zombie,tag=MobInit,distance=..0.01] L.LifeTime 800
# MobInitタグ持ちを対象にして召喚関数呼び出し
    execute as @e[type=zombie,tag=MobInit,distance=..0.01] run function asset:mob/common/summon


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

execute if data storage asset:context {id:21} run function asset:mob/0021.demon_eye/summon/2.summon


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

playsound minecraft:entity.spider.step hostile @a ~ ~ ~ 1.5 1.5
playsound minecraft:block.wart_block.break hostile @a ~ ~ ~ 1.5 1
particle block redstone_wire ~ ~1.68 ~ 0 0 0 0 25


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

execute if data storage asset:context {id:21} run function asset:mob/0021.demon_eye/hurt/2.hurt


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

# パーティクル
    particle dust 0.5 0 0 1 ~ ~1.68 ~ 0.25 0.25 0.25 0 2 force @a[distance=..40]

# 範囲内ならホーミングじみた移動、ただしダメージを受けていないなら
    execute at @s anchored eyes as @e[type=area_effect_cloud,tag=21.Rotater,sort=nearest,limit=1] run function asset:mob/0021.demon_eye/tick/rotater_tick

# 速さ
    data modify storage lib: Argument.VectorMagnitude set value 0.15

# 飛ぶのに使う
    execute if data entity @s {HurtTime:0s} at @s anchored eyes rotated as @e[type=area_effect_cloud,tag=21.Rotater,sort=nearest,limit=1] run function lib:motion/
    data remove storage lib: Argument
# 向き
    data modify entity @s Rotation set from storage asset:temp Rotation
    data remove storage asset:temp Rotation

# 接地で上を向く
    execute if data entity @s {OnGround:1b} positioned ~ ~1.5 ~ as @e[type=area_effect_cloud,tag=21.Rotater,sort=nearest,limit=1] at @s run tp @s ~ ~ ~ ~ ~-35

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

# クールタイム中じゃないなら接触時に攻撃
    execute unless score @s L.AttackCT matches 1.. positioned ~-0.5 ~-0.5 ~-0.5 if entity @p[tag=!PlayerShouldInvulnerable,dx=0] run function asset:mob/0021.demon_eye/tick/event/attack

# カベにぶつかった際の処理
    execute unless block ^ ^ ^0.5 #lib:no_collision as @e[type=area_effect_cloud,tag=21.Rotater,sort=nearest,limit=1] run tp @s ~ ~ ~ ~45 ~-45

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


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

execute if data storage asset:context {id:21} run function asset:mob/0021.demon_eye/tick/2.tick


text:
#> asset:mob/0021.demon_eye/tick/rotater_tick
#
# 頭の上に乗っかってるやつが使用
#
# @within function asset:mob/0021.demon_eye/tick/2.tick

# いろは丸様のホーミング機構を使用させていただきました。

# Rotation取得
    data modify storage asset:temp Rotation set from entity @s Rotation
# ホーミング
    execute store result score $L.RotX L.Rot run data get storage asset:temp Rotation[0] 1000
    execute store result score $L.RotY L.Rot run data get storage asset:temp Rotation[1] 1000

# 回転角度取得
    scoreboard players set $L.AngleX L.Rot 0
    scoreboard players set $L.AngleY L.Rot 0

# X軸の振り向き速度
    scoreboard players add $L.AngleX L.Rot 1500

# Y軸の振り向き速度
    scoreboard players add $L.AngleY L.Rot 3000

# 回転角度加算
    execute rotated as @s positioned as @a[distance=..100] positioned ^-100 ^ ^ positioned as @s[distance=..100] run scoreboard players operation $L.RotX L.Rot -= $L.AngleY L.Rot
    execute rotated as @s positioned as @a[distance=..100] positioned ^100 ^ ^ positioned as @s[distance=..100] run scoreboard players operation $L.RotX L.Rot += $L.AngleY L.Rot
    execute rotated as @s positioned as @a[distance=..100] positioned ^ ^-100 ^ positioned as @s[distance=..100] run scoreboard players operation $L.RotY L.Rot -= $L.AngleX L.Rot
    execute rotated as @s positioned as @a[distance=..100] positioned ^ ^100 ^ positioned as @s[distance=..100] run scoreboard players operation $L.RotY L.Rot += $L.AngleX L.Rot

# セット
    execute store result storage asset:temp Rotation[0] float 0.001 run scoreboard players get $L.RotX L.Rot
    execute store result storage asset:temp Rotation[1] float 0.001 run scoreboard players get $L.RotY L.Rot
    data modify entity @s Rotation set from storage asset:temp Rotation


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

# VFX
    playsound minecraft:block.wart_block.break hostile @a ~ ~ ~ 2 1

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

# 補正実行
    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 L.AttackCT 20


text:
#> asset:mob/0021.demon_eye/tick/event/suicide
#
# 自滅する
#
# @within function asset:mob/0021.demon_eye/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/0255.dependence_eye/0.load
#
# MOBに利用するスコアボード等の初期化処理
#
# @within tag/function asset:mob/load

#> 定義類はここに
# @within function asset:mob/0255.dependence_eye/**
    scoreboard objectives add 73.AttackCT dummy


text:
#> asset:mob/0255.dependence_eye/death/2.death
#
# Mobの死亡時の処理
#
# @within function asset:mob/0255.dependence_eye/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
    particle block redstone_wire ~ ~1.68 ~ 0 0 0 0 25


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

execute if data storage asset:context {id:255} run function asset:mob/0255.dependence_eye/death/2.death


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

# 元となるMobを召喚する
    summon zombie ~ ~ ~ {Silent:1b,NoAI:1b,DeathLootTable:"asset:mob/death/0255.dependence_eye",Tags:["MobInit","Enemy","AlwaysInvisible"]}
# ID (int)
    data modify storage asset:mob ID set value 255
# 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":"#531E57","italic":true}'
# 武器
    # メインハンド (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:stick",Count:1b,tag:{CustomModelData:20142}}
    # 胴 (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 100
# 攻撃力 (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
# 特殊防御力 (double) (オプション) // 4pointにつきダメージを大きく減らす
    # data modify storage asset:mob SpecialDefense set value
# 移動速度 (double) (オプション)
    data modify storage asset:mob Speed set value 0
# 索敵範囲 (double) (オプション)
     data modify storage asset:mob FollowRange set value 0
# ノックバック耐性 (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=zombie,tag=MobInit,distance=..0.01] run function asset:mob/common/summon


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

execute if data storage asset:context {id:255} run function asset:mob/0255.dependence_eye/summon/2.summon


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

# だいたいデーモンアイからコピー。幾何学つかって多少簡略化
# パーティクル
    particle dust 0.5 0 0 1 ~ ~1.68 ~ 0.25 0.25 0.25 0 2 force @a[distance=..40]

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

# 範囲内ならホーミングじみた移動、ただしダメージを受けていないなら
    execute facing entity @p eyes positioned ^ ^ ^-100 rotated as @s positioned ^ ^ ^-800 facing entity @s eyes positioned as @s run tp @s ^ ^ ^0.25 ~ ~

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

# クールタイム中じゃないなら接触時に攻撃
    execute unless score @s 73.AttackCT matches 1.. positioned ~-0.5 ~-0.5 ~-0.5 if entity @p[tag=!PlayerShouldInvulnerable,dx=0] run function asset:mob/0255.dependence_eye/tick/3.attack

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


text:
#> asset:mob/0255.dependence_eye/tick/3.attack
#
#
#
# @within function asset:mob/0255.dependence_eye/tick/2.tick

# VFX
    playsound minecraft:block.wart_block.break hostile @a ~ ~ ~ 2 1

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

# 補正実行
    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 73.AttackCT 20


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

execute if data storage asset:context {id:255} run function asset:mob/0255.dependence_eye/tick/2.tick


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

# 元となるMobを召喚する
    summon skeleton ~ ~ ~ {Tags:["MobInit"],DeathLootTable:"empty"}
# ID (int)
    data modify storage asset:mob ID set value 10011
# 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":"天使サンドバッグ2"}'
# 武器
    # メインハンド (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 7700
# 攻撃力 (double) (オプション)
    data modify storage asset:mob AttackDamage set value 17
# 防御力 (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 10
# 移動速度 (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/0047.the_heretic/_index.d
# @private

#> tag
# @within function asset:mob/0047.the_heretic/**
    #declare tag 1B.First


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

# 演出
 particle minecraft:poof ~ ~1 ~ 0 0 0 0.3 50
 playsound minecraft:entity.wither.hurt hostile @a ~ ~ ~ 1 1.4


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

execute if data storage asset:context {id:47} run function asset:mob/0047.the_heretic/death/2.death


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

# 元となるMobを召喚する
    summon skeleton ~ ~ ~ {Tags:["MobInit","1B.First"],DeathLootTable:"asset:mob/death/0047.the_heretic"}
# ID (int)
    data modify storage asset:mob ID set value 47
# 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"}'
# 武器
    # メインハンド (Compound(Item)) (オプション)
        data modify storage asset:mob Weapon.Mainhand set value {id:"minecraft:bow",Count:1b,tag:{display:{Name:'{"text":"異端の弓","color":"dark_purple","underlined":true}'}}}
    # オフハンド (Compound(Item)) (オプション)
        # data modify storage asset:mob Weapon.Offhand set value
# 防具
    # 頭 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Head set value {id:"minecraft:lodestone",Count:1b}
    # 胴 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Chest set value {id:"minecraft:leather_chestplate",Count:1b,tag:{display:{color:7039851}}}
    # 脚 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Legs set value {id:"minecraft:leather_leggings",Count:1b,tag:{display:{color:7039851}}}
    # 足 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Feet set value {id:"minecraft:leather_boots",Count:1b,tag:{display:{color:7039851}}}
# 体力 (double) (オプション)
    data modify storage asset:mob Health set value 1000
# 攻撃力 (double) (オプション)
    data modify storage asset:mob AttackDamage set value 4
# 防御力 (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.3
# 索敵範囲 (double) (オプション)
    data modify storage asset:mob FollowRange set value 32
# ノックバック耐性 (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 0.3
    # 魔法倍率 (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=skeleton,tag=MobInit,distance=..0.01] run function asset:mob/common/summon


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

execute if data storage asset:context {id:47} run function asset:mob/0047.the_heretic/summon/2.summon


text:
#> asset:mob/0047.the_heretic/attack/2.2.attack2
#
# 二回目以降の攻撃
#
# @within function asset:mob/0047.the_heretic/attack/2.attack

# 演出
    execute as @p[tag=Victim] at @s run particle dragon_breath ~ ~ ~ 0 1 0 0 20
    execute as @p[tag=Victim] at @s run particle witch ~ ~ ~ 0 1 0 0 20
    playsound entity.phantom.bite hostile @a ~ ~ ~ 1 0

# 何故かこうするとプレイヤーと同じ剣の降り方をする
    item replace entity @s weapon with stick{CustomModelData:219}

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


text:
#> asset:mob/0047.the_heretic/attack/2.1.first_attack
#
# 1度だけ発動する攻撃
#
# @within function asset:mob/0047.the_heretic/attack/2.attack

# テレポートする
    execute at @e[type=#lib:living,tag=Victim] rotated ~ -10 positioned ^ ^ ^3 facing entity @e[type=#lib:living,tag=Victim] eyes run tp @s ~ ~ ~

# 演出
    particle dragon_breath ~ ~1 ~ 0.5 0.5 0.5 0 100 force
    playsound entity.enderman.teleport hostile @a ~ ~ ~ 1 1

# 装備変更
    item replace entity @s weapon with stick{CustomModelData:219}

# 移動する
    data modify storage lib: Argument.VectorMagnitude set value 1.5
    execute facing entity @e[type=#lib:living,tag=Victim] feet run function lib:motion/
    data remove storage lib: Argument
# タグを消す
    tag @s remove 1B.First


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

execute if data storage asset:context {id:47} run function asset:mob/0047.the_heretic/attack/2.attack


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

# 二回目以降の攻撃
    execute unless entity @s[tag=1B.First] run function asset:mob/0047.the_heretic/attack/2.2.attack2

# 最初の攻撃
    execute if entity @s[tag=1B.First] run function asset:mob/0047.the_heretic/attack/2.1.first_attack


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

#> 定義類はここに
# @within function asset:mob/0182.skull_raven/**
    scoreboard objectives add 52.Tick dummy


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

# 元となるMobを召喚する
    summon wither_skeleton ~ ~ ~ {Tags:["MobInit","AlwaysSlowFall"],NoGravity:1b,DeathLootTable:"asset:mob/death/0182.skull_raven"}
# ID (int)
    data modify storage asset:mob ID set value 182
# 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_gray"}'
# 武器
    # メインハンド (Compound(Item)) (オプション)
        data modify storage asset:mob Weapon.Mainhand set value {id:"bow",Count:1b,tag:{Enchantments:[{id:"punch",lvl:1}]}}
    # オフハンド (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 {id:"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 800
# 攻撃力 (double) (オプション)
    # data modify storage asset:mob AttackDamage set value
# 防御力 (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.3
# 索敵範囲 (double) (オプション)
    data modify storage asset:mob FollowRange set value 32
# ノックバック耐性 (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 0.5
    # 水倍率 (float) (オプション)
        # data modify storage asset:mob Resist.Water set value 1
    # 雷倍率 (float) (オプション)
        # data modify storage asset:mob Resist.Thunder set value
# MobInitタグ持ちを対象にして召喚関数呼び出し
    execute as @e[type=wither_skeleton,tag=MobInit,distance=..0.01] run function asset:mob/common/summon


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

execute if data storage asset:context {id:182} run function asset:mob/0182.skull_raven/summon/2.summon


text:
#> asset:mob/0182.skull_raven/hurt/knockback
#
#
#
# @within function asset:mob/0182.skull_raven/hurt/2.hurt

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

# 浮遊を自分に付与
    effect give @s levitation 1 8 true

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

# リセット
    data remove storage lib: Argument


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

# ハードかつ30%の確率でプレイヤーから離れる
    execute if predicate api:global_vars/difficulty/min/hard if predicate lib:random_pass_per/30 run function asset:mob/0182.skull_raven/hurt/knockback


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

execute if data storage asset:context {id:182} run function asset:mob/0182.skull_raven/hurt/2.hurt


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

execute if data storage asset:context {id:182} run function asset:mob/0182.skull_raven/attack/2.attack


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

# 演出
   execute at @p[tag=Victim,distance=..60] run particle minecraft:lava ~ ~0.5 ~ 0.8 0.8 0.8 0.1 20 normal @p
   execute at @p[tag=Victim,distance=..60] run playsound minecraft:entity.blaze.shoot hostile @a ~ ~ ~ 0.8 0.8 0

# ハードなら打ち上げ
    execute if predicate api:global_vars/difficulty/min/hard at @p[tag=Victim,distance=..60] run summon area_effect_cloud ~ ~ ~ {Particle:"cloud",Radius:0.5f,Duration:6,Age:4,Effects:[{Id:25,Amplifier:20b,Duration:5,ShowParticles:1b}]}

# 引数の設定
    # 与えるダメージ
        data modify storage lib: Argument.Damage set value 16.0d
    # 第一属性
        data modify storage lib: Argument.AttackType set value "Physical"
    # 第二属性
        data modify storage lib: Argument.ElementType set value "Fire"
# デスログ
    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=..60] run function lib:damage/
# リセット
    function lib:damage/reset


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

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

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


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

execute if data storage asset:context {id:182} run function asset:mob/0182.skull_raven/tick/2.tick


text:
#> asset:mob/0182.skull_raven/tick/3.motion
#
#
#
# @within function asset:mob/0182.skull_raven/tick/2.tick

#> private
# @private
    #declare tag Target

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

# 数値
    # デフォルト
        data modify storage lib: Argument.VectorMagnitude set value 1.2
    # かなり離れてる時に実行
        execute if entity @p[tag=Target,distance=30..60] run data modify storage lib: Argument.VectorMagnitude set value 1.8
    # 近い時に実行する
        execute if entity @p[tag=Target,distance=..9] run data modify storage lib: Argument.VectorMagnitude set value 0.9
# 実行
    # 適正距離の場合
        execute if entity @p[tag=Target,distance=9..60] facing entity @p eyes rotated ~ ~-5 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 52.Tick


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

#> 定義類はここに
# @within function asset:mob/0233.honey_flyer/**
    scoreboard objectives add 6H.Tick dummy


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

# 元となるMobを召喚する
    summon skeleton ~ ~ ~ {Silent:1b,NoGravity:1b,Tags:["MobInit","AlwaysInvisible","AlwaysSlowFall"],DeathLootTable:"asset:mob/death/0233.honey_flyer"}
# ID (int)
    data modify storage asset:mob ID set value 233
# 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":"#FFBD24"}'
# 武器
    # メインハンド (Compound(Item)) (オプション)
        data modify storage asset:mob Weapon.Mainhand set value {id:"bow",Count:1b,tag:{CustomModelData:20186}}
    # オフハンド (Compound(Item)) (オプション)
        data modify storage asset:mob Weapon.Offhand set value {id:"minecraft:tipped_arrow",Count:1b,tag:{CustomPotionColor:16760100}}
# 武器ドロップ率 ([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:"honey_block",Count:1b}
    # 胴 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Chest set value {id:"minecraft:leather_chestplate",Count:1b,tag:{display:{color:16760100}}}
    # 脚 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Legs set value {id:"minecraft:leather_leggings",Count:1b,tag:{display:{color:0}}}
    # 足 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Feet set value {id:"minecraft:leather_boots",Count:1b,tag:{display:{color:16760100}}}
# 防具ドロップ率 ([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 2000
# 攻撃力 (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 0.8
    # 魔法倍率 (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 0.5
    # 雷倍率 (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/0233.honey_flyer/summon/1.trigger
#
# Mob召喚処理の呼び出し時に実行されるfunction
#
# @within tag/function asset:mob/summon

execute if data storage asset:context {id:233} run function asset:mob/0233.honey_flyer/summon/2.summon


text:
#> asset:mob/0233.honey_flyer/wing_vfx/left
#
# 翅の左側
#
# @within function asset:mob/0233.honey_flyer/wing_vfx/

# 左翅内
    particle dust 1 0.702 0 1 ^-0.15 ^ ^0 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-0.15 ^ ^0.1 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-0.15 ^ ^0.2 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-0.15 ^ ^0.3 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-0.15 ^ ^0.4 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-0.15 ^ ^0.5 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-0.15 ^ ^0.6 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-0.15 ^ ^0.7 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-0.15 ^ ^0.8 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-0.15 ^ ^0.9 0 0 0 0 1

# 左翅上
    particle dust 1 0.702 0 1 ^-0.15 ^ ^0 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-0.25567 ^ ^-0.13128 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-0.36748 ^ ^-0.24721 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-0.48543 ^ ^-0.3478 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-0.60951 ^ ^-0.43304 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-0.73974 ^ ^-0.50293 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-0.8761 ^ ^-0.55747 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-1.0186 ^ ^-0.59667 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-1.16724 ^ ^-0.62052 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-1.32202 ^ ^-0.62903 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-1.48294 ^ ^-0.62219 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-1.65 ^ ^-0.6 0 0 0 0 1

# 左翅外
    particle dust 1 0.702 0 1 ^-1.71 ^ ^-0.48 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-1.71724 ^ ^-0.33428 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-1.71639 ^ ^-0.1884 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-1.70674 ^ ^-0.04283 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-1.68783 ^ ^0.10183 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-1.65952 ^ ^0.24494 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-1.62152 ^ ^0.38578 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-1.57396 ^ ^0.52369 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-1.51708 ^ ^0.65803 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-1.45116 ^ ^0.78817 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-1.37689 ^ ^0.91373 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-1.29476 ^ ^1.03431 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-1.20551 ^ ^1.14971 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-1.11 ^ ^1.26 0 0 0 0 1

# 左翅下
    particle dust 1 0.702 0 1 ^-0.18 ^ ^1.02 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-0.20657 ^ ^1.21242 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-0.25992 ^ ^1.39894 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-0.36318 ^ ^1.56135 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-0.53786 ^ ^1.63363 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-0.72569 ^ ^1.59168 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-0.89524 ^ ^1.49739 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-1.05 ^ ^1.38 0 0 0 0 1

# 左内線上
    particle dust 1 0.702 0 1 ^-0.3 ^ ^0 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-0.4444 ^ ^0.12583 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-0.59876 ^ ^0.23911 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-0.76813 ^ ^0.32765 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-0.95424 ^ ^0.36468 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-1.12774 ^ ^0.29527 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-1.23698 ^ ^0.14011 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-1.29856 ^ ^-0.04081 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-1.33221 ^ ^-0.22929 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-1.35 ^ ^-0.42 0 0 0 0 1

# 左内線下
    particle dust 1 0.702 0 1 ^-0.375 ^ ^1.05 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-0.46633 ^ ^0.96267 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-0.56191 ^ ^0.88426 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-0.66174 ^ ^0.81477 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-0.76582 ^ ^0.75419 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-0.87415 ^ ^0.70252 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-0.98674 ^ ^0.65977 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-1.10357 ^ ^0.62593 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-1.22466 ^ ^0.60101 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-1.35 ^ ^0.585 0 0 0 0 1

# 左内接続線
    particle dust 1 0.702 0 1 ^-0.75 ^ ^0.24 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-0.81667 ^ ^0.36 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-0.88333 ^ ^0.48 0 0 0 0 1
    particle dust 1 0.702 0 1 ^-0.95 ^ ^0.6 0 0 0 0 1


text:
#> asset:mob/0233.honey_flyer/wing_vfx/right
#
# 翅の右側
#
# @within function asset:mob/0233.honey_flyer/wing_vfx/

# 右翅内
    particle dust 1 0.702 0 1 ^0.15 ^ ^0 0 0 0 0 1
    particle dust 1 0.702 0 1 ^0.15 ^ ^0.1 0 0 0 0 1
    particle dust 1 0.702 0 1 ^0.15 ^ ^0.2 0 0 0 0 1
    particle dust 1 0.702 0 1 ^0.15 ^ ^0.3 0 0 0 0 1
    particle dust 1 0.702 0 1 ^0.15 ^ ^0.4 0 0 0 0 1
    particle dust 1 0.702 0 1 ^0.15 ^ ^0.5 0 0 0 0 1
    particle dust 1 0.702 0 1 ^0.15 ^ ^0.6 0 0 0 0 1
    particle dust 1 0.702 0 1 ^0.15 ^ ^0.7 0 0 0 0 1
    particle dust 1 0.702 0 1 ^0.15 ^ ^0.8 0 0 0 0 1
    particle dust 1 0.702 0 1 ^0.15 ^ ^0.9 0 0 0 0 1
# 右翅上
    particle dust 1 0.702 0 1 ^0.15 ^ ^0 0 0 0 0 1
    particle dust 1 0.702 0 1 ^0.25567 ^ ^-0.13128 0 0 0 0 1
    particle dust 1 0.702 0 1 ^0.36748 ^ ^-0.24721 0 0 0 0 1
    particle dust 1 0.702 0 1 ^0.48543 ^ ^-0.3478 0 0 0 0 1
    particle dust 1 0.702 0 1 ^0.60951 ^ ^-0.43304 0 0 0 0 1
    particle dust 1 0.702 0 1 ^0.73974 ^ ^-0.50293 0 0 0 0 1
    particle dust 1 0.702 0 1 ^0.8761 ^ ^-0.55747 0 0 0 0 1
    particle dust 1 0.702 0 1 ^1.0186 ^ ^-0.59667 0 0 0 0 1
    particle dust 1 0.702 0 1 ^1.16724 ^ ^-0.62052 0 0 0 0 1
    particle dust 1 0.702 0 1 ^1.32202 ^ ^-0.62903 0 0 0 0 1
    particle dust 1 0.702 0 1 ^1.48294 ^ ^-0.62219 0 0 0 0 1
    particle dust 1 0.702 0 1 ^1.65 ^ ^-0.6 0 0 0 0 1
# 右翅外
    particle dust 1 0.702 0 1 ^1.71 ^ ^-0.48 0 0 0 0 1
    particle dust 1 0.702 0 1 ^1.71724 ^ ^-0.33428 0 0 0 0 1
    particle dust 1 0.702 0 1 ^1.71639 ^ ^-0.1884 0 0 0 0 1
    particle dust 1 0.702 0 1 ^1.70674 ^ ^-0.04283 0 0 0 0 1
    particle dust 1 0.702 0 1 ^1.68783 ^ ^0.10183 0 0 0 0 1
    particle dust 1 0.702 0 1 ^1.65952 ^ ^0.24494 0 0 0 0 1
    particle dust 1 0.702 0 1 ^1.62152 ^ ^0.38578 0 0 0 0 1
    particle dust 1 0.702 0 1 ^1.57396 ^ ^0.52369 0 0 0 0 1
    particle dust 1 0.702 0 1 ^1.51708 ^ ^0.65803 0 0 0 0 1
    particle dust 1 0.702 0 1 ^1.45116 ^ ^0.78817 0 0 0 0 1
    particle dust 1 0.702 0 1 ^1.37689 ^ ^0.91373 0 0 0 0 1
    particle dust 1 0.702 0 1 ^1.29476 ^ ^1.03431 0 0 0 0 1
    particle dust 1 0.702 0 1 ^1.20551 ^ ^1.14971 0 0 0 0 1
    particle dust 1 0.702 0 1 ^1.11 ^ ^1.26 0 0 0 0 1
# 右翅下
    particle dust 1 0.702 0 1 ^0.18 ^ ^1.02 0 0 0 0 1
    particle dust 1 0.702 0 1 ^0.20657 ^ ^1.21242 0 0 0 0 1
    particle dust 1 0.702 0 1 ^0.25992 ^ ^1.39894 0 0 0 0 1
    particle dust 1 0.702 0 1 ^0.36318 ^ ^1.56135 0 0 0 0 1
    particle dust 1 0.702 0 1 ^0.53786 ^ ^1.63363 0 0 0 0 1
    particle dust 1 0.702 0 1 ^0.72569 ^ ^1.59168 0 0 0 0 1
    particle dust 1 0.702 0 1 ^0.89524 ^ ^1.49739 0 0 0 0 1
    particle dust 1 0.702 0 1 ^1.05 ^ ^1.38 0 0 0 0 1
# 右内線上
    particle dust 1 0.702 0 1 ^0.3 ^ ^0 0 0 0 0 1
    particle dust 1 0.702 0 1 ^0.4444 ^ ^0.12583 0 0 0 0 1
    particle dust 1 0.702 0 1 ^0.59876 ^ ^0.23911 0 0 0 0 1
    particle dust 1 0.702 0 1 ^0.76813 ^ ^0.32765 0 0 0 0 1
    particle dust 1 0.702 0 1 ^0.95424 ^ ^0.36468 0 0 0 0 1
    particle dust 1 0.702 0 1 ^1.12774 ^ ^0.29527 0 0 0 0 1
    particle dust 1 0.702 0 1 ^1.23698 ^ ^0.14011 0 0 0 0 1
    particle dust 1 0.702 0 1 ^1.29856 ^ ^-0.04081 0 0 0 0 1
    particle dust 1 0.702 0 1 ^1.33221 ^ ^-0.22929 0 0 0 0 1
    particle dust 1 0.702 0 1 ^1.35 ^ ^-0.42 0 0 0 0 1
# 右内線下
    particle dust 1 0.702 0 1 ^0.375 ^ ^1.05 0 0 0 0 1
    particle dust 1 0.702 0 1 ^0.46633 ^ ^0.96267 0 0 0 0 1
    particle dust 1 0.702 0 1 ^0.56191 ^ ^0.88426 0 0 0 0 1
    particle dust 1 0.702 0 1 ^0.66174 ^ ^0.81477 0 0 0 0 1
    particle dust 1 0.702 0 1 ^0.76582 ^ ^0.75419 0 0 0 0 1
    particle dust 1 0.702 0 1 ^0.87415 ^ ^0.70252 0 0 0 0 1
    particle dust 1 0.702 0 1 ^0.98674 ^ ^0.65977 0 0 0 0 1
    particle dust 1 0.702 0 1 ^1.10357 ^ ^0.62593 0 0 0 0 1
    particle dust 1 0.702 0 1 ^1.22466 ^ ^0.60101 0 0 0 0 1
    particle dust 1 0.702 0 1 ^1.35 ^ ^0.585 0 0 0 0 1
# 右内接続線
    particle dust 1 0.702 0 1 ^0.75 ^ ^0.24 0 0 0 0 1
    particle dust 1 0.702 0 1 ^0.81667 ^ ^0.36 0 0 0 0 1
    particle dust 1 0.702 0 1 ^0.88333 ^ ^0.48 0 0 0 0 1
    particle dust 1 0.702 0 1 ^0.95 ^ ^0.6 0 0 0 0 1


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

# 演出
    playsound block.honey_block.hit hostile @a ~ ~ ~ 0.6 1 0
    particle minecraft:block honey_block ~ ~1.2 ~ 0.4 0.4 0.4 0 20
    particle dust 1.000 0.741 0.141 1.3 ~ ~1.2 ~ 0.5 0.4 0.5 0 20 normal
    function asset:mob/0233.honey_flyer/wing_vfx/


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

execute if data storage asset:context {id:233} run function asset:mob/0233.honey_flyer/hurt/2.hurt


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

execute if data storage asset:context {id:233} run function asset:mob/0233.honey_flyer/attack/2.attack


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

# 演出
    execute at @p[tag=Victim,distance=..32] run particle falling_honey ~ ~1.2 ~ 0.4 0.4 0.4 0 30 normal @a
    execute at @p[tag=Victim,distance=..32] run particle dust 1.000 0.741 0.141 1.3 ~ ~1.2 ~ 0.5 0.4 0.5 0 20 normal
    execute at @p[tag=Victim,distance=..32] run playsound minecraft:block.honey_block.place hostile @a ~ ~ ~ 0.7 1 0

# デバフ
    effect give @p[tag=Victim,distance=..32] mining_fatigue 3 1 true
    effect give @p[tag=Victim,distance=..32] poison 3 1 true
    effect give @p[tag=Victim,distance=..32] slow_falling 3 1 true

# 与えるダメージ
    data modify storage lib: Argument.Damage set value 28f
# 属性
    data modify storage lib: Argument.AttackType set value "Magic"
    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/0233.honey_flyer/tick/2.tick
#
# Mobのtick時の処理
#
# @within function asset:mob/0233.honey_flyer/tick/1.trigger

# スコア付与
    scoreboard players add @s 6H.Tick 1

# 周囲にプレイヤーがいる時、90tickに一度実行する
    execute if score @s 6H.Tick matches 90.. if entity @a[gamemode=!spectator,distance=..40] run function asset:mob/0233.honey_flyer/tick/3.motion


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

execute if data storage asset:context {id:233} run function asset:mob/0233.honey_flyer/tick/2.tick


text:
#> asset:mob/0233.honey_flyer/tick/3.motion
#
#
#
# @within function asset:mob/0233.honey_flyer/tick/2.tick

#> Private
# @private
    #declare tag Target

# 翅演出
    function asset:mob/0233.honey_flyer/wing_vfx/

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

# 数値
    # デフォルト
        data modify storage lib: Argument.VectorMagnitude set value 0.7
    # かなり離れてる時に実行
        execute if entity @p[tag=Target,distance=30..40] run data modify storage lib: Argument.VectorMagnitude set value 0.8
    # 近い時に実行する
        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..40] facing entity @p[tag=Target,distance=..40] eyes rotated ~ ~-10 run function lib:motion/
    # 近い場合
        execute if entity @p[tag=Target,distance=..9] facing entity @p[tag=Target,distance=..9] eyes rotated ~180 ~-5 run function lib:motion/

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


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

# 元となるMobを召喚する
    summon guardian ~ ~ ~ {Tags:["MobInit"],DeathLootTable:"asset:mob/death/0283.guardian"}
# ID (int)
    data modify storage asset:mob ID set value 283
# 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.guardian","color":"dark_aqua"}'
# 武器
    # メインハンド (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 1000
# 攻撃力 (double) (オプション)
    # data modify storage asset:mob AttackDamage set value
# 防御力 (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
# ノックバック耐性 (double) (オプション)
    # data modify storage asset:mob KnockBackResist set value
# 属性倍率 // 1.0fで100% 最低でも25%は軽減されずに入る
    # 物理倍率 (float) (オプション)
        data modify storage asset:mob Resist.Physical set value 0.8
    # 魔法倍率 (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 0.25
    # 雷倍率 (float) (オプション)
        # data modify storage asset:mob Resist.Thunder set value

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


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

execute if data storage asset:context {id:283} run function asset:mob/0283.guardian/summon/2.summon


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

execute if data storage asset:context {id:283} run function asset:mob/0283.guardian/attack/2.attack


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

# 演出
    execute at @p[tag=Victim,distance=..50] run particle nautilus ~ ~1 ~ 1 1 1 1 150 normal @a

# 属性ダメージ
    data modify storage lib: Argument.Damage set value 18.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 @p[tag=Victim,distance=..50] run function lib:damage/
    function lib:damage/reset


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

#> 定義類はここに
# @within function asset:mob/0046.clock_of_despair/**
    scoreboard objectives add 1A.LifeTime dummy
    scoreboard objectives add 1A.Yaw dummy


text:
#> asset:mob/0046.clock_of_despair/_index.d
# @private

#> tag
# @within function asset:mob/0046.clock_of_despair/**
    #declare tag 1A.ClockHand
    #declare tag 1A.Clock
    #
    #declare tag 1A.SkillMarker
    #declare tag 1A.SkillPenaltyThunderMaker
    #declare tag 1A.SkillThunderMaker
    #declare tag 1A.SkillFireMaker
    #declare tag 1A.SkillBallAEC
    #declare tag 1A.SkillBeam
    #declare tag 1A.GearSilver
    #declare tag 1A.GearGold
    #declare tag 1A.WallLazerClock
    #declare tag 1A.This
    #
    #declare tag Landing
    #declare tag LandingTarget
    #declare score_holder $LazerDistance

#> Val
# @within function asset:mob/0046.clock_of_despair/tick/skill/common/gear_*/spread_summon/*
#declare tag GearInit


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

kill @e[type=armor_stand,tag=1A.ClockHand]

# ボスドロ
    data modify storage api: Argument.ID set value 837
    data modify storage api: Argument.Important set value true
    function api:artifact/spawn/from_id


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

execute if data storage asset:context {id:46} run function asset:mob/0046.clock_of_despair/death/2.death


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

# 元となるMobを召喚する
    summon zombie ~ ~ ~ {Tags:["MobInit","AlwaysInvisible","1A.Clock"],NoAI:1b,Silent:1b,DeathLootTable:"asset:mob/death/0046.clock_of_despair"}
# ID (int)
    data modify storage asset:mob ID set value 46
# 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":"絶望の時計"}'
# 武器
    # メインハンド (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:stick",Count:1b,tag:{CustomModelData:20020}}
    # 胴 (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 2000
# 攻撃力 (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 30
# 特殊防御力 (double) (オプション) // 4pointにつきダメージを大きく減らす
    data modify storage asset:mob SpecialDefense set value 30
# 移動速度 (double) (オプション)
    data modify storage asset:mob Speed set value 0
# 索敵範囲 (double) (オプション)
    data modify storage asset:mob FollowRange set value 0
# ノックバック耐性 (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
    # 魔法倍率 (float) (オプション)
        data modify storage asset:mob Resist.Magic set value 0
    # 火倍率 (float) (オプション)
        data modify storage asset:mob Resist.Fire set value 0
    # 水倍率 (float) (オプション)
        data modify storage asset:mob Resist.Water set value 0
    # 雷倍率 (float) (オプション)
        data modify storage asset:mob Resist.Thunder set value 0

# 演出用の針を召喚する
    summon armor_stand ~ ~ ~ {NoGravity:1b,Invulnerable:1b,Marker:1b,Invisible:1b,Tags:["1A.ClockHand","Object","Uninterferable"]}
    execute as @e[type=armor_stand,tag=1A.ClockHand,distance=..1,sort=nearest,limit=1] run tp @e[type=zombie,tag=MobInit,distance=..0.01]

# スコアを設定
    scoreboard players set @e[type=zombie,tag=MobInit,distance=..0.01] 1A.LifeTime -1

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


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

execute if data storage asset:context {id:46} run function asset:mob/0046.clock_of_despair/summon/2.summon


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

# 効果を発動する
    data modify storage lib: Argument.Heal set value 9999f
    data modify storage lib: Argument.FixedHeal set value true
    function lib:heal/
# リセット
    function lib:heal/reset


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

execute if data storage asset:context {id:46} run function asset:mob/0046.clock_of_despair/hurt/2.hurt


text:
#> asset:mob/0046.clock_of_despair/remove/2.remove
#
#
#
# @within function asset:mob/0046.clock_of_despair/remove/1.trigger

# 削除
    kill @e[type=armor_stand,tag=1A.ClockHand]
    kill @e[type=marker,tag=1A.SkillMarker]


text:
#> asset:mob/0046.clock_of_despair/remove/1.trigger
#
#
#
# @within tag/function asset:mob/remove

execute if data storage asset:context {id:46} run function asset:mob/0046.clock_of_despair/remove/2.remove


text:
#> asset:mob/0046.clock_of_despair/tick/particle_clockhand
#
#
#
# @within function asset:mob/0046.clock_of_despair/tick/**

# [ImportKey]: NobwRALgngDgpmAXGANgSwHYIDRgwQwFsFl0sACARjFxnwCciBnJcAYwHsBXDCJAJgAMuAGb0OhVmAAeSSrihIAtADYAvrggcpsxMLCLESgBwawHESKZw+e3ADc4ALzRx6SQWo3ho8JKkwcPCISAIpKJU4YRVoGZilOHlshUXFJRHBdJXkDZXVNbQyZDwVlU1wLKxsSsEcXNw8vbB9YULIggmJ-dqpIjmi+6JowOkZCFiLE3gF9MQkdZUEAOgBWUqMAZjMtBaMcw1UzSutbfTrXdz2mlr9SQOHOtsDeqKhBt9fh0fjJ7mnEFJgObpTIeVbrJRbAq7fZ5I6WE41c4NRCUa6QVr+NhoehsFAdEJYnF4uDkfhfOLjBJ-WwbfRsOC8FGguy5PRmRgAEzQXAmOSYEAYp1wcBQ6Bg1jkgn04kFEBInm8GNuYGxuPxD0JyDVJPIGwpYwm7BpSAALCpcAymZcWfoDlCwFyeRNlmswAKhTVReLJajpbhZfh5Y0lb4nlhNV07hRybFDdSklLUvMirpXRCHTtU2C3Qc0RUEdVWcjLkplupQ5jowSo2FSfx3gafsbE37kyDikZ02zIdtCiyy+Ce-nzIXhbVnBcwRWALpAA
# line 1
particle electric_spark ^1 ^ ^-6 0 0 0 0 1
particle electric_spark ^0.94737 ^ ^-6.10526 0 0 0 0 1
particle electric_spark ^0.89474 ^ ^-6.21053 0 0 0 0 1
particle electric_spark ^0.84211 ^ ^-6.31579 0 0 0 0 1
particle electric_spark ^0.78947 ^ ^-6.42105 0 0 0 0 1
particle electric_spark ^0.73684 ^ ^-6.52632 0 0 0 0 1
particle electric_spark ^0.68421 ^ ^-6.63158 0 0 0 0 1
particle electric_spark ^0.63158 ^ ^-6.73684 0 0 0 0 1
particle electric_spark ^0.57895 ^ ^-6.84211 0 0 0 0 1
particle electric_spark ^0.52632 ^ ^-6.94737 0 0 0 0 1
particle electric_spark ^0.47368 ^ ^-7.05263 0 0 0 0 1
particle electric_spark ^0.42105 ^ ^-7.15789 0 0 0 0 1
particle electric_spark ^0.36842 ^ ^-7.26316 0 0 0 0 1
particle electric_spark ^0.31579 ^ ^-7.36842 0 0 0 0 1
particle electric_spark ^0.26316 ^ ^-7.47368 0 0 0 0 1
particle electric_spark ^0.21053 ^ ^-7.57895 0 0 0 0 1
particle electric_spark ^0.15789 ^ ^-7.68421 0 0 0 0 1
particle electric_spark ^0.10526 ^ ^-7.78947 0 0 0 0 1
particle electric_spark ^0.05263 ^ ^-7.89474 0 0 0 0 1
particle electric_spark ^0 ^ ^-8 0 0 0 0 1
# line 1-copy
particle electric_spark ^-1 ^ ^-6 0 0 0 0 1
particle electric_spark ^-0.94737 ^ ^-6.10526 0 0 0 0 1
particle electric_spark ^-0.89474 ^ ^-6.21053 0 0 0 0 1
particle electric_spark ^-0.84211 ^ ^-6.31579 0 0 0 0 1
particle electric_spark ^-0.78947 ^ ^-6.42105 0 0 0 0 1
particle electric_spark ^-0.73684 ^ ^-6.52632 0 0 0 0 1
particle electric_spark ^-0.68421 ^ ^-6.63158 0 0 0 0 1
particle electric_spark ^-0.63158 ^ ^-6.73684 0 0 0 0 1
particle electric_spark ^-0.57895 ^ ^-6.84211 0 0 0 0 1
particle electric_spark ^-0.52632 ^ ^-6.94737 0 0 0 0 1
particle electric_spark ^-0.47368 ^ ^-7.05263 0 0 0 0 1
particle electric_spark ^-0.42105 ^ ^-7.15789 0 0 0 0 1
particle electric_spark ^-0.36842 ^ ^-7.26316 0 0 0 0 1
particle electric_spark ^-0.31579 ^ ^-7.36842 0 0 0 0 1
particle electric_spark ^-0.26316 ^ ^-7.47368 0 0 0 0 1
particle electric_spark ^-0.21053 ^ ^-7.57895 0 0 0 0 1
particle electric_spark ^-0.15789 ^ ^-7.68421 0 0 0 0 1
particle electric_spark ^-0.10526 ^ ^-7.78947 0 0 0 0 1
particle electric_spark ^-0.05263 ^ ^-7.89474 0 0 0 0 1
particle electric_spark ^0 ^ ^-8 0 0 0 0 1
# line 1-copy-copy
particle electric_spark ^-0.5 ^ ^-3 0 0 0 0 1
particle electric_spark ^-0.42795 ^ ^-3.17429 0 0 0 0 1
particle electric_spark ^-0.36683 ^ ^-3.34676 0 0 0 0 1
particle electric_spark ^-0.31664 ^ ^-3.5174 0 0 0 0 1
particle electric_spark ^-0.27738 ^ ^-3.68623 0 0 0 0 1
particle electric_spark ^-0.24904 ^ ^-3.85323 0 0 0 0 1
particle electric_spark ^-0.23164 ^ ^-4.01841 0 0 0 0 1
particle electric_spark ^-0.22517 ^ ^-4.18177 0 0 0 0 1
particle electric_spark ^-0.22963 ^ ^-4.34331 0 0 0 0 1
particle electric_spark ^-0.24501 ^ ^-4.50302 0 0 0 0 1
particle electric_spark ^-0.27133 ^ ^-4.66092 0 0 0 0 1
particle electric_spark ^-0.30857 ^ ^-4.81699 0 0 0 0 1
particle electric_spark ^-0.35675 ^ ^-4.97124 0 0 0 0 1
particle electric_spark ^-0.41585 ^ ^-5.12367 0 0 0 0 1
particle electric_spark ^-0.48589 ^ ^-5.27428 0 0 0 0 1
particle electric_spark ^-0.56685 ^ ^-5.42307 0 0 0 0 1
particle electric_spark ^-0.65874 ^ ^-5.57003 0 0 0 0 1
particle electric_spark ^-0.76157 ^ ^-5.71518 0 0 0 0 1
particle electric_spark ^-0.87532 ^ ^-5.8585 0 0 0 0 1
particle electric_spark ^-1 ^ ^-6 0 0 0 0 1
# line 1-copy-copy-copy
particle electric_spark ^0.5 ^ ^-3 0 0 0 0 1
particle electric_spark ^0.42795 ^ ^-3.17429 0 0 0 0 1
particle electric_spark ^0.36683 ^ ^-3.34676 0 0 0 0 1
particle electric_spark ^0.31664 ^ ^-3.5174 0 0 0 0 1
particle electric_spark ^0.27738 ^ ^-3.68623 0 0 0 0 1
particle electric_spark ^0.24904 ^ ^-3.85323 0 0 0 0 1
particle electric_spark ^0.23164 ^ ^-4.01841 0 0 0 0 1
particle electric_spark ^0.22517 ^ ^-4.18177 0 0 0 0 1
particle electric_spark ^0.22963 ^ ^-4.34331 0 0 0 0 1
particle electric_spark ^0.24501 ^ ^-4.50302 0 0 0 0 1
particle electric_spark ^0.27133 ^ ^-4.66092 0 0 0 0 1
particle electric_spark ^0.30857 ^ ^-4.81699 0 0 0 0 1
particle electric_spark ^0.35675 ^ ^-4.97124 0 0 0 0 1
particle electric_spark ^0.41585 ^ ^-5.12367 0 0 0 0 1
particle electric_spark ^0.48589 ^ ^-5.27428 0 0 0 0 1
particle electric_spark ^0.56685 ^ ^-5.42307 0 0 0 0 1
particle electric_spark ^0.65874 ^ ^-5.57003 0 0 0 0 1
particle electric_spark ^0.76157 ^ ^-5.71518 0 0 0 0 1
particle electric_spark ^0.87532 ^ ^-5.8585 0 0 0 0 1
particle electric_spark ^1 ^ ^-6 0 0 0 0 1
# circle 3
particle electric_spark ^0 ^ ^-3.5 0 0 0 0 1
particle electric_spark ^0.06808 ^ ^-3.49534 0 0 0 0 1
particle electric_spark ^0.1349 ^ ^-3.48146 0 0 0 0 1
particle electric_spark ^0.1992 ^ ^-3.45861 0 0 0 0 1
particle electric_spark ^0.25979 ^ ^-3.42721 0 0 0 0 1
particle electric_spark ^0.31554 ^ ^-3.38786 0 0 0 0 1
particle electric_spark ^0.36542 ^ ^-3.34128 0 0 0 0 1
particle electric_spark ^0.40848 ^ ^-3.28834 0 0 0 0 1
particle electric_spark ^0.44394 ^ ^-3.23003 0 0 0 0 1
particle electric_spark ^0.47113 ^ ^-3.16744 0 0 0 0 1
particle electric_spark ^0.48954 ^ ^-3.10173 0 0 0 0 1
particle electric_spark ^0.49883 ^ ^-3.03412 0 0 0 0 1
particle electric_spark ^0.49883 ^ ^-2.96588 0 0 0 0 1
particle electric_spark ^0.48954 ^ ^-2.89827 0 0 0 0 1
particle electric_spark ^0.47113 ^ ^-2.83256 0 0 0 0 1
particle electric_spark ^0.44394 ^ ^-2.76997 0 0 0 0 1
particle electric_spark ^0.40848 ^ ^-2.71166 0 0 0 0 1
particle electric_spark ^0.36542 ^ ^-2.65872 0 0 0 0 1
particle electric_spark ^0.31554 ^ ^-2.61214 0 0 0 0 1
particle electric_spark ^0.25979 ^ ^-2.57279 0 0 0 0 1
particle electric_spark ^0.1992 ^ ^-2.54139 0 0 0 0 1
particle electric_spark ^0.1349 ^ ^-2.51854 0 0 0 0 1
particle electric_spark ^0.06808 ^ ^-2.50466 0 0 0 0 1
particle electric_spark ^0 ^ ^-2.5 0 0 0 0 1
particle electric_spark ^-0.06808 ^ ^-2.50466 0 0 0 0 1
particle electric_spark ^-0.1349 ^ ^-2.51854 0 0 0 0 1
particle electric_spark ^-0.1992 ^ ^-2.54139 0 0 0 0 1
particle electric_spark ^-0.25979 ^ ^-2.57279 0 0 0 0 1
particle electric_spark ^-0.31554 ^ ^-2.61214 0 0 0 0 1
particle electric_spark ^-0.36542 ^ ^-2.65872 0 0 0 0 1
particle electric_spark ^-0.40848 ^ ^-2.71166 0 0 0 0 1
particle electric_spark ^-0.44394 ^ ^-2.76997 0 0 0 0 1
particle electric_spark ^-0.47113 ^ ^-2.83256 0 0 0 0 1
particle electric_spark ^-0.48954 ^ ^-2.89827 0 0 0 0 1
particle electric_spark ^-0.49883 ^ ^-2.96588 0 0 0 0 1
particle electric_spark ^-0.49883 ^ ^-3.03412 0 0 0 0 1
particle electric_spark ^-0.48954 ^ ^-3.10173 0 0 0 0 1
particle electric_spark ^-0.47113 ^ ^-3.16744 0 0 0 0 1
particle electric_spark ^-0.44394 ^ ^-3.23003 0 0 0 0 1
particle electric_spark ^-0.40848 ^ ^-3.28834 0 0 0 0 1
particle electric_spark ^-0.36542 ^ ^-3.34128 0 0 0 0 1
particle electric_spark ^-0.31554 ^ ^-3.38786 0 0 0 0 1
particle electric_spark ^-0.25979 ^ ^-3.42721 0 0 0 0 1
particle electric_spark ^-0.1992 ^ ^-3.45861 0 0 0 0 1
particle electric_spark ^-0.1349 ^ ^-3.48146 0 0 0 0 1
particle electric_spark ^-0.06808 ^ ^-3.49534 0 0 0 0 1
# line 2
particle electric_spark ^0.5 ^ ^-3 0 0 0 0 1
particle electric_spark ^0.38148 ^ ^-2.77778 0 0 0 0 1
particle electric_spark ^0.29259 ^ ^-2.55556 0 0 0 0 1
particle electric_spark ^0.23333 ^ ^-2.33333 0 0 0 0 1
particle electric_spark ^0.2037 ^ ^-2.11111 0 0 0 0 1
particle electric_spark ^0.2037 ^ ^-1.88889 0 0 0 0 1
particle electric_spark ^0.23333 ^ ^-1.66667 0 0 0 0 1
particle electric_spark ^0.29259 ^ ^-1.44444 0 0 0 0 1
particle electric_spark ^0.38148 ^ ^-1.22222 0 0 0 0 1
particle electric_spark ^0.5 ^ ^-1 0 0 0 0 1
# line 2-copy
particle electric_spark ^-0.5 ^ ^-3 0 0 0 0 1
particle electric_spark ^-0.38148 ^ ^-2.77778 0 0 0 0 1
particle electric_spark ^-0.29259 ^ ^-2.55556 0 0 0 0 1
particle electric_spark ^-0.23333 ^ ^-2.33333 0 0 0 0 1
particle electric_spark ^-0.2037 ^ ^-2.11111 0 0 0 0 1
particle electric_spark ^-0.2037 ^ ^-1.88889 0 0 0 0 1
particle electric_spark ^-0.23333 ^ ^-1.66667 0 0 0 0 1
particle electric_spark ^-0.29259 ^ ^-1.44444 0 0 0 0 1
particle electric_spark ^-0.38148 ^ ^-1.22222 0 0 0 0 1
particle electric_spark ^-0.5 ^ ^-1 0 0 0 0 1
# circle 2
particle electric_spark ^0 ^ ^-1 0 0 0 0 1
particle electric_spark ^0.20791 ^ ^-0.97815 0 0 0 0 1
particle electric_spark ^0.40674 ^ ^-0.91355 0 0 0 0 1
particle electric_spark ^0.58779 ^ ^-0.80902 0 0 0 0 1
particle electric_spark ^0.74314 ^ ^-0.66913 0 0 0 0 1
particle electric_spark ^0.86603 ^ ^-0.5 0 0 0 0 1
particle electric_spark ^0.95106 ^ ^-0.30902 0 0 0 0 1
particle electric_spark ^0.99452 ^ ^-0.10453 0 0 0 0 1
particle electric_spark ^0.99452 ^ ^0.10453 0 0 0 0 1
particle electric_spark ^0.95106 ^ ^0.30902 0 0 0 0 1
particle electric_spark ^0.86603 ^ ^0.5 0 0 0 0 1
particle electric_spark ^0.74314 ^ ^0.66913 0 0 0 0 1
particle electric_spark ^0.58779 ^ ^0.80902 0 0 0 0 1
particle electric_spark ^0.40674 ^ ^0.91355 0 0 0 0 1
particle electric_spark ^0.20791 ^ ^0.97815 0 0 0 0 1
particle electric_spark ^0 ^ ^1 0 0 0 0 1
particle electric_spark ^-0.20791 ^ ^0.97815 0 0 0 0 1
particle electric_spark ^-0.40674 ^ ^0.91355 0 0 0 0 1
particle electric_spark ^-0.58779 ^ ^0.80902 0 0 0 0 1
particle electric_spark ^-0.74314 ^ ^0.66913 0 0 0 0 1
particle electric_spark ^-0.86603 ^ ^0.5 0 0 0 0 1
particle electric_spark ^-0.95106 ^ ^0.30902 0 0 0 0 1
particle electric_spark ^-0.99452 ^ ^0.10453 0 0 0 0 1
particle electric_spark ^-0.99452 ^ ^-0.10453 0 0 0 0 1
particle electric_spark ^-0.95106 ^ ^-0.30902 0 0 0 0 1
particle electric_spark ^-0.86603 ^ ^-0.5 0 0 0 0 1
particle electric_spark ^-0.74314 ^ ^-0.66913 0 0 0 0 1
particle electric_spark ^-0.58779 ^ ^-0.80902 0 0 0 0 1
particle electric_spark ^-0.40674 ^ ^-0.91355 0 0 0 0 1
particle electric_spark ^-0.20791 ^ ^-0.97815 0 0 0 0 1


text:
#> asset:mob/0046.clock_of_despair/tick/armorstand_respawn
#
# 実質リセット処理（こんなことすんな！！！！）
#
# @within function asset:mob/0046.clock_of_despair/tick/2.tick

# キル
    kill @e[type=armor_stand,tag=1A.ClockHand]
# 演出用の針を召喚する
    summon armor_stand ~ ~ ~ {NoGravity:1b,Invulnerable:1b,Marker:1b,Invisible:1b,Tags:["1A.ClockHand","Object","Uninterferable"]}
    execute as @e[type=armor_stand,tag=1A.ClockHand,distance=..1,sort=nearest,limit=1] run tp @s


text:
#> asset:mob/0046.clock_of_despair/tick/schedule
#
#
#
# @within function asset:mob/0046.clock_of_despair/tick/2.tick

# スキル用の常時実行
    execute as @e[type=marker,tag=1A.SkillMarker] at @s run function asset:mob/0046.clock_of_despair/tick/skill/common/tick


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

#> private
# @private
#declare score_holder $IntervalTime

# スコアを増やす
    scoreboard players add @s 1A.LifeTime 1

# プレイヤーが周囲にいないのに時間がきてしまった場合。スコアを戻す。
    execute if score @s 1A.LifeTime matches 0 unless entity @p[gamemode=!spectator,distance=..100] run scoreboard players set @s 1A.LifeTime -1

# スキル発動
    function asset:mob/0046.clock_of_despair/tick/3.skill_active

# 時計の針の回転
    execute as @e[type=armor_stand,tag=1A.ClockHand,distance=..0.1,sort=nearest,limit=1] at @s run tp @s ~ ~ ~ ~0.15 ~

# 2tick毎のVFX
    scoreboard players operation $IntervalTime Temporary = @s 1A.LifeTime
    scoreboard players operation $IntervalTime Temporary %= $2 Const
    execute if score $IntervalTime Temporary matches 0 run function asset:mob/0046.clock_of_despair/tick/2t_interval_vfx
    scoreboard players reset $IntervalTime Temporary
# 40tick(2秒)毎の高高度ペナルティ
    scoreboard players operation $IntervalTime Temporary = @s 1A.LifeTime
    scoreboard players operation $IntervalTime Temporary %= $40 Const
    execute if score $IntervalTime Temporary matches 0 positioned ~-15 ~3.2 ~-15 at @a[dx=29,dy=25,dz=29] positioned ~ ~1 ~ run function asset:mob/0046.clock_of_despair/tick/skill/common/penalty_thunder/summon
    scoreboard players reset $IntervalTime Temporary
# 200tick(10秒)毎のSE
    scoreboard players operation $IntervalTime Temporary = @s 1A.LifeTime
    scoreboard players operation $IntervalTime Temporary %= $200 Const
    execute if score $IntervalTime Temporary matches 0 run playsound minecraft:block.bell.use hostile @a ~ ~ ~ 2 0.5 1
    execute if score $IntervalTime Temporary matches 0 run playsound minecraft:block.bell.use hostile @a ~ ~ ~ 2 0.5 1
    execute if score $IntervalTime Temporary matches 0 run playsound minecraft:block.bell.use hostile @a ~ ~ ~ 2 0.5 1
    scoreboard players reset $IntervalTime Temporary

# もしアマスタがどっかいってしまったら
    execute at @s unless entity @e[type=armor_stand,tag=1A.ClockHand,distance=..0.01] run function asset:mob/0046.clock_of_despair/tick/armorstand_respawn

# スキル用の常時実行
    schedule function asset:mob/0046.clock_of_despair/tick/schedule 1t replace

# プレイヤーを引き寄せる
    execute as @a[distance=10..13] at @s facing entity @e[type=zombie,tag=this,distance=..13,sort=nearest,limit=1] eyes run tp @s ^ ^ ^0.4
    execute as @a[distance=13..20] at @s facing entity @e[type=zombie,tag=this,distance=..20,sort=nearest,limit=1] eyes run tp @s ^ ^ ^1.0
    execute as @a[distance=20..30] at @s facing entity @e[type=zombie,tag=this,distance=..30,sort=nearest,limit=1] eyes run tp @s ^ ^ ^1.5
    execute as @a[distance=30..100] at @s facing entity @e[type=zombie,tag=this,distance=..100,sort=nearest,limit=1] eyes positioned as @e[type=zombie,tag=this,distance=..100] rotated ~ 0 run tp @s ^ ^ ^2


text:
#> asset:mob/0046.clock_of_despair/tick/3.skill_active
#
#
#
# @within function asset:mob/0046.clock_of_despair/tick/2.tick

# 0時
    execute if score @s 1A.LifeTime matches 0..199 run function asset:mob/0046.clock_of_despair/tick/skill/0_oclock
# 1時
    execute if score @s 1A.LifeTime matches 200..399 run function asset:mob/0046.clock_of_despair/tick/skill/1_oclock
# 2時
    execute if score @s 1A.LifeTime matches 400..599 run function asset:mob/0046.clock_of_despair/tick/skill/2_oclock
# 3時
    execute if score @s 1A.LifeTime matches 600..799 run function asset:mob/0046.clock_of_despair/tick/skill/3_oclock
# 4時
    execute if score @s 1A.LifeTime matches 800..999 run function asset:mob/0046.clock_of_despair/tick/skill/4_oclock
# 5時
    execute if score @s 1A.LifeTime matches 1000..1199 run function asset:mob/0046.clock_of_despair/tick/skill/5_oclock
# 6時
    execute if score @s 1A.LifeTime matches 1200..1399 run function asset:mob/0046.clock_of_despair/tick/skill/6_oclock
# 7時
    execute if score @s 1A.LifeTime matches 1400..1599 run function asset:mob/0046.clock_of_despair/tick/skill/7_oclock
# 8時
    execute if score @s 1A.LifeTime matches 1600..1799 run function asset:mob/0046.clock_of_despair/tick/skill/8_oclock
# 9時
    execute if score @s 1A.LifeTime matches 1800..3999 run function asset:mob/0046.clock_of_despair/tick/skill/9_oclock
# 10時
    execute if score @s 1A.LifeTime matches 2000..2199 run function asset:mob/0046.clock_of_despair/tick/skill/10_oclock
# 11時
    execute if score @s 1A.LifeTime matches 2200..2399 run function asset:mob/0046.clock_of_despair/tick/skill/11_oclock
# 12時
    execute if score @s 1A.LifeTime matches 2400.. run function asset:mob/0046.clock_of_despair/tick/skill/12_oclock