text:
#> asset:mob/0237.lunatic_mage/skill/elemental_confine/7.fire_shoot
#
# 火の弾の発射処理
#
# @within function
#   asset:mob/0237.lunatic_mage/skill/elemental_confine/5.fire
#   asset:mob/0237.lunatic_mage/skill/elemental_confine/6.fire2

# 火を発射
    execute anchored eyes run function asset:mob/0237.lunatic_mage/skill/elemental_confine/8.fire_recursive
    execute rotated ~180 ~ anchored eyes run function asset:mob/0237.lunatic_mage/skill/elemental_confine/8.fire_recursive

# ヒット処理
    execute as @a[tag=LandingTarget,distance=..25] run function asset:mob/0237.lunatic_mage/skill/elemental_confine/9.fire_hit

# 音
    playsound entity.blaze.shoot hostile @a[distance=..25] ~ ~ ~ 1 1.2 0


text:
#> asset:mob/0237.lunatic_mage/skill/teleport/vfx
#
# テレポート時の演出
#
# @within function asset:mob/0237.lunatic_mage/**

    particle minecraft:end_rod ~ ~1 ~ 0 0 0 0.1 10
    particle minecraft:explosion ~ ~1 ~ 0 0 0 0 1
    playsound minecraft:entity.enderman.teleport hostile @a ~ ~ ~ 2 1.5
    playsound minecraft:entity.zombie_villager.converted hostile @a ~ ~ ~ 2 2

repo_name: ProjectTSB/TheSkyBlessing

repo_language: mcfunction

mime_type: text/plain


text:
#> asset:mob/0237.lunatic_mage/skill/teleport/main
#
# 自身の出現位置を中心として拡散テレポート
#
# @within function asset:mob/0237.lunatic_mage/tick/5.reset

# ワープ中はモデル外して透明化
    item replace entity @s armor.head with minecraft:air

# 透明化時間設定
    scoreboard players set @s 6L.Invisible 5

# パーティクル
    function asset:mob/0237.lunatic_mage/skill/teleport/vfx

# 実行座標を中心として-x方向に1、+x方向に1、-y方向に0.2、+y方向に0.8、-z方向に1、+z方向に1の立方体内のランダムな位置にmarkerを移動
    data modify storage lib: Argument.Bounds set value [[9d,9d],[0.0d,0.0d],[9d,9d]]
    execute at @e[type=marker,tag=6L.SpawnPoint,distance=..100,sort=nearest,limit=1] run function lib:spread_entity/

# パーティクル
    execute at @s run function asset:mob/0237.lunatic_mage/skill/teleport/vfx

# 色々リセット
    scoreboard players set @s 6L.Tick -10
    scoreboard players reset @s 6L.TeleportCount


text:
#> asset:mob/0237.lunatic_mage/skill/water/1
#
# 水スキルのメイン処理
#
# @within function asset:mob/0237.lunatic_mage/tick/4.skill_branch

# ポーズ変更
    execute if entity @s[scores={6L.Tick=2}] run item replace entity @s armor.head with stick{CustomModelData:20200}

# 予備動作的な
    execute if entity @s[scores={6L.Tick=1}] run playsound block.portal.trigger hostile @a[distance=..30] ~ ~ ~ 0.8 2 0
    execute if entity @s[scores={6L.Tick=..20}] run particle dust 0.17 0.34 1 1.5 ~ ~1 ~ 0.4 0.5 0.4 0.3 3 force @a[distance=..20]
    execute if entity @s[scores={6L.Tick=..20}] positioned ~ ~2.4 ~ positioned ^-0.6 ^ ^0.4 run particle splash ~ ~ ~ 0 0 0 0.02 10

# 魔法召喚
    execute if entity @s[scores={6L.Tick=21}] at @a[gamemode=!spectator,distance=..50,sort=random,limit=5] positioned ~ ~0.3 ~ run function asset:mob/0237.lunatic_mage/magic_summon/water
    execute if entity @s[scores={6L.Tick=41}] at @a[gamemode=!spectator,distance=..50,sort=random,limit=5] positioned ~ ~0.3 ~ run function asset:mob/0237.lunatic_mage/magic_summon/water
    execute if entity @s[scores={6L.Tick=61}] at @a[gamemode=!spectator,distance=..50,sort=random,limit=5] positioned ~ ~0.3 ~ run function asset:mob/0237.lunatic_mage/magic_summon/water

# リセット
    execute if entity @s[scores={6L.Tick=66..}] run function asset:mob/0237.lunatic_mage/tick/5.reset


text:
#> asset:mob/0237.lunatic_mage/remove/2.remove
#
#
#
# @within function asset:mob/0237.lunatic_mage/remove/1.trigger

# 初期地点markerをキル
    kill @e[type=marker,tag=6L.SpawnPoint,distance=..100,limit=1]


text:
#> asset:mob/0237.lunatic_mage/remove/1.trigger
#
#
#
# @within tag/function asset:mob/remove

execute if data storage asset:context {id:237} run function asset:mob/0237.lunatic_mage/remove/2.remove


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

# パーティクル
    particle minecraft:falling_dust black_concrete ~ ~0.5 ~ 0.1 0 0.1 0 1

# HP減少時のパーティクル
    execute if entity @s[tag=6L.HealthLess40Per] run particle minecraft:instant_effect ~ ~1 ~ 0.3 0.5 0.3 0 1

# 技決定
    execute if entity @s[scores={6L.Tick=0}] run function asset:mob/0237.lunatic_mage/tick/3.select_skill

# 技
    execute if entity @s[scores={6L.Tick=0..}] run function asset:mob/0237.lunatic_mage/tick/4.skill_branch

# スコア
    scoreboard players add @s 6L.Tick 1

# Yのrotationを0で固定
    data modify entity @s Rotation[1] set value 0f

# カスタム透明化
    scoreboard players remove @s[scores={6L.Invisible=0..}] 6L.Invisible 1
    item replace entity @s[scores={6L.Invisible=0}] armor.head with minecraft:stick{CustomModelData:20198}
    scoreboard players reset @s[scores={6L.Invisible=0}] 6L.Invisible


text:
#> asset:mob/0237.lunatic_mage/tick/5.reset
#
# リセットします
#
# @within function asset:mob/0237.lunatic_mage/skill/*/1

# リセット
    data modify entity @s NoAI set value 0b
    scoreboard players set @s 6L.Tick -60
    tag @s remove 6L.Fire
    tag @s remove 6L.Water
    tag @s remove 6L.Thunder
    tag @s remove 6L.Magic
    tag @s remove 6L.Fire2
    tag @s remove 6L.ElementalConfine
    tag @s remove 6L.LeftRotation

# ポーズもリセット
    item replace entity @s armor.head with stick{CustomModelData:20198}

# 本気ワープのスコア
    execute if entity @s[tag=6L.HealthLess40Per] run scoreboard players add @s 6L.TeleportCount 1

# ワープ
    execute if entity @s[scores={6L.TeleportCount=2..}] run function asset:mob/0237.lunatic_mage/skill/teleport/main


text:
#> asset:mob/0237.lunatic_mage/tick/4.skill_branch
#
# 各スキルの技のfunctionに分岐します
#
# @within function asset:mob/0237.lunatic_mage/tick/2.tick

# 火
    execute if entity @s[tag=6L.Fire] run function asset:mob/0237.lunatic_mage/skill/fire/1

# 火2
    execute if entity @s[tag=6L.Fire2] run function asset:mob/0237.lunatic_mage/skill/fire2/1

# 水
    execute if entity @s[tag=6L.Water] run function asset:mob/0237.lunatic_mage/skill/water/1

# 雷
    execute if entity @s[tag=6L.Thunder] run function asset:mob/0237.lunatic_mage/skill/thunder/1

# 無
    execute if entity @s[tag=6L.Magic] run function asset:mob/0237.lunatic_mage/skill/magic/1

# エレメントコンファイン
    execute if entity @s[tag=6L.ElementalConfine] run function asset:mob/0237.lunatic_mage/skill/elemental_confine/1


text:
#> asset:mob/0237.lunatic_mage/tick/3.select_skill
#
# 技決定
#
# @within function asset:mob/0237.lunatic_mage/tick/2.tick

#> 体力40%以下で確定で必殺技を打つ、のでそれを何度も発動しないためのTag
# @private
    #declare tag 6L.AlreadyElement

# 疑似乱数取得
    execute store result score $Random Temporary run function lib:random/
# ほしい範囲に剰余算
    scoreboard players operation $Random Temporary %= $8 Const

# デバッグ用
   #scoreboard players set $Random Temporary 7

# 体力が40%以下になった時、一度だけ確定で必殺技を使う
    execute if entity @s[tag=6L.HealthLess40Per,tag=!6L.AlreadyElement] run scoreboard players set $Random Temporary 8
    execute if entity @s[tag=6L.HealthLess40Per,tag=!6L.AlreadyElement] run tag @s add 6L.AlreadyElement

# 技用Tagを付与
    execute if score $Random Temporary matches 0 run tag @s add 6L.Fire
    execute if score $Random Temporary matches 1 run tag @s add 6L.Fire2
    execute if score $Random Temporary matches 2..3 run tag @s add 6L.Water
    execute if score $Random Temporary matches 4..5 run tag @s add 6L.Thunder
    execute if score $Random Temporary matches 6..7 run tag @s add 6L.Magic
    execute if score $Random Temporary matches 8 run tag @s add 6L.ElementalConfine

# リセット
    scoreboard players reset $Random Temporary


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

execute if data storage asset:context {id:237} run function asset:mob/0237.lunatic_mage/tick/2.tick


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

particle flame ~ ~ ~ 0.5 0.5 0.5 0 60 normal @a
playsound block.fire.ambient hostile @a ~ ~ ~ 2 0.4 0


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

execute if data storage asset:context {id:17} run function asset:mob/0017.fire_bird/death/2.death


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

# 元となるMobを召喚する
    summon phantom ~ ~ ~ {Size:1,Tags:["MobInit","AntiBurn"],DeathLootTable:"asset:mob/death/0017.fire_bird"}
# ID (int)
    data modify storage asset:mob ID set value 17
# 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:stone",Count:1b,tag:{Enchantments:[{id:"fire_aspect",lvl:3}]}}
    # オフハンド (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
    # 胴 (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 290
# 攻撃力 (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.0
# 特殊防御力 (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 20
# ノックバック耐性 (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 0.8
    # 魔法倍率 (float) (オプション)
        data modify storage asset:mob Resist.Magic set value 1.0
    # 火倍率 (float) (オプション)
        data modify storage asset:mob Resist.Fire set value 0.25
    # 水倍率 (float) (オプション)
        data modify storage asset:mob Resist.Water set value 1.0
    # 雷倍率 (float) (オプション)
        data modify storage asset:mob Resist.Thunder set value 0.8

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


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

execute if data storage asset:context {id:17} run function asset:mob/0017.fire_bird/summon/2.summon


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

execute if data storage asset:context {id:17} run function asset:mob/0017.fire_bird/attack/2.attack


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

# 演出
    execute at @p[tag=Victim] run particle flame ~ ~1 ~ 0.8 0.8 0.8 0 20 normal @a
    execute at @p[tag=Victim] run playsound minecraft:block.fire.ambient hostile @a ~ ~ ~ 2 1 0

# 属性ダメージ
   # 与えるダメージ
        data modify storage lib: Argument.Damage set value 9.0f
    # 第一属性
        data modify storage lib: Argument.AttackType set value "Physical"
    # 第二属性
        data modify storage lib: Argument.ElementType set value "Fire"
    # 補正functionを実行
        function lib:damage/modifier
    # 範囲5m以内のゾンビを対象に
        execute as @p[tag=Victim] run function lib:damage/
    # リセット
        function lib:damage/reset


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

particle flame ~ ~ ~ 0.7 0.7 0.7 0.01 1 normal @a


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

execute if data storage asset:context {id:17} run function asset:mob/0017.fire_bird/tick/2.tick


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

#> 定義類はここに
# @within function asset:mob/0058.divide_haze/**
    scoreboard objectives add 1M.Tick dummy


text:
#> asset:mob/0058.divide_haze/summon/2.summon
#
# Mobの召喚時の処理
#
# @within function asset:mob/0058.divide_haze/*/**

# 元となるMobを召喚する
    summon skeleton ~ ~ ~ {Silent:1b,Tags:["MobInit","AlwaysInvisible","AntiBurn","AlwaysSlowFall"],DeathLootTable:"asset:mob/death/0058.divide_haze"}
# ID (int)
    data modify storage asset:mob ID set value 58
# 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_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 70.0
# 攻撃力 (double) (オプション)
    data modify storage asset:mob AttackDamage set value 9.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.20
# 索敵範囲 (double) (オプション)
    data modify storage asset:mob FollowRange set value 25
# ノックバック耐性 (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.4
    # 魔法倍率 (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 0.5
    # 雷倍率 (float) (オプション)
        data modify storage asset:mob Resist.Thunder set value 0.9

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


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

execute if data storage asset:context {id:58} run function asset:mob/0058.divide_haze/summon/2.summon


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

# 増殖カウント減少
   scoreboard players remove @s 1M.Tick 10


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

execute if data storage asset:context {id:58} run function asset:mob/0058.divide_haze/hurt/2.hurt


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

execute if data storage asset:context {id:58} run function asset:mob/0058.divide_haze/attack/2.attack


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

# 演出
   execute at @p[tag=Victim,distance=..6] run particle dust 0 0.2 0.1 1 ~ ~1 ~ 0.5 0.5 0.5 1 20 normal @a

# 増殖カウント蓄積
   scoreboard players add @s 1M.Tick 20


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

# 演出
    particle dust 0 0.2 0.1 1 ~ ~1 ~ 0.5 0.3 0.5 1 6 normal @a[distance=..16]

# 周囲のプレイヤーにウィザー
    effect give @a[gamemode=!spectator,distance=..1.2] wither 1 2 false

# 増殖スコア
   scoreboard players add @s 1M.Tick 1

# 増殖
   execute if score @s 1M.Tick matches 200.. run function asset:mob/0058.divide_haze/tick/3.mob_count


text:
#> asset:mob/0058.divide_haze/tick/3.mob_count
#
#
#
# @within function asset:mob/0058.divide_haze/tick/2.tick

#> Private
# @private
    #declare score_holder $MobCount

# 数をチェック
    execute store result score $MobCount Temporary if entity @e[type=skeleton,scores={MobID=58},distance=..32,limit=3]

# 2体以下なら数を増やす
    execute if score $MobCount Temporary matches ..2 run function asset:mob/0058.divide_haze/tick/4.divide

# スコアリセット
    scoreboard players reset @s 1M.Tick
    scoreboard players reset $MobCount Temporary


text:
#> asset:mob/0058.divide_haze/tick/4.divide
#
#
#
# @within function asset:mob/0058.divide_haze/tick/3.mob_count

# 増殖
    data modify storage api: Argument.ID set value 58
    execute positioned ~ 0 ~ run function api:mob/summon
    execute positioned ~ 0 ~ run tp @e[type=skeleton,scores={MobID=58},distance=..0.01] @s


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

execute if data storage asset:context {id:58} run function asset:mob/0058.divide_haze/tick/2.tick


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

# 元となるMobを召喚する
    summon stray ~ ~ ~ {Tags:["MobInit","AlwaysInvisible"],DeathLootTable:"asset:mob/death/0063.ghost"}
# ID (int)
    data modify storage asset:mob ID set value 63
# 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":"black"}'
# 武器
    # メインハンド (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:bedrock",Count:1b}
    # 胴 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Chest set value {id:"minecraft:leather_chestplate",Count:1b,tag:{display:{color:3881787}}}
    # 脚 (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 125
# 攻撃力 (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 0.25
# 索敵範囲 (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 0.7
    # 魔法倍率 (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=stray,tag=MobInit,distance=..0.01] run function asset:mob/common/summon


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

execute if data storage asset:context {id:63} run function asset:mob/0063.ghost/summon/2.summon


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

execute if data storage asset:context {id:63} run function asset:mob/0063.ghost/attack/2.attack


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

# 演出
    execute at @a[tag=Victim] run particle squid_ink ~ ~ ~ 0.3 0.3 0.3 0.4 100
    execute at @a[tag=Victim] run playsound entity.squid.death hostile @a ~ ~ ~

# 効果
    effect give @a[tag=Victim] blindness 1 0

# ダメージ設定
    # 与えるダメージ
        data modify storage lib: Argument.Damage set value 4.0f
    # 第一属性
        data modify storage lib: Argument.AttackType set value "Magic"
    # ダメージ
        function lib:damage/modifier
        execute as @a[tag=Victim] run function lib:damage/
# リセット
    function lib:damage/reset


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

# 演出
    particle ash ~ ~0.8 ~ 0.2 0 0.2 0 10


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

execute if data storage asset:context {id:63} run function asset:mob/0063.ghost/tick/2.tick


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

#> 定義類はここに
# @within function asset:mob/0085.soul_bullet/**
    scoreboard objectives add 2D.Tick dummy


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

# 元となるMobを召喚する
    summon marker ~ ~ ~ {Tags:["MobInit"]}
# ID (int)
    data modify storage asset:mob ID set value 85
# 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 from entity @s CustomName

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


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

execute if data storage asset:context {id:85} run function asset:mob/0085.soul_bullet/summon/2.summon


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

#> Private
# @private
    #declare score_holder $Temp

# 演出
    particle soul ~ ~ ~ 0 0 0 0 1 normal @a
    particle soul ^ ^ ^0.25 0 0 0 0 1 normal @a
    particle soul ^ ^ ^0.5 0 0 0 0 1 normal @a
    particle soul ^ ^ ^0.75 0 0 0 0 1 normal @a
    particle soul_fire_flame ~ ~ ~ 0.2 0.2 0.2 0 2 normal @a

# 定期的に追加で演出
    scoreboard players operation $Temp Temporary = @s 2D.Tick
    scoreboard players operation $Temp Temporary %= $5 Const
    execute if score $Temp Temporary matches 0 run function asset:mob/0085.soul_bullet/tick/vfx
    execute if score $Temp Temporary matches 0 run playsound ogg:mob.vex.idle1 hostile @a ~ ~ ~ 0.8 0.5 0
    execute if score $Temp Temporary matches 0 run playsound entity.blaze.shoot hostile @a ~ ~ ~ 0.15 1.8 0
    scoreboard players reset $Temp Temporary

# tp
    tp @s ^ ^ ^0.8

# スコア
    scoreboard players add @s 2D.Tick 1

# ヒット
    execute positioned ~-0.5 ~-0.5 ~-0.5 if entity @a[gamemode=!spectator,dx=0] run function asset:mob/0085.soul_bullet/tick/3.hit

# 消滅
    execute if entity @s[scores={2D.Tick=40..}] run kill @s
    execute unless block ^ ^ ^0.8 #lib:no_collision run kill @s


text:
#> asset:mob/0085.soul_bullet/tick/3.hit
#
# ヒット処理
#
# @within function asset:mob/0085.soul_bullet/tick/2.tick

# ダメージ
    data modify storage lib: Argument.Damage set value 36f
    data modify storage lib: Argument.AttackType set value "Magic"
    data modify storage lib: Argument.ElementType set value "Fire"
    function lib:damage/modifier
    execute as @a[tag=!PlayerShouldInvulnerable,dx=0] run function lib:damage/
    function lib:damage/reset

# 消滅
    kill @s


text:
#> asset:mob/0085.soul_bullet/tick/vfx
#
# 円1
#
# @within function asset:mob/0085.soul_bullet/tick/2.tick

# 演出
    particle soul_fire_flame ~ ~ ~ ^ ^30000000 ^ 0.000000004 0 normal @a
    particle soul_fire_flame ~ ~ ~ ^7764571 ^28977774 ^ 0.000000004 0 normal @a
    particle soul_fire_flame ~ ~ ~ ^15000000 ^25980762 ^ 0.000000004 0 normal @a
    particle soul_fire_flame ~ ~ ~ ^21213203 ^21213203 ^ 0.000000004 0 normal @a
    particle soul_fire_flame ~ ~ ~ ^25980762 ^15000000 ^ 0.000000004 0 normal @a
    particle soul_fire_flame ~ ~ ~ ^28977774 ^7764571 ^ 0.000000004 0 normal @a

    particle soul_fire_flame ~ ~ ~ ^30000000 ^ ^ 0.000000004 0 normal @a
    particle soul_fire_flame ~ ~ ~ ^-7764571 ^28977774 ^ 0.000000004 0 normal @a
    particle soul_fire_flame ~ ~ ~ ^-15000000 ^25980762 ^ 0.000000004 0 normal @a
    particle soul_fire_flame ~ ~ ~ ^-21213203 ^21213203 ^ 0.000000004 0 normal @a
    particle soul_fire_flame ~ ~ ~ ^-25980762 ^15000000 ^ 0.000000004 0 normal @a
    particle soul_fire_flame ~ ~ ~ ^-28977774 ^7764571 ^ 0.000000004 0 normal @a

    particle soul_fire_flame ~ ~ ~ ^ ^-30000000 ^ 0.000000004 0 normal @a
    particle soul_fire_flame ~ ~ ~ ^7764571 ^-28977774 ^ 0.000000004 0 normal @a
    particle soul_fire_flame ~ ~ ~ ^15000000 ^-25980762 ^ 0.000000004 0 normal @a
    particle soul_fire_flame ~ ~ ~ ^21213203 ^-21213203 ^ 0.000000004 0 normal @a
    particle soul_fire_flame ~ ~ ~ ^25980762 ^-15000000 ^ 0.000000004 0 normal @a
    particle soul_fire_flame ~ ~ ~ ^28977774 ^-7764571 ^ 0.000000004 0 normal @a

    particle soul_fire_flame ~ ~ ~ ^-30000000 ^ ^ 0.000000004 0 normal @a
    particle soul_fire_flame ~ ~ ~ ^-7764571 ^-28977774 ^ 0.000000004 0 normal @a
    particle soul_fire_flame ~ ~ ~ ^-15000000 ^-25980762 ^ 0.000000004 0 normal @a
    particle soul_fire_flame ~ ~ ~ ^-21213203 ^-21213203 ^ 0.000000004 0 normal @a
    particle soul_fire_flame ~ ~ ~ ^-25980762 ^-15000000 ^ 0.000000004 0 normal @a
    particle soul_fire_flame ~ ~ ~ ^-28977774 ^-7764571 ^ 0.000000004 0 normal @a


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

execute if data storage asset:context {id:85} run function asset:mob/0085.soul_bullet/tick/2.tick


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

# 演出
    particle smoke ~ ~1 ~ 0.3 0.5 0.3 0 10 normal @a


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

execute if data storage asset:context {id:53} run function asset:mob/0053.executioners/death/2.death


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

# 元となるMobを召喚する
    summon skeleton ~ ~ ~ {Tags:["MobInit"],DeathLootTable:"asset:mob/death/0053.executioners"}
# ID (int)
    data modify storage asset:mob ID set value 53
# 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:"stick",Count:1b,tag:{CustomModelData:20029}}
    # オフハンド (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:20045}}
    # 胴 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Chest set value {id:"minecraft:leather_chestplate",Count:1b,tag:{display:{color:5395026}}}
    # 脚 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Legs set value {id:"minecraft:leather_leggings",Count:1b,tag:{display:{color:5395026}}}
    # 足 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Feet set value {id:"minecraft:leather_boots",Count:1b,tag:{display:{color:5395026}}}
# 防具ドロップ率 ([float, float]) (オプション)
    # data modify storage asset:mob ArmorDropChances set value
# 体力 (double) (オプション)
    data modify storage asset:mob Health set value 1100
# 攻撃力 (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.25
# 索敵範囲 (double) (オプション)
    data modify storage asset:mob FollowRange set value 100
# ノックバック耐性 (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.6
    # 水倍率 (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/0053.executioners/summon/1.trigger
#
# Mob召喚処理の呼び出し時に実行されるfunction
#
# @within tag/function asset:mob/summon

execute if data storage asset:context {id:53} run function asset:mob/0053.executioners/summon/2.summon


text:
#> asset:mob/0053.executioners/hurt/2.1.backstep
#
# バックステップ（ほとんどチェーンソーゾンビと一緒）
#
# @within function asset:mob/0053.executioners/hurt/2.hurt

# 演出
    playsound item.trident.throw hostile @a ~ ~ ~ 1 0.8

# 突進する
    data modify storage lib: Argument.VectorMagnitude set value 1
    execute facing entity @p[tag=Attacker,distance=..100] feet rotated ~180 -10 run function lib:motion/

# エフェクト
    effect give @s speed 1 6

# リセット
    data remove storage lib: Argument


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

# 確立でバックステップする
    execute if predicate lib:random_pass_per/50 run function asset:mob/0053.executioners/hurt/2.1.backstep


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

execute if data storage asset:context {id:53} run function asset:mob/0053.executioners/hurt/2.hurt


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

execute if data storage asset:context {id:53} run function asset:mob/0053.executioners/attack/2.attack


text:
#> asset:mob/0053.executioners/attack/2.attack
#
# Mobの攻撃時の処理（雷弄者と似た感じ）
#
# @within function asset:mob/0053.executioners/attack/1.trigger
#> tag
# @within function asset:mob/0053.executioners/attack/2.attack
    #declare tag SpreadMarker

# 演出

# 演出
    execute at @p[tag=Victim] run particle minecraft:lava ~ ~0.5 ~ 0 0.5 0 0.1 40
    execute at @p[tag=Victim] run particle witch ~ ~ ~ 0 1 0 0 20
    playsound entity.blaze.shoot hostile @a ~ ~ ~ 1 0.6
    playsound entity.phantom.bite hostile @a ~ ~ ~ 1 0

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

# 与えるダメージ
    data modify storage lib: Argument.Damage set value 10f
# 属性
    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

# 以下自分がテレポートする処理
# 演出
   particle minecraft:firework ~ ~1 ~ 0.5 0.5 0.5 0 10 normal @a
   playsound minecraft:entity.enderman.teleport hostile @a ~ ~ ~ 1 1

# マーカーをワープさせて、そこが安全地帯ならワープする
    execute at @p[tag=Victim,distance=..50] run summon marker ~ ~ ~ {Tags:["SpreadMarker"]}
    execute at @p[tag=Victim,distance=..50] run data modify storage lib: Argument.Bounds set value [[4d,4d],[0d,0d],[4d,4d]]
    execute as @e[type=marker,tag=SpreadMarker,distance=..60,limit=1] at @s run function lib:spread_entity/
    execute at @e[type=marker,tag=SpreadMarker,distance=..60,limit=1] if block ~ ~ ~ #lib:no_collision_without_fluid unless block ~ ~-1 ~ #lib:no_collision_without_fluid run tp @s ~ ~ ~

# リセット
    data remove storage lib: Argument
    kill @e[type=marker,tag=SpreadMarker]


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

#> Private
# @private
    #declare score_holder $Random

# 演出
    particle minecraft:dust 8 1 8 1 ~ ~1.2 ~ 0.5 0.4 0.5 1 50 normal @a
    playsound minecraft:block.amethyst_cluster.hit hostile @a ~ ~ ~ 2 0 0

# 確率で宝石系ドロップ

    execute store result score $Random Temporary run function lib:random/
    scoreboard players operation $Random Temporary %= $4 Const
    execute if score $Random Temporary matches 0 if predicate lib:random_pass_per/50 run summon item ~ ~ ~ {Item:{id:"minecraft:iron_block",Count:16b}}
    execute if score $Random Temporary matches 1 if predicate lib:random_pass_per/50 run summon item ~ ~ ~ {Item:{id:"minecraft:gold_block",Count:16b}}
    execute if score $Random Temporary matches 2 if predicate lib:random_pass_per/50 run summon item ~ ~ ~ {Item:{id:"minecraft:emerald_block",Count:16b}}
    execute if score $Random Temporary matches 3 if predicate lib:random_pass_per/50 run summon item ~ ~ ~ {Item:{id:"minecraft:diamond_block",Count:16b}}
    scoreboard players reset $Random Temporary


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

execute if data storage asset:context {id:114} run function asset:mob/0114.jewel_hunter/death/2.death


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

# 元となるMobを召喚する
    summon skeleton ~ ~ ~ {Silent:1b,Tags:["MobInit","AlwaysInvisible"],DeathLootTable:"asset:mob/death/0114.jewel_hunter"}
# ID (int)
    data modify storage asset:mob ID set value 114
# 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":"aqua"},{"text":"ュ","color":"green"},{"text":"エ","color":"yellow"},{"text":"ル","color":"light_purple"},{"text":"ハ","color":"aqua"},{"text":"ン","color":"green"},{"text":"タ","color":"yellow"},{"text":"ー","color":"light_purple"}]'
# 武器
    # メインハンド (Compound(Item)) (オプション)
        data modify storage asset:mob Weapon.Mainhand set value {id:"minecraft:stick",Count:1b,tag:{CustomModelData:20246}}
    # オフハンド (Compound(Item)) (オプション)
        data modify storage asset:mob Weapon.Offhand set value {id:"minecraft:stick",Count:1b,tag:{CustomModelData:20247}}
# 武器ドロップ率 ([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:stick",Count:1b,tag:{CustomModelData:20248}}
    # 胴 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Chest set value {id:"minecraft:iron_chestplate",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 [0.0f,0.0f,0.0f,0.0f]
# 体力 (double) (オプション)
    data modify storage asset:mob Health set value 1800
# 攻撃力 (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.33
# 索敵範囲 (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 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.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/0114.jewel_hunter/summon/1.trigger
#
# Mob召喚処理の呼び出し時に実行されるfunction
#
# @within tag/function asset:mob/summon

execute if data storage asset:context {id:114} run function asset:mob/0114.jewel_hunter/summon/2.summon


text:
#> asset:mob/0114.jewel_hunter/hurt/3.reflect
#
#
#
# @within function asset:mob/0114.jewel_hunter/hurt/2.hurt

#> Private
# @private
    #declare tag 35.Already

# Projectileを召喚
    data modify storage api: Argument.ID set value 115
    function api:mob/summon

# 方向合わせ
    tp @e[type=marker,tag=!35.Already,scores={MobID=115},distance=..0.1,sort=nearest,limit=1] ~ ~ ~ ~ ~
    tag @e[type=marker,tag=!35.Already,scores={MobID=115},distance=..0.1,sort=nearest,limit=1] add 35.Already


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

# 演出
    particle minecraft:dust 8 1 8 1 ~ ~1.2 ~ 0.5 0.4 0.5 1 50 normal @a
    playsound minecraft:block.amethyst_cluster.step hostile @a ~ ~ ~ 1 1 0

# Attackerが離れた場所にいる場合近くのプレイヤー全員に遠距離攻撃
    execute unless entity @p[tag=Attacker,distance=..5] positioned ~ ~1.6 ~ facing entity @p[gamemode=!spectator,distance=..32] feet run function asset:mob/0114.jewel_hunter/hurt/3.reflect


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

execute if data storage asset:context {id:114} run function asset:mob/0114.jewel_hunter/hurt/2.hurt


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

execute if data storage asset:context {id:114} run function asset:mob/0114.jewel_hunter/attack/2.attack


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

# 演出
    execute at @p[tag=Victim,distance=..6] run particle minecraft:dust 8 1 8 1 ~ ~1.2 ~ 0.5 0.4 0.5 1 50 normal @a
    execute at @p[tag=Victim,distance=..6] run playsound minecraft:block.amethyst_cluster.fall hostile @a ~ ~ ~ 1 2 0

# ダメージ
    data modify storage lib: Argument.Damage set value 12.0f
    data modify storage lib: Argument.AttackType set value "Physical"
    data modify storage lib: Argument.ElementType set value "None"
    data modify storage lib: Argument.FixedDamage set value 1b
# デスログ
    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 lib:damage/modifier
# 実行
    execute as @p[tag=Victim,distance=..6] run function lib:damage/
# リセット
    function lib:damage/reset


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

#> 定義類はここに
# @within function asset:mob/0138.combat_turret/**
    scoreboard objectives add 3U.Time dummy


text:
#> asset:mob/0138.combat_turret/_index.d
# @private

#> tag
# @within function asset:mob/0138.combat_turret/**
    #declare tag Landing
    #declare tag LandingTarget


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

# 演出
    playsound entity.iron_golem.death hostile @a ~ ~ ~ 1 2


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

execute if data storage asset:context {id:138} run function asset:mob/0138.combat_turret/death/2.death


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

# 元となるMobを召喚する
    summon zombie ~ ~ ~ {Tags:["MobInit","AlwaysInvisible"],Silent:1b,ActiveEffects:[{Id:28,Amplifier:0b,Duration:2147483647,ShowParticles:0b}],DeathLootTable:"asset:mob/death/0138.combat_turret"}
# ID (int)
    data modify storage asset:mob ID set value 138
# 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
    # オフハンド (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:20046}}
    # 胴 (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 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
# ノックバック耐性 (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.5
    # 魔法倍率 (float) (オプション)
        data modify storage asset:mob Resist.Magic set value 1
    # 火倍率 (float) (オプション)
        data modify storage asset:mob Resist.Fire set value 0.8
    # 水倍率 (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/0138.combat_turret/summon/1.trigger
#
# Mob召喚処理の呼び出し時に実行されるfunction
#
# @within tag/function asset:mob/summon

execute if data storage asset:context {id:138} run function asset:mob/0138.combat_turret/summon/2.summon


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

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


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

execute if data storage asset:context {id:138} run function asset:mob/0138.combat_turret/hurt/2.hurt


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

# 演出
    particle minecraft:large_smoke ~ ~ ~ 0 0 0 0.4 10

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

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


text:
#> asset:mob/0138.combat_turret/tick/2.tick
#
#
#
# @within function asset:mob/0138.combat_turret/tick/1.trigger

# プレイヤー近くにいる時のみ実行
    execute unless score @s 3U.Time matches 80.. positioned ^ ^ ^10 if entity @p[gamemode=!spectator,distance=..10] at @s run function asset:mob/0138.combat_turret/tick/2.1.near_player

# スコア80以上なら強制実行
    execute if score @s 3U.Time matches 80.. run function asset:mob/0138.combat_turret/tick/2.1.near_player


text:
#> asset:mob/0138.combat_turret/tick/2.3.shot
#
# 発砲します
#
# @within function
#   asset:mob/0138.combat_turret/tick/2.2.ready
#   asset:mob/0138.combat_turret/tick/2.3.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.09 0.09 0.09 1 ~ ~ ~ 0 0 0 0 6
    execute if predicate lib:random_pass_per/10 run particle electric_spark ~ ~ ~ 0 0 0 0.05 6

# 着弾
    execute if entity @s[tag=Landing] run function asset:mob/0138.combat_turret/tick/2.4.damage

# 再起
    execute positioned ^ ^ ^0.5 if entity @s[tag=!Landing,distance=..30] run function asset:mob/0138.combat_turret/tick/2.3.shot


text:
#> asset:mob/0138.combat_turret/tick/2.5.reset
#
#
#
# @within function asset:mob/0138.combat_turret/tick/2.1.near_player
#> Private
# @private
    #declare score_holder $RandomDamage

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

# リセット処理
    data modify entity @s NoAI set value 0
    scoreboard players reset $RandomDamage Temporary


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

execute if data storage asset:context {id:138} run function asset:mob/0138.combat_turret/tick/2.tick


text:
#> asset:mob/0138.combat_turret/tick/2.2.ready
#
# 発砲準備をします
#
# @within function asset:mob/0138.combat_turret/tick/2.1.near_player
#> tag
# @private
    #declare tag SpreadMarker

# 前方拡散設定
    summon marker ~ ~ ~ {Tags:["SpreadMarker"]}
    data modify storage lib: Argument.Distance set value 4.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/0138.combat_turret/tick/2.3.shot

# 演出
    playsound minecraft:entity.zombie.attack_wooden_door hostile @a ~ ~ ~ 1 2
    playsound minecraft:entity.zombie.attack_wooden_door 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/0138.combat_turret/tick/2.1.near_player
#
# Mobのtick時の処理
#
# @within function asset:mob/0138.combat_turret/tick/2.tick

# スコアを増やします
    scoreboard players add @s 3U.Time 1

# 発砲準備でNoAIにする
    execute if score @s 3U.Time matches 80 run data modify entity @s NoAI set value 1

# 発砲します
    execute if score @s 3U.Time matches 90 positioned ^ ^-0.7 ^ run function asset:mob/0138.combat_turret/tick/2.2.ready
    execute if score @s 3U.Time matches 92 positioned ^ ^-0.7 ^ run function asset:mob/0138.combat_turret/tick/2.2.ready
    execute if score @s 3U.Time matches 94 positioned ^ ^-0.7 ^ run function asset:mob/0138.combat_turret/tick/2.2.ready

# 終了します
    execute if score @s 3U.Time matches 94 run function asset:mob/0138.combat_turret/tick/2.5.reset


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

# 元となるMobを召喚する
    summon skeleton ~ ~ ~ {Tags:["MobInit"],DeathLootTable:"asset:mob/death/0029.skeleton_archer"}
# ID (int)
    data modify storage asset:mob ID set value 29
# 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:"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
    # 脚 (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 120.0
# 攻撃力 (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 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 0.9
    # 魔法倍率 (float) (オプション)
        data modify storage asset:mob Resist.Magic set value 1.0
    # 火倍率 (float) (オプション)
        data modify storage asset:mob Resist.Fire set value 1
    # 水倍率 (float) (オプション)
        data modify storage asset:mob Resist.Water set value 0.8
    # 雷倍率 (float) (オプション)
        data modify storage asset:mob Resist.Thunder set value 0.8

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


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

execute if data storage asset:context {id:29} run function asset:mob/0029.skeleton_archer/summon/2.summon


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

#> 定義類はここに
# @within function asset:mob/0077.golden_watermelon/**
    scoreboard objectives add 25.Tick dummy


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

# 元となるMobを召喚する
    summon armor_stand ~ ~ ~ {Silent:1b,Marker:1b,NoGravity:1b,Invisible:1b,Tags:["MobInit"]}
# ID (int)
    data modify storage asset:mob ID set value 77
# 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":"#59FF75"},{"text":"ルデンスイカボ","color":"#F0FF1F"},{"text":"マー","color":"#59FF75"}]'
# 武器
    # メインハンド (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:melon",Count:1b,tag:{Enchantments:[{}]}}
    # 胴 (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
# 攻撃力 (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=armor_stand,tag=MobInit,distance=..0.01] run function asset:mob/common/summon


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

execute if data storage asset:context {id:77} run function asset:mob/0077.golden_watermelon/summon/2.summon


text:
#> asset:mob/0077.golden_watermelon/tick/5.explosion_2
#
#
#
# @within function asset:mob/0077.golden_watermelon/tick/4.explosion_charge

# 演出
    playsound entity.lightning_bolt.impact hostile @a ~ ~ ~ 1.6 1.7 0
    playsound entity.generic.explode hostile @a ~ ~ ~ 1.3 1 0
    particle dust 1 0.941 0.141 2 ~ ~5 ~ 0.1 3 0.1 0 60 normal @a
    particle smoke ~ ~1.5 ~ 2 0.5 2 0 100 normal @a

# スイカスライスを召喚
    summon item ~ ~ ~ {Age:5940s,PickupDelay:5s,Item:{id:"minecraft:glistering_melon_slice",Count:4b}}

# 雷属性ダメージ
    data modify storage lib: Argument.Damage set value 8.0
    data modify storage lib: Argument.AttackType set value "Physical"
    data modify storage lib: Argument.ElementType set value "Thunder"
    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 lib:damage/modifier
    execute as @a[tag=!PlayerShouldInvulnerable,distance=..3.5] run function lib:damage/
    function lib:damage/reset

# 消滅
    kill @s


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

# 前方へ行く処理
    execute unless score @s 25.Tick matches 20.. if block ^ ^1.5 ^1 #lib:no_collision if block ^ ^1.6 ^1.5 #lib:no_collision run tp @s ^ ^ ^1.5 ~ ~1.5

# スコア
    scoreboard players add @s 25.Tick 1

# 炸裂
    execute if score @s 25.Tick matches 20 run function asset:mob/0077.golden_watermelon/tick/3.explosion_1
    execute unless score @s 25.Tick matches 20.. if block ~ ~ ~ #lib:no_collision if entity @a[distance=..1.5] run function asset:mob/0077.golden_watermelon/tick/3.explosion_1
    execute unless score @s 25.Tick matches 20.. unless block ^ ^1 ^1 #lib:no_collision run function asset:mob/0077.golden_watermelon/tick/3.explosion_1

# 2段目爆発
    execute if score @s 25.Tick matches 20.. run function asset:mob/0077.golden_watermelon/tick/4.explosion_charge


text:
#> asset:mob/0077.golden_watermelon/tick/4.explosion_charge
#
#
#
# @within function asset:mob/0077.golden_watermelon/tick/2.tick

# 1段目炸裂時に地面へ落下
    execute positioned ~ ~1.6 ~ if block ~ ~-0.2 ~ #lib:no_collision run tp @s ~ ~-2 ~

# 2段目爆発
    execute if score @s 25.Tick matches 35.. run function asset:mob/0077.golden_watermelon/tick/5.explosion_2


text:
#> asset:mob/0077.golden_watermelon/tick/3.explosion_1
#
#
#
# @within function asset:mob/0077.golden_watermelon/tick/2.tick

# 演出
    playsound entity.firework_rocket.twinkle hostile @a ~ ~ ~ 1.6 1.7 0
    playsound entity.generic.explode hostile @a ~ ~ ~ 1.3 1 0
    particle dust 0.173 1 0.243 2 ~ ~1.6 ~ 0.8 0.8 0.8 0 30 normal @a
    particle explosion ~ ~1.6 ~ 1 1 1 0 10 normal @a

# 鈍化を付与
    effect give @a[tag=!PlayerShouldInvulnerable,distance=..2.5] slowness 1 1 true

# 水属性ダメージ
    data modify storage lib: Argument.Damage set value 8.0
    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 lib:damage/modifier
# 実行
    execute as @a[tag=!PlayerShouldInvulnerable,distance=..2.5] run function lib:damage/
# リセット
    function lib:damage/reset

# 自身に二段目爆発のためのスコアを付与
    scoreboard players set @s 25.Tick 20


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

execute if data storage asset:context {id:77} run function asset:mob/0077.golden_watermelon/tick/2.tick


text:
#> asset:mob/0083.thunder_trifler/_index.d
# @private

#> tag
# @within function asset:mob/0083.thunder_trifler/**
    #declare tag 2B.Sword


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

# 演出
   particle minecraft:dust 1 1 0 1 ~ ~ ~ 0.8 0.8 0.8 0.1 20 normal @a
   playsound minecraft:entity.firework_rocket.twinkle hostile @a ~ ~ ~ 0.7 1.0 0
   playsound minecraft:entity.firework_rocket.twinkle hostile @a ~ ~ ~ 0.7 0.8 0


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

execute if data storage asset:context {id:83} run function asset:mob/0083.thunder_trifler/death/2.death


text:
#> asset:mob/0083.thunder_trifler/summon/2.summon
#
# Mobの召喚時の処理
#
# @within function asset:mob/0083.thunder_trifler/summon/1.trigger
# 元となるMobを召喚する
    summon skeleton ~ ~ ~ {Silent:1b,Tags:["MobInit","AlwaysInvisible"],DeathLootTable:"asset:mob/death/0083.thunder_trifler"}
# ID (int)
    data modify storage asset:mob ID set value 83
# 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":"gold"}'
# 武器
    # メインハンド (Compound(Item)) (オプション)
        data modify storage asset:mob Weapon.Mainhand set value {id:"minecraft:bow",Count:1b,tag:{Enchantments:[{id:"punch",lvl:2s}]}}
    # オフハンド (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:"yellow_stained_glass",Count:1}
    # 胴 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Chest set value {id:"minecraft:leather_chestplate",Count:1b,tag:{display:{color:16777039}}}
    # 脚 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Legs set value {id:"minecraft:leather_leggings",Count:1b,tag:{display:{color:16777039}}}
    # 足 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Feet set value {id:"minecraft:leather_boots",Count:1b,tag:{display:{color:16777039}}}
# 防具ドロップ率 ([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 -3
# 防御力 (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.25
# 索敵範囲 (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 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.75
    # 雷倍率 (float) (オプション)
        data modify storage asset:mob Resist.Thunder set value 0.25

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


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

execute if data storage asset:context {id:83} run function asset:mob/0083.thunder_trifler/summon/2.summon


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

# 演出
   particle minecraft:dust 1 1 0 1 ~ ~ ~ 0.8 0.8 0.8 0.1 20 normal @a
   particle minecraft:firework ~ ~1 ~ 0.5 0.5 0.5 0 10 normal @a
   playsound minecraft:entity.firework_rocket.twinkle hostile @a ~ ~ ~ 0.7 1.4 0
   playsound minecraft:entity.firework_rocket.twinkle hostile @a ~ ~ ~ 0.7 0.9 0

#> SpreadLib
# @private
    #declare tag SpreadMarker

# マーカーをワープさせて、そこが安全地帯ならワープする
    execute at @p[tag=Attacker,distance=..50] run summon marker ~ ~ ~ {Tags:["SpreadMarker"]}
    execute at @p[tag=Attacker,distance=..50] run data modify storage lib: Argument.Bounds set value [[5d,5d],[0d,0d],[5d,5d]]
    execute as @e[type=marker,tag=SpreadMarker,distance=..60,limit=1] at @s run function lib:spread_entity/
    execute at @e[type=marker,tag=SpreadMarker,distance=..60,limit=1] if block ~ ~ ~ #lib:no_collision_without_fluid unless block ~ ~-1 ~ #lib:no_collision_without_fluid run tp @s ~ ~ ~
# 武器が剣の場合弓に切替
   execute if entity @s[tag=2B.Sword] run item replace entity @s weapon.mainhand with bow{Enchantments:[{id:"punch",lvl:2s}]}

# 剣Tag削除
    execute if entity @s[tag=2B.Sword] run tag @s remove 2B.Sword

# speedバフ消し
    effect clear @s speed
# リセット
    kill @e[type=marker,tag=SpreadMarker]


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

execute if data storage asset:context {id:83} run function asset:mob/0083.thunder_trifler/hurt/2.hurt


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

execute if data storage asset:context {id:83} run function asset:mob/0083.thunder_trifler/attack/2.attack


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

# 演出
   particle minecraft:dust 1 1 0 2 ~ ~ ~ 0.8 0.8 0.8 0.1 20 normal @a
   particle minecraft:firework ~ ~1 ~ 0.5 0.5 0.5 0 10 normal @a
   playsound minecraft:entity.firework_rocket.twinkle hostile @a ~ ~ ~ 0.7 1.5 0
   playsound minecraft:entity.firework_rocket.twinkle hostile @a ~ ~ ~ 0.7 2.0 0

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

# マナ減少
    scoreboard players set $Fluctuation Lib -15
    execute as @p[tag=Victim,distance=..50] run function lib:mp/fluctuation

# 弓から剣に切り替えた場合speedを得る
    execute if entity @s[tag=!2B.Sword] run effect give @s speed 500 0 true
       # 弓から切り替えた瞬間にワープ
       execute if entity @s[tag=!2B.Sword] run tp @s @p[tag=Victim,distance=..32]

# 攻撃が当たった場合武器が弓なら剣に切替(挙動の関係上最後に配置)
    execute if entity @s[tag=!2B.Sword] run item replace entity @s weapon.mainhand with golden_sword{Enchantments:[{}]}

# 剣Tag付与
    execute if entity @s[tag=!2B.Sword] run tag @s add 2B.Sword


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

#> 定義類はここに
# @within function asset:mob/0151.recombined/**
    scoreboard objectives add 47.DefDownTime dummy


text:
#> asset:mob/0151.recombined/rejoin_process
#
# 使い方は必ずwikiを見ること
#
# @within tag/function asset:rejoin
# ループ
    execute if entity @a[tag=25.DefDown] run schedule function asset:mob/0151.recombined/attack/3.scheduleloop 1t


text:
#> asset:mob/0151.recombined/_index.d
# @private

#> tag
# @within function
#   asset:mob/0151.recombined/**
    #declare tag 25.DefDown
    #alias uuid 1-2-151-0 1-0-2-0-9700000000


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

# 演出
    particle block redstone_block ~ ~1.3 ~ 0 0 0 1 100
    playsound entity.ravager.death hostile @a


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

execute if data storage asset:context {id:151} run function asset:mob/0151.recombined/death/2.death


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

# 元となるMobを召喚する
    summon skeleton ~ ~ ~ {Tags:["MobInit","AlwaysInvisible"],Silent:1b,DeathLootTable:"asset:mob/death/0151.recombined"}
# ID (int)
    data modify storage asset:mob ID set value 151
# 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":"#BABABA"},{"text":"換","color":"#8A8A8A"}]'
# 武器
    # メインハンド (Compound(Item)) (オプション)
        data modify storage asset:mob Weapon.Mainhand set value {id:"iron_axe",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:"minecraft:smooth_quartz_slab",Count:1b}
    # 胴 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Chest set value {id:"minecraft:leather_chestplate",Count:1b,tag:{display:{color:11579568}}}
    # 脚 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Legs set value {id:"minecraft:leather_leggings",Count:1b,tag:{display:{color:8553090}}}
    # 足 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Feet set value {id:"minecraft:leather_boots",Count:1b,tag:{display:{color:5066061}}}
# 防具ドロップ率 ([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 5
# 防御力 (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
# 索敵範囲 (double) (オプション)
    # data modify storage asset:mob FollowRange set value
# ノックバック耐性 (double) (オプション)
    data modify storage asset:mob KnockBackResist set value 0.6
# 属性倍率 // 1.0fで100% 最低でも25%は軽減されずに入る
    # 物理倍率 (float) (オプション)
        data modify storage asset:mob Resist.Physical set value 0.75
    # 魔法倍率 (float) (オプション)
        data modify storage asset:mob Resist.Magic set value 0.6
    # 火倍率 (float) (オプション)
        data modify storage asset:mob Resist.Fire set value 0.8
    # 水倍率 (float) (オプション)
        data modify storage asset:mob Resist.Water set value 0.7
    # 雷倍率 (float) (オプション)
        data modify storage asset:mob Resist.Thunder set value 0.85

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


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

execute if data storage asset:context {id:151} run function asset:mob/0151.recombined/summon/2.summon


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

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


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

execute if data storage asset:context {id:151} run function asset:mob/0151.recombined/hurt/2.hurt


text:
#> asset:mob/0151.recombined/attack/4.def_down
#
#
#
# @within function asset:mob/0151.recombined/attack/3.scheduleloop

# 演出
    execute if predicate lib:random_pass_per/20 run particle minecraft:soul ~ ~1.3 ~ 0.2 0.2 0.2 0.06 2

# スコアをへらす
    scoreboard players remove @s 47.DefDownTime 1

# 途中で死んだ時
    execute if entity @s[tag=Death] run tag @s remove 25.DefDown

# 0になった時
    execute if score @s 47.DefDownTime matches 0 run playsound entity.generic.extinguish_fire player @a ~ ~ ~ 1 1
    execute if score @s 47.DefDownTime matches 0 run attribute @s minecraft:generic.armor modifier remove 1-0-2-0-9700000000
    execute if score @s 47.DefDownTime matches 0 run tag @s remove 25.DefDown


text:
#> asset:mob/0151.recombined/attack/3.scheduleloop
#
#
#
# @within function
#   asset:mob/0151.recombined/attack/2.attack
#   asset:mob/0151.recombined/attack/3.scheduleloop
#   asset:mob/0151.recombined/rejoin_process

# 発動中
    execute as @a[tag=25.DefDown] at @s run function asset:mob/0151.recombined/attack/4.def_down

# ループ
    execute if entity @a[tag=25.DefDown] run schedule function asset:mob/0151.recombined/attack/3.scheduleloop 1t


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

execute if data storage asset:context {id:151} run function asset:mob/0151.recombined/attack/2.attack


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

# 与えるダメージ
    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 "None"
# 補正functionを実行
    function lib:damage/modifier
# 対象
    execute as @p[tag=Victim] run function lib:damage/
# リセット
    function lib:damage/reset

# 演出
    playsound minecraft:entity.ghast.hurt hostile @a ~ ~ ~ 0.3 1.6
    playsound minecraft:entity.enderman.scream hostile @a ~ ~ ~ 0.4 2

# 腕を振る
    item replace entity @s weapon with iron_axe

# プレイヤーの防具力を下げる(40)
    attribute @p[tag=Victim] minecraft:generic.armor modifier add 1-0-2-0-9700000000 "1-2-151-0" -0.4 multiply

# タグを付与
    tag @p[tag=Victim] add 25.DefDown
# スコアを付与
    scoreboard players set @p[tag=Victim] 47.DefDownTime 60

# Scheduleを発動
    schedule function asset:mob/0151.recombined/attack/3.scheduleloop 1t


text:
#> asset:mob/0152.desire/_index.d
# @private

#> tag
# @within function asset:mob/0152.desire/**
    #declare tag RunOnce
    #declare tag 48.HasMP


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

# 演出
    particle minecraft:cloud ~ ~1.3 ~ 0 0 0 0.3 100
    playsound minecraft:entity.evoker.prepare_attack hostile @a ~ ~ ~ 1 2


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

execute if data storage asset:context {id:152} run function asset:mob/0152.desire/death/2.death


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

# 元となるMobを召喚する
    summon skeleton ~ ~ ~ {Tags:["MobInit"],DeathLootTable:"asset:mob/death/0152.desire"}
# ID (int)
    data modify storage asset:mob ID set value 152
# 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":"#FF14F7"}'
# 武器
    # メインハンド (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:bubble_coral_block",Count:1b}
    # 胴 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Chest set value {id:"minecraft:leather_chestplate",Count:1b,tag:{display:{color:16719088}}}
    # 脚 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Legs set value {id:"minecraft:leather_leggings",Count:1b,tag:{display:{color:16719088}}}
    # 足 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Feet set value {id:"minecraft:leather_boots",Count:1b,tag:{display:{color:16719088}}}
# 防具ドロップ率 ([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 8
# 防御力 (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
# 索敵範囲 (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.7
    # 魔法倍率 (float) (オプション)
        data modify storage asset:mob Resist.Magic set value 1
    # 火倍率 (float) (オプション)
        data modify storage asset:mob Resist.Fire set value 0.4
    # 水倍率 (float) (オプション)
        data modify storage asset:mob Resist.Water set value 0.6
    # 雷倍率 (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/0152.desire/summon/1.trigger
#
# Mob召喚処理の呼び出し時に実行されるfunction
#
# @within tag/function asset:mob/summon

execute if data storage asset:context {id:152} run function asset:mob/0152.desire/summon/2.summon


text:
#> asset:mob/0152.desire/attack/4.release
#
#
#
# @within function asset:mob/0152.desire/attack/2.attack

# 与えるダメージ
    data modify storage lib: Argument.Damage set value 55f
# 属性
    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,distance=..32] run function lib:damage/
# リセット
    function lib:damage/reset

# 演出
    playsound minecraft:entity.evoker.prepare_summon hostile @a ~ ~ ~ 1 2
    playsound minecraft:entity.wither.hurt hostile @a ~ ~ ~ 1 1
    execute as @p[tag=Victim,distance=..10] at @s run particle minecraft:dragon_breath ~ ~1 ~ 0.5 0.5 0.5 0.03 200

# タグリセット
    tag @s remove RunOnce
    tag @s remove 48.HasMP


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

execute if data storage asset:context {id:152} run function asset:mob/0152.desire/attack/2.attack


text:
#> asset:mob/0152.desire/attack/3.absorption
#
#
#
# @within function asset:mob/0152.desire/attack/2.attack
#> private
# @private
    #declare score_holder $MPCheck
    #declare tag EmptyMP

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

# マナが無いプレイヤーを殴った時
    # ダメージ設定
        data modify storage lib: Argument.Damage set value 50f
        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=Victim,tag=EmptyMP] run function lib:damage/
        function lib:damage/reset

# マナが十分にあるプレイヤーを殴ったとき
    # ダメージ設定
        data modify storage lib: Argument.Damage set value 35f
        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=Victim,tag=!EmptyMP] run function lib:damage/
        function lib:damage/reset

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

# 演出
    particle minecraft:end_rod ~ ~1 ~ 0 0 0 0.2 100
    playsound minecraft:entity.glow_squid.death hostile @a

# 自分にタグを付与する
    execute if entity @p[tag=Victim,tag=!EmptyMP] run tag @s add 48.HasMP

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


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

# タグを付与する
    tag @s add RunOnce

# MPを吸収する攻撃
    execute if entity @s[tag=RunOnce,tag=!48.HasMP] run function asset:mob/0152.desire/attack/3.absorption

# MPを吸収した後に放つ攻撃
    execute if entity @s[tag=RunOnce,tag=48.HasMP] run function asset:mob/0152.desire/attack/4.release


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

#> 定義類はここに
# @within function asset:mob/0105.potion_projectile/**
    scoreboard objectives add 2X.Tick dummy
    scoreboard objectives add 2X.InBlockTime dummy


text:
#> asset:mob/0105.potion_projectile/_index.d
# @private
#
#> tag
# @within function asset:mob/0105.potion_projectile/**
    #declare tag 2X.Poison
    #declare tag 2X.Fire
    #declare tag 2X.Water
    #declare tag 2X.Thunder
    #declare tag 2X.AlreadyBroken
    #declare tag 2X.Potion


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

# 元となるMobを召喚する
    summon armor_stand ~ ~ ~ {Invisible:1b,Marker:1b,Tags:["MobInit","2X.Potion"]}
# ID (int)
    data modify storage asset:mob ID set value 105
# 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":"white"}'

# ポーションの色を合わせる
    execute if entity @s[tag=2W.Poison] run data modify storage asset:mob Armor.Head set value {id:"splash_potion",Count:1b,tag:{CustomPotionColor:26112}}
    execute if entity @s[tag=2W.Fire] run data modify storage asset:mob Armor.Head set value {id:"splash_potion",Count:1b,tag:{CustomPotionColor:13369344}}
    execute if entity @s[tag=2W.Water] run data modify storage asset:mob Armor.Head set value {id:"splash_potion",Count:1b,tag:{CustomPotionColor:8454143}}
    execute if entity @s[tag=2W.Thunder] run data modify storage asset:mob Armor.Head set value {id:"splash_potion",Count:1b,tag:{CustomPotionColor:16776960}}

# ポーションにタグ付け
    execute if entity @s[tag=2W.Poison] run tag @e[type=armor_stand,tag=MobInit,distance=..0.01] add 2X.Poison
    execute if entity @s[tag=2W.Fire] run tag @e[type=armor_stand,tag=MobInit,distance=..0.01] add 2X.Fire
    execute if entity @s[tag=2W.Water] run tag @e[type=armor_stand,tag=MobInit,distance=..0.01] add 2X.Water
    execute if entity @s[tag=2W.Thunder] run tag @e[type=armor_stand,tag=MobInit,distance=..0.01] add 2X.Thunder

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


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

execute if data storage asset:context {id:105} run function asset:mob/0105.potion_projectile/summon/2.summon


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

# スコア
    scoreboard players add @s 2X.Tick 1

# 移動
    execute if entity @s[tag=!2X.AlreadyBroken] if block ~ ~2.0 ~ #lib:no_collision run tp @s ^ ^ ^0.8 ~ ~1

# プレイヤーとの接触判定
    execute if entity @s[tag=!2X.AlreadyBroken] if entity @a[distance=..1] run function asset:mob/0105.potion_projectile/tick/3.break_potion

# 頭のポーションの位置が当たり判定のあるブロックなら実行
    execute if entity @s[tag=!2X.AlreadyBroken] positioned ~ ~2 ~ unless block ~ ~ ~ #lib:no_collision run function asset:mob/0105.potion_projectile/tick/3.break_potion

# 5.break_potionが実行された位置でメインの演出
    execute if entity @s[tag=2X.AlreadyBroken] positioned ~ ~2.3 ~ run function asset:mob/0105.potion_projectile/tick/4.element_branch

# 一定時間経過によるkill
    execute if score @s 2X.Tick matches 150.. run kill @s


text:
#> asset:mob/0105.potion_projectile/tick/3.break_potion
#
#
# @within function asset:mob/0105.potion_projectile/tick/2.tick

# ポーション消し
    item replace entity @s armor.head with air

# 演出
    playsound entity.splash_potion.break hostile @a ~ ~ ~ 1 1 0
    particle block glass ~ ~ ~ 0 0 0 0 5

# 割れた判定Tagを付与
    tag @s add 2X.AlreadyBroken


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

execute if data storage asset:context {id:105} run function asset:mob/0105.potion_projectile/tick/2.tick


text:
#> asset:mob/0105.potion_projectile/tick/4.element_branch
#
#
#
# @within function asset:mob/0105.potion_projectile/tick/2.tick

# 分岐
    execute if entity @s[tag=2X.Poison] run function asset:mob/0105.potion_projectile/tick/poison/1.tick
    execute if entity @s[tag=2X.Fire] run function asset:mob/0105.potion_projectile/tick/fire/1.explosion
    execute if entity @s[tag=2X.Water] run function asset:mob/0105.potion_projectile/tick/water/1.break
    execute if entity @s[tag=2X.Thunder] run function asset:mob/0105.potion_projectile/tick/thunder/1.break


text:
#> asset:mob/0105.potion_projectile/tick/fire/2.fire_damage
#
#
#
# @within function asset:mob/0105.potion_projectile/tick/fire/1.explosion

# 火属性ダメージ
    data modify storage lib: Argument.Damage set value 25f
    data modify storage lib: Argument.AttackType set value "Magic"
    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}]}]'
    function lib:damage/modifier
    execute as @a[tag=!PlayerShouldInvulnerable,distance=..4] run function lib:damage/
    function lib:damage/reset


text:
#> asset:mob/0105.potion_projectile/tick/fire/1.explosion
#
#
#
# @within function asset:mob/0105.potion_projectile/tick/4.element_branch

# 爆発演出
    particle explosion ~ ~1.2 ~ 0.6 0.4 0.6 0 10 normal @a
    particle lava ~ ~1.2 ~ 1 0.4 1 0 50 normal @a
    playsound entity.generic.explode hostile @a ~ ~ ~ 0.7 1 0
    execute rotated 0 0 run function asset:mob/0105.potion_projectile/tick/fire/particle.1
# ダメージ
    execute if entity @a[tag=!PlayerShouldInvulnerable,distance=..4] run function asset:mob/0105.potion_projectile/tick/fire/2.fire_damage

# キル
    kill @s


text:
#> asset:mob/0105.potion_projectile/tick/fire/particle.1
#
#
#
# @within function asset:mob/0105.potion_projectile/tick/fire/1.explosion
# [ImportKey]: NobwRALgngDgpmAXGAxgSwE4oDYIDRgB2AhgLYLKBhigAQBMYBMxGZAzkuCgPYCuhESWgAYCKOPzgYOYAB5IRYKPIC+BFgBM0PdoiEA6AGwFWEZgN0E42bGhisKARiEKMXUxApDlq8NHhIwGC5sKABzLkIGIjIKMEAsTUAlyMAjfWoHKKYWUh1OXn4kAHZRcQ8pRHA5C0UVNWJNbSQHPQAOY1MMcwUrGztHZzU3Yg95US4MQkkkIzAAKx5SGEECADc4AC80Cd1vAF0gA
# 多角形 1
particle flame ^0 ^ ^-1.8 0 0 0 0 1
particle flame ^0.22269 ^ ^-1.41429 0 0 0 0 1
particle flame ^0.44538 ^ ^-1.02857 0 0 0 0 1
particle flame ^0.66808 ^ ^-0.64286 0 0 0 0 1
particle flame ^0.89077 ^ ^-0.25714 0 0 0 0 1
particle flame ^1.11346 ^ ^0.12857 0 0 0 0 1
particle flame ^1.33615 ^ ^0.51429 0 0 0 0 1
particle flame ^1.55885 ^ ^-0.9 0 0 0 0 1
particle flame ^1.33615 ^ ^-0.51429 0 0 0 0 1
particle flame ^1.11346 ^ ^-0.12857 0 0 0 0 1
particle flame ^0.89077 ^ ^0.25714 0 0 0 0 1
particle flame ^0.66808 ^ ^0.64286 0 0 0 0 1
particle flame ^0.44538 ^ ^1.02857 0 0 0 0 1
particle flame ^0.22269 ^ ^1.41429 0 0 0 0 1
particle flame ^1.55885 ^ ^0.9 0 0 0 0 1
particle flame ^1.11346 ^ ^0.9 0 0 0 0 1
particle flame ^0.66808 ^ ^0.9 0 0 0 0 1
particle flame ^0.22269 ^ ^0.9 0 0 0 0 1
particle flame ^-0.22269 ^ ^0.9 0 0 0 0 1
particle flame ^-0.66808 ^ ^0.9 0 0 0 0 1
particle flame ^-1.11346 ^ ^0.9 0 0 0 0 1
particle flame ^0 ^ ^1.8 0 0 0 0 1
particle flame ^-0.22269 ^ ^1.41429 0 0 0 0 1
particle flame ^-0.44538 ^ ^1.02857 0 0 0 0 1
particle flame ^-0.66808 ^ ^0.64286 0 0 0 0 1
particle flame ^-0.89077 ^ ^0.25714 0 0 0 0 1
particle flame ^-1.11346 ^ ^-0.12857 0 0 0 0 1
particle flame ^-1.33615 ^ ^-0.51429 0 0 0 0 1
particle flame ^-1.55885 ^ ^0.9 0 0 0 0 1
particle flame ^-1.33615 ^ ^0.51429 0 0 0 0 1
particle flame ^-1.11346 ^ ^0.12857 0 0 0 0 1
particle flame ^-0.89077 ^ ^-0.25714 0 0 0 0 1
particle flame ^-0.66808 ^ ^-0.64286 0 0 0 0 1
particle flame ^-0.44538 ^ ^-1.02857 0 0 0 0 1
particle flame ^-0.22269 ^ ^-1.41429 0 0 0 0 1
particle flame ^-1.55885 ^ ^-0.9 0 0 0 0 1
particle flame ^-1.11346 ^ ^-0.9 0 0 0 0 1
particle flame ^-0.66808 ^ ^-0.9 0 0 0 0 1
particle flame ^-0.22269 ^ ^-0.9 0 0 0 0 1
particle flame ^0.22269 ^ ^-0.9 0 0 0 0 1
particle flame ^0.66808 ^ ^-0.9 0 0 0 0 1
particle flame ^1.11346 ^ ^-0.9 0 0 0 0 1
# 円 2
particle flame ^0 ^ ^-0.6 0 0 0 0 1
particle flame ^0.18541 ^ ^-0.57063 0 0 0 0 1
particle flame ^0.35267 ^ ^-0.48541 0 0 0 0 1
particle flame ^0.48541 ^ ^-0.35267 0 0 0 0 1
particle flame ^0.57063 ^ ^-0.18541 0 0 0 0 1
particle flame ^0.6 ^ ^0 0 0 0 0 1
particle flame ^0.57063 ^ ^0.18541 0 0 0 0 1
particle flame ^0.48541 ^ ^0.35267 0 0 0 0 1
particle flame ^0.35267 ^ ^0.48541 0 0 0 0 1
particle flame ^0.18541 ^ ^0.57063 0 0 0 0 1
particle flame ^0 ^ ^0.6 0 0 0 0 1
particle flame ^-0.18541 ^ ^0.57063 0 0 0 0 1
particle flame ^-0.35267 ^ ^0.48541 0 0 0 0 1
particle flame ^-0.48541 ^ ^0.35267 0 0 0 0 1
particle flame ^-0.57063 ^ ^0.18541 0 0 0 0 1
particle flame ^-0.6 ^ ^0 0 0 0 0 1
particle flame ^-0.57063 ^ ^-0.18541 0 0 0 0 1
particle flame ^-0.48541 ^ ^-0.35267 0 0 0 0 1
particle flame ^-0.35267 ^ ^-0.48541 0 0 0 0 1
particle flame ^-0.18541 ^ ^-0.57063 0 0 0 0 1

# 円 2
particle flame ^0 ^ ^-3 0 0 0 0 1
particle flame ^0.4693 ^ ^-2.96307 0 0 0 0 1
particle flame ^0.92705 ^ ^-2.85317 0 0 0 0 1
particle flame ^1.36197 ^ ^-2.67302 0 0 0 0 1
particle flame ^1.76336 ^ ^-2.42705 0 0 0 0 1
particle flame ^2.12132 ^ ^-2.12132 0 0 0 0 1
particle flame ^2.42705 ^ ^-1.76336 0 0 0 0 1
particle flame ^2.67302 ^ ^-1.36197 0 0 0 0 1
particle flame ^2.85317 ^ ^-0.92705 0 0 0 0 1
particle flame ^2.96307 ^ ^-0.4693 0 0 0 0 1
particle flame ^3 ^ ^0 0 0 0 0 1
particle flame ^2.96307 ^ ^0.4693 0 0 0 0 1
particle flame ^2.85317 ^ ^0.92705 0 0 0 0 1
particle flame ^2.67302 ^ ^1.36197 0 0 0 0 1
particle flame ^2.42705 ^ ^1.76336 0 0 0 0 1
particle flame ^2.12132 ^ ^2.12132 0 0 0 0 1
particle flame ^1.76336 ^ ^2.42705 0 0 0 0 1
particle flame ^1.36197 ^ ^2.67302 0 0 0 0 1
particle flame ^0.92705 ^ ^2.85317 0 0 0 0 1
particle flame ^0.4693 ^ ^2.96307 0 0 0 0 1
particle flame ^0 ^ ^3 0 0 0 0 1
particle flame ^-0.4693 ^ ^2.96307 0 0 0 0 1
particle flame ^-0.92705 ^ ^2.85317 0 0 0 0 1
particle flame ^-1.36197 ^ ^2.67302 0 0 0 0 1
particle flame ^-1.76336 ^ ^2.42705 0 0 0 0 1
particle flame ^-2.12132 ^ ^2.12132 0 0 0 0 1
particle flame ^-2.42705 ^ ^1.76336 0 0 0 0 1
particle flame ^-2.67302 ^ ^1.36197 0 0 0 0 1
particle flame ^-2.85317 ^ ^0.92705 0 0 0 0 1
particle flame ^-2.96307 ^ ^0.4693 0 0 0 0 1
particle flame ^-3 ^ ^0 0 0 0 0 1
particle flame ^-2.96307 ^ ^-0.4693 0 0 0 0 1
particle flame ^-2.85317 ^ ^-0.92705 0 0 0 0 1
particle flame ^-2.67302 ^ ^-1.36197 0 0 0 0 1
particle flame ^-2.42705 ^ ^-1.76336 0 0 0 0 1
particle flame ^-2.12132 ^ ^-2.12132 0 0 0 0 1
particle flame ^-1.76336 ^ ^-2.42705 0 0 0 0 1
particle flame ^-1.36197 ^ ^-2.67302 0 0 0 0 1
particle flame ^-0.92705 ^ ^-2.85317 0 0 0 0 1
particle flame ^-0.4693 ^ ^-2.96307 0 0 0 0 1
# 円 4
particle flame ^0 ^ ^-2 0 0 0 0 1
particle flame ^0.35711 ^ ^-1.96786 0 0 0 0 1
particle flame ^0.70275 ^ ^-1.87247 0 0 0 0 1
particle flame ^1.0258 ^ ^-1.7169 0 0 0 0 1
particle flame ^1.31588 ^ ^-1.50614 0 0 0 0 1
particle flame ^1.56366 ^ ^-1.24698 0 0 0 0 1
particle flame ^1.76119 ^ ^-0.94774 0 0 0 0 1
particle flame ^1.90211 ^ ^-0.61803 0 0 0 0 1
particle flame ^1.9819 ^ ^-0.26847 0 0 0 0 1
particle flame ^1.99799 ^ ^0.08973 0 0 0 0 1
particle flame ^1.94986 ^ ^0.44504 0 0 0 0 1
particle flame ^1.83906 ^ ^0.78605 0 0 0 0 1
particle flame ^1.66915 ^ ^1.10179 0 0 0 0 1
particle flame ^1.44559 ^ ^1.38213 0 0 0 0 1
particle flame ^1.17557 ^ ^1.61803 0 0 0 0 1
particle flame ^0.86777 ^ ^1.80194 0 0 0 0 1
particle flame ^0.53207 ^ ^1.92793 0 0 0 0 1
particle flame ^0.17928 ^ ^1.99195 0 0 0 0 1
particle flame ^-0.17928 ^ ^1.99195 0 0 0 0 1
particle flame ^-0.53207 ^ ^1.92793 0 0 0 0 1
particle flame ^-0.86777 ^ ^1.80194 0 0 0 0 1
particle flame ^-1.17557 ^ ^1.61803 0 0 0 0 1
particle flame ^-1.44559 ^ ^1.38213 0 0 0 0 1
particle flame ^-1.66915 ^ ^1.10179 0 0 0 0 1
particle flame ^-1.83906 ^ ^0.78605 0 0 0 0 1
particle flame ^-1.94986 ^ ^0.44504 0 0 0 0 1
particle flame ^-1.99799 ^ ^0.08973 0 0 0 0 1
particle flame ^-1.9819 ^ ^-0.26847 0 0 0 0 1
particle flame ^-1.90211 ^ ^-0.61803 0 0 0 0 1
particle flame ^-1.76119 ^ ^-0.94774 0 0 0 0 1
particle flame ^-1.56366 ^ ^-1.24698 0 0 0 0 1
particle flame ^-1.31588 ^ ^-1.50614 0 0 0 0 1
particle flame ^-1.0258 ^ ^-1.7169 0 0 0 0 1
particle flame ^-0.70275 ^ ^-1.87247 0 0 0 0 1
particle flame ^-0.35711 ^ ^-1.96786 0 0 0 0 1
# 多角形 3
particle flame ^0 ^ ^-4 0 0 0 0 1
particle flame ^0.23816 ^ ^-3.4625 0 0 0 0 1
particle flame ^0.43301 ^ ^-2.95 0 0 0 0 1
particle flame ^0.58457 ^ ^-2.4625 0 0 0 0 1
particle flame ^0.69282 ^ ^-2 0 0 0 0 1
particle flame ^0.75777 ^ ^-1.5625 0 0 0 0 1
particle flame ^0.77942 ^ ^-1.15 0 0 0 0 1
particle flame ^0.75777 ^ ^-0.7625 0 0 0 0 1
particle flame ^0.69282 ^ ^-0.4 0 0 0 0 1
particle flame ^0.58457 ^ ^-0.0625 0 0 0 0 1
particle flame ^0.43301 ^ ^0.25 0 0 0 0 1
particle flame ^0.23816 ^ ^0.5375 0 0 0 0 1
particle flame ^0 ^ ^0.8 0 0 0 0 1
particle flame ^-0.28146 ^ ^1.0375 0 0 0 0 1
particle flame ^-0.60622 ^ ^1.25 0 0 0 0 1
particle flame ^-0.97428 ^ ^1.4375 0 0 0 0 1
particle flame ^-1.38564 ^ ^1.6 0 0 0 0 1
particle flame ^-1.8403 ^ ^1.7375 0 0 0 0 1
particle flame ^-2.33827 ^ ^1.85 0 0 0 0 1
particle flame ^-2.87953 ^ ^1.9375 0 0 0 0 1
particle flame ^3.4641 ^ ^2 0 0 0 0 1
particle flame ^2.87953 ^ ^1.9375 0 0 0 0 1
particle flame ^2.33827 ^ ^1.85 0 0 0 0 1
particle flame ^1.8403 ^ ^1.7375 0 0 0 0 1
particle flame ^1.38564 ^ ^1.6 0 0 0 0 1
particle flame ^0.97428 ^ ^1.4375 0 0 0 0 1
particle flame ^0.60622 ^ ^1.25 0 0 0 0 1
particle flame ^0.28146 ^ ^1.0375 0 0 0 0 1
particle flame ^0 ^ ^0.8 0 0 0 0 1
particle flame ^-0.23816 ^ ^0.5375 0 0 0 0 1
particle flame ^-0.43301 ^ ^0.25 0 0 0 0 1
particle flame ^-0.58457 ^ ^-0.0625 0 0 0 0 1
particle flame ^-0.69282 ^ ^-0.4 0 0 0 0 1
particle flame ^-0.75777 ^ ^-0.7625 0 0 0 0 1
particle flame ^-0.77942 ^ ^-1.15 0 0 0 0 1
particle flame ^-0.75777 ^ ^-1.5625 0 0 0 0 1
particle flame ^-0.69282 ^ ^-2 0 0 0 0 1
particle flame ^-0.58457 ^ ^-2.4625 0 0 0 0 1
particle flame ^-0.43301 ^ ^-2.95 0 0 0 0 1
particle flame ^-0.23816 ^ ^-3.4625 0 0 0 0 1
particle flame ^-3.4641 ^ ^2 0 0 0 0 1
particle flame ^-3.11769 ^ ^1.525 0 0 0 0 1
particle flame ^-2.77128 ^ ^1.1 0 0 0 0 1
particle flame ^-2.42487 ^ ^0.725 0 0 0 0 1
particle flame ^-2.07846 ^ ^0.4 0 0 0 0 1
particle flame ^-1.73205 ^ ^0.125 0 0 0 0 1
particle flame ^-1.38564 ^ ^-0.1 0 0 0 0 1
particle flame ^-1.03923 ^ ^-0.275 0 0 0 0 1
particle flame ^-0.69282 ^ ^-0.4 0 0 0 0 1
particle flame ^-0.34641 ^ ^-0.475 0 0 0 0 1
particle flame ^0 ^ ^-0.5 0 0 0 0 1
particle flame ^0.34641 ^ ^-0.475 0 0 0 0 1
particle flame ^0.69282 ^ ^-0.4 0 0 0 0 1
particle flame ^1.03923 ^ ^-0.275 0 0 0 0 1
particle flame ^1.38564 ^ ^-0.1 0 0 0 0 1
particle flame ^1.73205 ^ ^0.125 0 0 0 0 1
particle flame ^2.07846 ^ ^0.4 0 0 0 0 1
particle flame ^2.42487 ^ ^0.725 0 0 0 0 1
particle flame ^2.77128 ^ ^1.1 0 0 0 0 1
particle flame ^3.11769 ^ ^1.525 0 0 0 0 1


text:
#> asset:mob/0105.potion_projectile/tick/thunder/1.break
#
#
#
# @within function asset:mob/0105.potion_projectile/tick/4.element_branch

# 演出
    particle dust 1 1 0 1.5 ~ ~1.2 ~ 1 0.4 1 0 60 normal @a
    particle firework ~ ~1.2 ~ 1 0.4 1 0.1 40 normal @a
    playsound entity.firework_rocket.twinkle hostile @a ~ ~ ~ 0.8 2 0
    playsound entity.firework_rocket.twinkle hostile @a ~ ~ ~ 0.8 1.5 0

    particle dust 1 1 0 1 ~ ~3 ~ 0.7 3 0.7 0 300
    particle dust 1 1 0 1 ~ ~5 ~ 0.1 5 0.1 0 300
    particle minecraft:explosion ~ ~ ~ 0.3 0 0.3 0 10
    particle minecraft:large_smoke ~ ~ ~ 0 0 0 0.4 100

    playsound entity.lightning_bolt.thunder hostile @a ~ ~ ~ 1 2
    playsound entity.lightning_bolt.thunder hostile @a ~ ~ ~ 1 2
    playsound entity.lightning_bolt.impact hostile @a ~ ~ ~ 1 0

# ダメージとMP減少
    execute if entity @a[tag=!PlayerShouldInvulnerable,distance=..3] run function asset:mob/0105.potion_projectile/tick/thunder/2.thunder_damage

# キル
    kill @s


text:
#> asset:mob/0105.potion_projectile/tick/thunder/mp_reduce
#
#
#
# @within function asset:mob/0105.potion_projectile/tick/thunder/2.thunder_damage

# MP減らす
    scoreboard players set $Fluctuation Lib -20
    function lib:mp/fluctuation


text:
#> asset:mob/0105.potion_projectile/tick/thunder/2.thunder_damage
#
#
#
# @within function asset:mob/0105.potion_projectile/tick/thunder/1.break
#> Private
# @private
    #declare score_holder $Fluctuation

# 雷属性ダメージ
    data modify storage lib: Argument.Damage set value 25.0
    data modify storage lib: Argument.AttackType set value "Magic"
    data modify storage lib: Argument.ElementType set value "Thunder"
    data modify storage lib: Argument.DeathMessage append value '[{"translate": "%1$sは%2$sの雷の薬品により感電死した","with":[{"selector":"@s"},{"nbt":"Return.AttackerName","storage":"lib:","interpret":true}]}]'
    function lib:damage/modifier
    execute as @a[tag=!PlayerShouldInvulnerable,distance=..3] run function lib:damage/
    function lib:damage/reset

# MP減少
    execute as @a[distance=..3] run function asset:mob/0105.potion_projectile/tick/thunder/mp_reduce