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

# 元となるMobを召喚する
    summon zombie ~ ~ ~ {Tags:["MobInit","AlwaysInvisible"],IsBaby:1b,NoAI:1b,Silent:1b,DeathLootTable:"asset:mob/death/0274.death_saw_jiki"}
# ID (int)
    data modify storage asset:mob ID set value 274
# Type (string) Wikiを参照
    data modify storage asset:mob Type set value "Enemy"
# 干渉可能か否か (boolean)
    data modify storage asset:mob Interferable set value true
# 名前 (TextComponentString) (オプション)
    data modify storage asset:mob Name set value '{"text":"デスソージキ"}'
# 武器
    # メインハンド (Compound(Item)) (オプション)
        # data modify storage asset:mob Weapon.Mainhand set value
    # オフハンド (Compound(Item)) (オプション)
        # data modify storage asset:mob Weapon.Offhand set value
# 武器ドロップ率 ([float, float]) (オプション)
    # data modify storage asset:mob WeaponDropChances set value
# 防具
    # 頭 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Head set value {id:"minecraft:stick",Count:1b,tag:{CustomModelData:20156}}
    # 胴 (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 2900
# 攻撃力 (double) (オプション)
    # data modify storage asset:mob AttackDamage set value
# 防御力 (double) (オプション) // 被ダメージがある程度大きい場合1ptにつき0.8%カット、小さい場合1ptにつき約4%カット 20pt以上は頭打ち
    # data modify storage asset:mob Defense set value
# 特殊防御力 (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.6
    # 魔法倍率 (float) (オプション)
        data modify storage asset:mob Resist.Magic set value 1
    # 火倍率 (float) (オプション)
        data modify storage asset:mob Resist.Fire set value 0.9
    # 水倍率 (float) (オプション)
        data modify storage asset:mob Resist.Water set value 1
    # 雷倍率 (float) (オプション)
        data modify storage asset:mob Resist.Thunder set value 0.9

# スコアを設定
    scoreboard players set @e[type=zombie,tag=MobInit,distance=..0.01] 7M.CoolTime 20

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


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

execute if data storage asset:context {id:274} run function asset:mob/0274.death_saw_jiki/summon/2.summon

repo_name: ProjectTSB/TheSkyBlessing

repo_language: mcfunction

mime_type: text/plain


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

# 演出
    playsound minecraft:entity.firework_rocket.twinkle_far hostile @a ~ ~ ~ 0.72 2
    particle electric_spark ~ ~ ~ 0.5 0.4 0.5 1 20 normal


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

execute if data storage asset:context {id:274} run function asset:mob/0274.death_saw_jiki/hurt/2.hurt


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

# 足元が空気なら少し落下
    execute if block ~ ~-0.5 ~ #lib:no_collision run tp @s ~ ~-0.5 ~

# 前方が階段状なら上にTPする
    execute unless block ^ ^ ^1 #lib:no_collision if block ^ ^1 ^1 #lib:no_collision at @s run tp ~ ~1 ~
# 前方が壁なら方向転換
    execute unless block ^ ^ ^1 #lib:no_collision unless block ^ ^1 ^1 #lib:no_collision at @s run tp @s ~ ~ ~ ~45 ~
# 前方が2m穴なら適当に方向転換
    execute unless block ~ ~-1 ~ #lib:no_collision if block ^ ^ ^1 #lib:no_collision if block ^ ^-1 ^1 #lib:no_collision if block ^ ^-2 ^1 #lib:no_collision at @s run tp @s ~ ~ ~ ~45 ~

# プレイヤーが近くにいないなら前進する
    execute unless entity @a[distance=..10] at @s rotated ~ 0 run tp ^ ^ ^0.2
# プレイヤーが近くにいるなら追尾する
    execute if entity @p[distance=5..10] at @s facing entity @p eyes positioned ^ ^ ^-100 rotated as @s positioned ^ ^ ^-400 facing entity @s eyes positioned as @s rotated ~ 0 run tp @s ^ ^ ^0.2 ~ ~
    execute if entity @p[distance=..5] at @s facing entity @p eyes positioned ^ ^ ^-100 rotated as @s positioned ^ ^ ^-100 facing entity @s eyes positioned as @s rotated ~ 0 run tp @s ^ ^ ^0.2 ~ ~

# 演出
    playsound entity.sheep.shear hostile @a ~ ~ ~ 0.4 2

# クールダウン
    scoreboard players remove @s[scores={7M.CoolTime=1..}] 7M.CoolTime 1
# ダメージ（スペクテイターでも発動するけどしゃーなし）
    execute unless score @s 7M.CoolTime matches 1.. if entity @e[type=#lib:living,tag=Friend,distance=..0.75] run function asset:mob/0274.death_saw_jiki/tick/3.damage


text:
#> asset:mob/0274.death_saw_jiki/tick/3.damage
#
#
#
# @within function asset:mob/0274.death_saw_jiki/tick/2.tick
#> private
# @private
    #declare tag DamageTarget

# 演出
    particle dust 1.000 0.741 0.141 1.3 ~ ~1.2 ~ 0.5 0.4 0.5 0 20 normal
    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 28.4f
    # 第一属性
        data modify storage lib: Argument.AttackType set value "Physical"
    # 第二属性
        data modify storage lib: Argument.ElementType set value "Thunder"
    # 補正functionを実行
        function lib:damage/modifier
    # 対象に
        tag @e[type=#lib:living,type=!player,tag=Friend,distance=..1] add DamageTarget
        tag @a[tag=!PlayerShouldInvulnerable,distance=..1] add DamageTarget
        execute as @e[type=#lib:living,tag=DamageTarget,distance=..1] run function lib:damage/
    # リセット
        function lib:damage/reset
        tag @e[type=#lib:living,tag=DamageTarget,distance=..2] remove DamageTarget

# クールタイムを与える
    scoreboard players set @s 7M.CoolTime 20


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

execute if data storage asset:context {id:274} run function asset:mob/0274.death_saw_jiki/tick/2.tick


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

#> 定義類はここに
# @within function asset:mob/0217.medousa_eye/**
    scoreboard objectives add 61.Tick dummy
    scoreboard objectives add 61.StoneTime dummy


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

# スケジュールループ再開
    execute if entity @s[tag=61.Stone] run schedule function asset:mob/0217.medousa_eye/player_process/01.schedule_loop 1t replace


text:
#> asset:mob/0217.medousa_eye/_index.d
# @private

#> Tag
# @within function asset:mob/0217.medousa_eye/**
    #declare tag 61.NoAI
    #declare tag 61.Stone
    #declare tag LandingTarget


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

# 演出
    playsound minecraft:entity.spider.step hostile @a ~ ~ ~ 1.5 1.5
    playsound minecraft:block.wart_block.break hostile @a ~ ~ ~ 0.7 1
    particle block green_terracotta ~ ~1.68 ~ 0.2 0.2 0.2 0 100

# 低確率で頭をドロップ
    execute if predicate lib:random_pass_per/5 run summon item ~ ~ ~ {Item:{id:"minecraft:player_head",Count:1b,tag:{display:{Name:'[{"text":"メデューサアイ","color":"#41854E"},{"text":"の目","color":"white"}]'},SkullOwner:{Id:[I;1725447404,-1135126882,-2079282470,1109833247],Properties:{textures:[{Value:"e3RleHR1cmVzOntTS0lOOnt1cmw6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOWM3NWQ5YTdiZDkwYTAzZWJmNDZkMzA3MTUxMmUxYzhjNDQxOTkyNjA1NGVkYzg2YmQxNjg4ZmRhZDA1ZWQwMyJ9fX0="}]}}}}}


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

execute if data storage asset:context {id:217} run function asset:mob/0217.medousa_eye/death/2.death


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

# 元となるMobを召喚する
    summon zombie ~ ~ ~ {Silent:1b,Tags:["MobInit","AntiBurn","AlwaysInvisible","AlwaysSlowFall"],DeathLootTable:"asset:mob/death/0217.medousa_eye"}
# ID (int)
    data modify storage asset:mob ID set value 217
# 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":"#41854E"}'
# 武器
    # メインハンド (Compound(Item)) (オプション)
        # data modify storage asset:mob Weapon.Mainhand set value
    # オフハンド (Compound(Item)) (オプション)
        # data modify storage asset:mob Weapon.Offhand set value
# 武器ドロップ率 ([float, float]) (オプション)
    # data modify storage asset:mob WeaponDropChances set value
# 防具
    # 頭 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Head set value {id:"minecraft:player_head",Count:1b,tag:{SkullOwner:{Id:[I;981897015,1340758181,-1332426296,-2062550547],Properties:{textures:[{Value:"e3RleHR1cmVzOntTS0lOOnt1cmw6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOWM3NWQ5YTdiZDkwYTAzZWJmNDZkMzA3MTUxMmUxYzhjNDQxOTkyNjA1NGVkYzg2YmQxNjg4ZmRhZDA1ZWQwMyJ9fX0="}]}}}}
    # 胴 (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 1200
# 攻撃力 (double) (オプション)
    data modify storage asset:mob AttackDamage set value 16
# 防御力 (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.04
# 索敵範囲 (double) (オプション)
    data modify storage asset:mob FollowRange set value 32
# ノックバック耐性 (double) (オプション)
    data modify storage asset:mob KnockBackResist set value 1
# 属性倍率 // 1.0fで100% 最低でも25%は軽減されずに入る
    # 物理倍率 (float) (オプション)
        # data modify storage asset:mob Resist.Physical set value
    # 魔法倍率 (float) (オプション)
        data modify storage asset:mob Resist.Magic set value 0.25
    # 火倍率 (float) (オプション)
        # data modify storage asset:mob Resist.Fire set value
    # 水倍率 (float) (オプション)
        data modify storage asset:mob Resist.Water set value 0.4
    # 雷倍率 (float) (オプション)
        data modify storage asset:mob Resist.Thunder set value 0.7

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


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

execute if data storage asset:context {id:217} run function asset:mob/0217.medousa_eye/summon/2.summon


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

# 演出
    playsound minecraft:entity.spider.step hostile @a ~ ~ ~ 1.5 1.5
    playsound minecraft:block.wart_block.break hostile @a ~ ~ ~ 0.7 1
    particle block green_terracotta ~ ~1.68 ~ 0 0 0 0 25


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

execute if data storage asset:context {id:271} run function asset:mob/0217.medousa_eye/hurt/2.hurt


text:
#> asset:mob/0217.medousa_eye/player_process/01.schedule_loop
#
# プレイヤー用スケジュールループだよ
#
# @within function
#   asset:mob/0217.medousa_eye/tick/07.beam_hit
#   asset:mob/0217.medousa_eye/player_process/02.stone_time
#   asset:mob/0217.medousa_eye/rejoin_process

# プレイヤー
    execute as @a[tag=61.Stone] at @s run function asset:mob/0217.medousa_eye/player_process/02.stone_time


text:
#> asset:mob/0217.medousa_eye/player_process/02.stone_time
#
# プレイヤーの石化状態時の処理だよ
#
# @within function asset:mob/0217.medousa_eye/player_process/01.schedule_loop

# 演出
    particle block stone ~ ~1.2 ~ 0.1 0.4 0.1 0 4 normal @a

# 石化時間スコア減少
    scoreboard players remove @s 61.StoneTime 1

# デバフ
    execute if score @s 61.StoneTime matches 20.. run effect give @s slowness 1 4 true
    execute if score @s 61.StoneTime matches 20.. run effect give @s jump_boost 1 128 true

# 死んだ場合リセット
    execute if entity @s[tag=Death] run scoreboard players set @s 61.StoneTime 0

# スケジュールループ
    execute if entity @s[scores={61.StoneTime=1..}] run schedule function asset:mob/0217.medousa_eye/player_process/01.schedule_loop 1t replace

# リセット処理
    execute if score @s 61.StoneTime matches ..0 run tag @s remove 61.Stone
    execute if score @s 61.StoneTime matches ..0 run attribute @s generic.knockback_resistance modifier remove 00000001-0000-0002-0000-00d900000000
    execute if score @s 61.StoneTime matches ..0 run scoreboard players reset @s 61.StoneTime


text:
#> asset:mob/0217.medousa_eye/tick/03.fix_direction
#
# ビームの向きを決定します
#
# @within function asset:mob/0217.medousa_eye/tick/2.tick

# NoAI
    data modify entity @s NoAI set value 1b
# プレイヤーを見る
    execute positioned ^ ^ ^10 as @p[gamemode=!spectator,tag=!61.Stone,distance=..10] positioned ^ ^ ^-10 run tp @e[type=zombie,tag=this,distance=..0.1] ~ ~ ~ facing entity @s feet


text:
#> asset:mob/0217.medousa_eye/tick/07.beam_hit
#
# 石化ビームの着弾判定
#
# @within function asset:mob/0217.medousa_eye/tick/05.beam_shoot

# 石tag付与
    tag @s add 61.Stone

# 石化時間スコア
    scoreboard players set @s 61.StoneTime 100

# 演出
    particle block stone ~ ~1.2 ~ 0.3 0.4 0.3 0 100 normal @a
    playsound entity.mooshroom.convert hostile @a ~ ~ ~ 0.5 0 0

# attribute
    attribute @s generic.knockback_resistance modifier add 00000001-0000-0002-0000-00d900000000 "217.KnockbackResist" 30 add

# ダメージ
    data modify storage lib: Argument.Damage set value 20f
# 属性
    data modify storage lib: Argument.AttackType set value "Magic"
    data modify storage lib: Argument.ElementType set value "None"
# デスログ
    data modify storage lib: Argument.DeathMessage append value '[{"translate": "%1$sは%2$sにより石化した","with":[{"selector":"@s"},{"nbt":"Return.AttackerName","storage":"lib:","interpret":true}]}]'
    data modify storage lib: Argument.DeathMessage append value '[{"translate": "%1$sは%2$sと目を合わせてしまい、石像となった","with":[{"selector":"@s"},{"nbt":"Return.AttackerName","storage":"lib:","interpret":true}]}]'
# 補正
    execute as @e[type=zombie,tag=this,distance=..20,limit=1] run function lib:damage/modifier
# 実行
    execute if entity @s[tag=!PlayerShouldInvulnerable] run function lib:damage/
# リセット
    function lib:damage/reset

# マナを吸収
    scoreboard players set $Fluctuation Lib -60
    function lib:mp/fluctuation

# スケジュールループスタート
    schedule function asset:mob/0217.medousa_eye/player_process/01.schedule_loop 1t replace

# ヒットTag削除
    tag @s remove LandingTarget


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

# 演出
    particle dust 0.294 0.353 0.043 1.5 ^ ^1.7 ^-0.3 0.2 0.2 0.2 0 1 normal @a

# プレイヤーが前方(視界内)にいるときのみスコア増加
    execute unless entity @s[scores={61.Tick=60..}] positioned ^ ^ ^10 if entity @p[gamemode=!spectator,tag=!61.Stone,distance=..10] at @s run scoreboard players add @s 61.Tick 1

# スコアが60の時、向きを固定する
    execute if entity @s[scores={61.Tick=60}] run function asset:mob/0217.medousa_eye/tick/03.fix_direction

# スコアが61のとき、予備動作
    execute if entity @s[scores={61.Tick=61}] run execute positioned ^ ^1.8 ^0.4 run function asset:mob/0217.medousa_eye/tick/04.vfx

# 60以上の場合スコア増加
    execute if entity @s[scores={61.Tick=60..}] run scoreboard players add @s 61.Tick 1

# スコアが70以上で石化ビーム発射
    execute if entity @s[scores={61.Tick=70..}] run function asset:mob/0217.medousa_eye/tick/05.beam_shoot


text:
#> asset:mob/0217.medousa_eye/tick/04.vfx
#
#
#
# @within function asset:mob/0217.medousa_eye/tick/2.tick

# 演出
# 円 1
# [ImportKey]: NobwRALgngDgpmAXGAxgSwE4oDYIDRgCuhaAJkmAIwDsAnAAwBmK9AhgLQBMAbNxwCyVOAVnYAjWnDHt+AZnqdGADkac5w2WAIA7VgFsEyQGGKAAkpawMVhn0BnJOBQB7QtohIhBFHDdwMDsAA3VmxCQ3AADyR6AihogF94ghtSNEJ7RHoAOmECWwhrd0yCOGxsNBhbQ0p6GLAMJwKIQzq0WwBRMoqq9oBHQhDsKABlK29yREYQqsSAXSA_3
# 円 1
    particle end_rod ^0 ^-0.5 ^ 0 0 0 0 1
    particle end_rod ^0.25 ^-0.43301 ^ 0 0 0 0 1
    particle end_rod ^0.43301 ^-0.25 ^ 0 0 0 0 1
    particle end_rod ^0.5 ^0 ^ 0 0 0 0 1
    particle end_rod ^0.43301 ^0.25 ^ 0 0 0 0 1
    particle end_rod ^0.25 ^0.43301 ^ 0 0 0 0 1
    particle end_rod ^0 ^0.5 ^ 0 0 0 0 1
    particle end_rod ^-0.25 ^0.43301 ^ 0 0 0 0 1
    particle end_rod ^-0.43301 ^0.25 ^ 0 0 0 0 1
    particle end_rod ^-0.5 ^0 ^ 0 0 0 0 1
    particle end_rod ^-0.43301 ^-0.25 ^ 0 0 0 0 1
    particle end_rod ^-0.25 ^-0.43301 ^ 0 0 0 0 1


text:
#> asset:mob/0217.medousa_eye/tick/05.beam_shoot
#
# ビーム発射と
#
# @within function asset:mob/0217.medousa_eye/tick/2.tick

# スコアが70以上で石化ビーム発射
    execute positioned ^ ^1.7 ^ run function asset:mob/0217.medousa_eye/tick/06.beam

# ビームがヒット
    execute as @a[tag=LandingTarget,distance=..20] at @s run function asset:mob/0217.medousa_eye/tick/07.beam_hit

# 音
    playsound minecraft:entity.elder_guardian.death hostile @a[distance=..25] ~ ~ ~ 0.6 2 0.1

# リセット
    data modify entity @s NoAI set value 0b
    scoreboard players reset @s 61.Tick


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

execute if data storage asset:context {id:217} run function asset:mob/0217.medousa_eye/tick/2.tick


text:
#> asset:mob/0217.medousa_eye/tick/06.beam
#
#
#
# @within function
#   asset:mob/0217.medousa_eye/tick/05.beam_shoot
#   asset:mob/0217.medousa_eye/tick/06.beam

# 演出
    particle dust 0.102 0.353 0.102 1.5 ~ ~ ~ 0 0 0 0 1 normal @a
    particle dust 0.102 0.353 0.102 1.5 ^ ^ ^-0.5 0 0 0 0 1 normal @a

# 着弾
    execute positioned ~-0.5 ~-0.5 ~-0.5 if entity @p[gamemode=!spectator,dx=0] run tag @p[gamemode=!spectator,dx=0] add LandingTarget

# 再帰
    execute unless entity @p[tag=LandingTarget,distance=..20] positioned ^ ^ ^1 if block ~ ~ ~ #asset:mob/0217.medousa_eye/passing_block run function asset:mob/0217.medousa_eye/tick/06.beam


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

#> 定義類はここに
# @within function asset:mob/0074.watermelon_bomber/**
    scoreboard objectives add 22.Tick dummy


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

# 演出
    particle block melon ~ ~1.3 ~ 0.3 0.5 0.3 0 40 normal @a
    particle dust 1 0.141 0.141 1 ~ ~1.2 ~ 1 1 1 0 20 normal @a
    particle explosion ~ ~1.5 ~ 0.4 0.4 0.4 0 10 normal @a
    playsound entity.generic.explode hostile @a ~ ~ ~ 0.5 1 0

# スイカ設置
    execute if predicate world_manager:area/02.islands run fill ~ ~ ~ ~ ~ ~ melon replace #lib:air


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

execute if data storage asset:context {id:74} run function asset:mob/0074.watermelon_bomber/death/2.death


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

# 元となるMobを召喚する
    summon zombie ~ ~ ~ {Silent:1b,Tags:["MobInit","AlwaysInvisible"],DeathLootTable:"asset:mob/death/0074.watermelon_bomber"}
# ID (int)
    data modify storage asset:mob ID set value 74
# 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":"#59FF75"},{"text":"イカボマ","color":"#FF3838"},{"text":"ー","color":"#59FF75"}]'
# 武器
    # メインハンド (Compound(Item)) (オプション)
        data modify storage asset:mob Weapon.Mainhand set value {id:"minecraft:melon",Count:1b,tag:{CustomModelData:20018}}
    # オフハンド (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:melon",Count:1b}
    # 胴 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Chest set value {id:"minecraft:leather_chestplate",Count:1b,tag:{display:{color:8973627}}}
    # 脚 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Legs set value {id:"minecraft:leather_leggings",Count:1b,tag:{display:{color:8973627}}}
    # 足 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Feet set value {id:"minecraft:leather_boots",Count:1b,tag:{display:{color:8973627}}}
# 防具ドロップ率 ([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 999
# 攻撃力 (double) (オプション)
    data modify storage asset:mob AttackDamage set value 8.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.25
# 索敵範囲 (double) (オプション)
    data modify storage asset:mob FollowRange set value 25.0
# ノックバック耐性 (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 1.0
    # 魔法倍率 (float) (オプション)
        data modify storage asset:mob Resist.Magic set value 1.0
    # 火倍率 (float) (オプション)
        data modify storage asset:mob Resist.Fire set value 0.8
    # 水倍率 (float) (オプション)
        data modify storage asset:mob Resist.Water set value 0.75
    # 雷倍率 (float) (オプション)
        data modify storage asset:mob Resist.Thunder set value 1.0

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


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

execute if data storage asset:context {id:74} run function asset:mob/0074.watermelon_bomber/summon/2.summon


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

# 演出
    playsound entity.player.splash hostile @a ~ ~ ~ 0.8 0.8 0
    particle block melon ~ ~1.3 ~ 0.3 0.5 0.3 0 20 normal @a
    particle dust 1 0.141 0.141 1 ~ ~1.3 ~ 0.4 0.5 0.4 0 10 normal @a


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

execute if data storage asset:context {id:74} run function asset:mob/0074.watermelon_bomber/hurt/2.hurt


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

execute if data storage asset:context {id:74} run function asset:mob/0074.watermelon_bomber/attack/2.attack


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

# 引数の設定
    # 与えるダメージ
        data modify storage lib: Argument.Damage set value 16.0f
    # 第一属性
        data modify storage lib: Argument.AttackType set value "Physical"
    # 第二属性
        data modify storage lib: Argument.ElementType set value "Water"
# デスログ
    data modify storage lib: Argument.DeathMessage append value '[{"translate": "%1$sは%2$sによってスイカに取り込まれた","with":[{"selector":"@s"},{"nbt":"Return.AttackerName","storage":"lib:","interpret":true}]}]'
    data modify storage lib: Argument.DeathMessage append value '[{"translate": "%1$sは%2$sによってスイカの栄養となった","with":[{"selector":"@s"},{"nbt":"Return.AttackerName","storage":"lib:","interpret":true}]}]'
# 補正functionを実行
    function lib:damage/modifier
# ダメージ対象
    execute as @p[tag=Victim,distance=..6] run function lib:damage/
# リセット
    function lib:damage/reset

# 演出
    execute at @p[tag=Victim,distance=..6] run playsound entity.player.splash hostile @a ~ ~ ~ 0.8 0.8 0
    execute at @p[tag=Victim,distance=..6] run particle dust 1 0.141 0.141 1 ~ ~1.2 ~ 1 1 1 0 10 normal @a
    execute at @p[tag=Victim,distance=..6] run particle dust 0.173 1 0.243 1 ~ ~1.2 ~ 1 1 1 0 10 normal @a


text:
#> asset:mob/0074.watermelon_bomber/tick/3.throw_watermelon
#
#
#
# @within function asset:mob/0074.watermelon_bomber/tick/2.tick

# スイカ投げ
    data modify storage api: Argument.ID set value 75
    function api:mob/summon
    execute facing entity @p[tag=!PlayerShouldInvulnerable,distance=..20] feet run tp @e[type=armor_stand,scores={MobID=75},distance=..0.1,limit=1] ~ ~1.2 ~ ~ ~-2

# スコアリセット
    scoreboard players reset @s 22.Tick


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

# スイカ投げのためスコア
    scoreboard players add @s 22.Tick 1

# スイカ投げ
    execute if score @s 22.Tick matches 60.. run function asset:mob/0074.watermelon_bomber/tick/3.throw_watermelon


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

execute if data storage asset:context {id:74} if entity @a[gamemode=!spectator,distance=..30] run function asset:mob/0074.watermelon_bomber/tick/2.tick


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

#> 定義類はここに
# @within function asset:mob/0078.messenger_of_thunder/**
    scoreboard objectives add 26.Tick dummy
    scoreboard objectives add 26.SkillSelect dummy
    scoreboard objectives add 26.TPCool dummy


text:
#> asset:mob/0078.messenger_of_thunder/_index.d
# @private

#> Tag
# @within function asset:mob/0078.messenger_of_thunder/**
    #declare tag 26.HPLess50Per

#> スキル用Tag
# @within function asset:mob/0078.messenger_of_thunder/skill/**/**
    #declare tag 26.SkillThunderMarker
    #declare tag 26.Already


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

particle dust 0 0 0 3 ~ ~1.3 ~ 0.6 0.6 0.6 0 20 normal @a
particle smoke ~ ~1.3 ~ 0.3 0.5 0.3 0.01 50 normal @a
playsound entity.lightning_bolt.impact hostile @a ~ ~ ~ 0.8 0.8 0.8


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

execute if data storage asset:context {id:78} run function asset:mob/0078.messenger_of_thunder/death/2.death


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

# 元となるMobを召喚する
    summon skeleton ~ ~ ~ {Silent:1b,Tags:["MobInit","AlwaysInvisible","AntiVoid"],DeathLootTable:"asset:mob/death/0078.messenger_of_thunder"}
# ID (int)
    data modify storage asset:mob ID set value 78
# Type (string) Wikiを参照
    data modify storage asset:mob Type set value "Enemy.Boss"
# 干渉可能か否か (boolean)
    data modify storage asset:mob Interferable set value true
# 名前 (TextComponentString) (オプション)
    data modify storage asset:mob Name set value '{"text":"雷鳴之使","color":"#D9B111"}'
# 武器
    # メインハンド (Compound(Item)) (オプション)
        data modify storage asset:mob Weapon.Mainhand set value {id:"minecraft:bow",Count:1b,tag:{CustomModelData:20188,Enchantments:[{id:"punch",lvl:1s}]}}
    # オフハンド (Compound(Item)) (オプション)
        data modify storage asset:mob Weapon.Offhand set value {id:"minecraft:carrot_on_a_stick",Count:1b,tag:{CustomModelData:376}}
# 武器ドロップ率 ([float, float]) (オプション)
    # data modify storage asset:mob WeaponDropChances set value
# 防具
    # 頭 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Head set value {id:"minecraft:stone",Count:1b,tag:{CustomModelData:20019}}
    # 胴 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Chest set value {id:"minecraft:leather_chestplate",Count:1b,tag:{display:{color:14408481}}}
    # 脚 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Legs set value {id:"minecraft:leather_leggings",Count:1b,tag:{display:{color:14408481}}}
    # 足 (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 25000
# 攻撃力 (double) (オプション)
    # data modify storage asset:mob AttackDamage set value
# 防御力 (double) (オプション) // 被ダメージがある程度大きい場合1ptにつき0.8%カット、小さい場合1ptにつき約4%カット 20pt以上は頭打ち
    data modify storage asset:mob Defense set value -5
# 特殊防御力 (double) (オプション) // 4pointにつきダメージを大きく減らす
    # data modify storage asset:mob SpecialDefense set value
# 移動速度 (double) (オプション)
    data modify storage asset:mob Speed set value 0.4
# 索敵範囲 (double) (オプション)
    data modify storage asset:mob FollowRange set value 30
# ノックバック耐性 (double) (オプション)
    data modify storage asset:mob KnockBackResist set value 0.5
# 属性倍率 // 1.0fで100% 最低でも25%は軽減されずに入る
    # 物理倍率 (float) (オプション)
        data modify storage asset:mob Resist.Physical set value 0.5
    # 魔法倍率 (float) (オプション)
        data modify storage asset:mob Resist.Magic set value 1
    # 火倍率 (float) (オプション)
        data modify storage asset:mob Resist.Fire set value 1
    # 水倍率 (float) (オプション)
        data modify storage asset:mob Resist.Water set value 0.8
    # 雷倍率 (float) (オプション)
        data modify storage asset:mob Resist.Thunder set value 0

# スコアを付与
    scoreboard players set @e[type=skeleton,tag=MobInit,distance=..0.01] 26.Tick -80

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


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

execute if data storage asset:context {id:78} run function asset:mob/0078.messenger_of_thunder/summon/2.summon


text:
#> asset:mob/0078.messenger_of_thunder/hurt/3.check_health
#
#
#
# @within function asset:mob/0078.messenger_of_thunder/hurt/2.hurt

#> Private
# @private
    #declare score_holder $HealthPer

# 体力が半分以下かどうかを検知する
    function api:mob/get_health_percent
# 代入する
    execute store result score $HealthPer Temporary run data get storage api: Return.HealthPer 100

# 体力半分以下を検知
    execute if score $HealthPer Temporary matches ..50 run item replace entity @s weapon.mainhand with bow{CustomModelData:20188,Enchantments:[{id:"punch",lvl:3s}]}
    execute if score $HealthPer Temporary matches ..50 run tag @s add 26.HPLess50Per
    scoreboard players reset $HealthPer Temporary


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

# 演出
    particle dust 1 1 0 1 ~ ~1.6 ~ 0.4 0.6 0.4 0 10 normal @a
    particle dust 0.3 0.3 0.3 1 ~ ~1.6 ~ 0.4 0.6 0.4 0 30 normal @a
    playsound block.respawn_anchor.deplete hostile @a ~ ~ ~ 0.6 2 0

# 体力半分以下で強化の処理
    execute if entity @s[tag=!26.HPLess50Per] run function asset:mob/0078.messenger_of_thunder/hurt/3.check_health


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

execute if data storage asset:context {id:78} run function asset:mob/0078.messenger_of_thunder/hurt/2.hurt


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

execute if data storage asset:context {id:78} at @p[tag=Victim,distance=..50] run function asset:mob/0078.messenger_of_thunder/attack/2.attack


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

# 演出
    particle dust 1 1 0 1 ~ ~3 ~ 0.7 3 0.7 0 250
    particle dust 1 1 0 1 ~ ~5 ~ 0.1 5 0.1 0 250
    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 ~ ~ ~ 0.5 2 0
    playsound entity.lightning_bolt.impact hostile @a ~ ~ ~ 0.5 0 0

# ダメージ設定
    data modify storage lib: Argument.Damage set value 20d
    execute if entity @s[tag=26.HPLess50Per] run data modify storage lib: Argument.Damage set value 27.5d
    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 @p[tag=Victim,distance=..50] run function lib:damage/
# リセット
    function lib:damage/reset


text:
#> asset:mob/0078.messenger_of_thunder/skill/2/1
#
#
#
# @within function asset:mob/0078.messenger_of_thunder/tick/4.skill_branch

# 予備動作
    execute if entity @s[scores={26.Tick=0}] run playsound entity.zombie_villager.converted hostile @a ~ ~ ~ 1 1.5 0

# 技を使う
    execute if entity @s[scores={26.Tick=20}] run function asset:mob/0078.messenger_of_thunder/skill/2/2.activate

# HP半分以下で少し遅れて追加で2本召喚
    execute if entity @s[tag=26.HPLess50Per,scores={26.Tick=30}] run function asset:mob/0078.messenger_of_thunder/skill/2/3.addition_thunder

# リセット
    execute if entity @s[scores={26.Tick=50..}] run function asset:mob/0078.messenger_of_thunder/tick/reset


text:
#> asset:mob/0078.messenger_of_thunder/skill/2/3.addition_thunder
#
# 雷を2本追加で召喚
#
# @within function asset:mob/0078.messenger_of_thunder/skill/2/1

# 雷を召喚
    data modify storage api: Argument.ID set value 79
    function api:mob/summon
    execute facing entity @p[distance=..50] feet rotated ~30 ~ run tp @e[type=marker,tag=!26.Already,scores={MobID=79},distance=..0.001,sort=nearest,limit=1] ~ ~ ~ ~ ~
    tag @e[type=marker,tag=!26.Already,scores={MobID=79},distance=..0.001,sort=nearest,limit=1] add 26.Already

# 雷を召喚
    data modify storage api: Argument.ID set value 79
    function api:mob/summon
    execute facing entity @p[distance=..50] feet rotated ~-30 ~ run tp @e[type=marker,tag=!26.Already,scores={MobID=79},distance=..0.001,sort=nearest,limit=1] ~ ~ ~ ~ ~
    tag @e[type=marker,tag=!26.Already,scores={MobID=79},distance=..0.001,sort=nearest,limit=1] add 26.Already


text:
#> asset:mob/0078.messenger_of_thunder/skill/2/2.activate
#
#
#
# @within function asset:mob/0078.messenger_of_thunder/skill/2/1

# 雷を召喚
    data modify storage api: Argument.ID set value 79
    function api:mob/summon
    tp @e[type=marker,tag=!26.Already,scores={MobID=79},distance=..0.001,sort=nearest,limit=1] ~ ~ ~ facing entity @p[distance=..50] feet
    tag @e[type=marker,tag=!26.Already,scores={MobID=79},distance=..0.001,sort=nearest,limit=1] add 26.Already

# モーション
    data modify storage lib: Argument.VectorMagnitude set value 1.2
    execute facing entity @p[gamemode=!spectator,distance=..50] eyes rotated ~-180 -20 run function lib:motion/
    data remove storage lib: Argument


text:
#> asset:mob/0078.messenger_of_thunder/skill/4/1
#
#
#
# @within function asset:mob/0078.messenger_of_thunder/tick/4.skill_branch

# 予備動作
    execute if entity @s[scores={26.Tick=0}] run playsound entity.zombie_villager.converted hostile @a ~ ~ ~ 1 1.5 0

# 発動
    execute if entity @s[scores={26.Tick=10}] run function asset:mob/0078.messenger_of_thunder/skill/4/2.activate

# リセット
    execute if entity @s[scores={26.Tick=50..}] run function asset:mob/0078.messenger_of_thunder/tick/reset


text:
#> asset:mob/0078.messenger_of_thunder/skill/4/2.activate
#
#
#
# @within function asset:mob/0078.messenger_of_thunder/skill/4/1

# 雷を召喚
    data modify storage api: Argument.ID set value 82
    function api:mob/summon
    execute facing entity @p[gamemode=!spectator,distance=..50] feet rotated ~ 0 run tp @e[type=marker,tag=!26.Already,scores={MobID=82},distance=..0.001,sort=nearest,limit=1] ~ ~ ~ ~ ~
    tag @e[type=marker,tag=!26.Already,scores={MobID=82},distance=..0.01,sort=nearest,limit=1] add 26.Already

# モーション
    data modify storage lib: Argument.VectorMagnitude set value 1.2
    execute facing entity @p[gamemode=!spectator,distance=..50] eyes rotated ~-180 -20 run function lib:motion/
    data remove storage lib: Argument


text:
#> asset:mob/0078.messenger_of_thunder/skill/3/1
#
# ワープを数回する
#
# @within function asset:mob/0078.messenger_of_thunder/tick/4.skill_branch

# 演出
    particle electric_spark ~ ~1.2 ~ 0.4 0.5 0.4 0.1 5 normal @a

# 1回目
    execute if entity @s[scores={26.Tick=5}] run function asset:mob/0078.messenger_of_thunder/skill/3/2.spread

# 2回目
    execute if entity @s[scores={26.Tick=10}] at @p[gamemode=!spectator,distance=..50] run function asset:mob/0078.messenger_of_thunder/skill/3/2.spread

# 3回目
    execute if entity @s[scores={26.Tick=20}] run function asset:mob/0078.messenger_of_thunder/skill/3/2.spread

# リセット
    execute if entity @s[scores={26.Tick=30..}] run function asset:mob/0078.messenger_of_thunder/tick/reset


text:
#> asset:mob/0078.messenger_of_thunder/skill/3/2.spread
#
#
#
# @within function asset:mob/0078.messenger_of_thunder/skill/3/1

# 拡散と演出
    playsound block.respawn_anchor.charge hostile @a ~ ~ ~ 0.5 2 0
    data modify storage lib: Argument.Bounds set value [[10d,10d],[0d,0d],[10d,10d]]
    function lib:spread_entity/

# リセット
    data remove storage lib: Argument


text:
#> asset:mob/0078.messenger_of_thunder/skill/1/1
#
#
#
# @within function asset:mob/0078.messenger_of_thunder/tick/4.skill_branch

#> Private
# @private
    #declare score_holder $Temp

# AECを召喚
    execute if entity @s[scores={26.Tick=0}] at @p[gamemode=!spectator] run function asset:mob/0078.messenger_of_thunder/skill/1/2.thunder_point1

# 演出
    scoreboard players operation $Temp Temporary = @s 26.Tick
    scoreboard players operation $Temp Temporary %= $3 Const
    execute if score $Temp Temporary matches 0 at @e[type=area_effect_cloud,tag=26.SkillThunderMarker,distance=..60,limit=5] positioned ~ ~0.3 ~ run function asset:mob/0078.messenger_of_thunder/skill/1/4.vfx
    scoreboard players reset $Temp Temporary

# AECの位置に雷を落とす
    execute if entity @s[scores={26.Tick=22}] at @e[type=area_effect_cloud,tag=26.SkillThunderMarker,distance=..60,sort=random,limit=1] run function asset:mob/0078.messenger_of_thunder/skill/1/5.thunder_attack
    execute if entity @s[scores={26.Tick=24}] at @e[type=area_effect_cloud,tag=26.SkillThunderMarker,distance=..60,sort=random,limit=1] run function asset:mob/0078.messenger_of_thunder/skill/1/5.thunder_attack
    execute if entity @s[scores={26.Tick=26}] at @e[type=area_effect_cloud,tag=26.SkillThunderMarker,distance=..60,sort=random,limit=1] run function asset:mob/0078.messenger_of_thunder/skill/1/5.thunder_attack
    execute if entity @s[scores={26.Tick=28}] at @e[type=area_effect_cloud,tag=26.SkillThunderMarker,distance=..60,sort=random,limit=1] run function asset:mob/0078.messenger_of_thunder/skill/1/5.thunder_attack
    execute if entity @s[scores={26.Tick=30}] at @e[type=area_effect_cloud,tag=26.SkillThunderMarker,distance=..60,sort=random,limit=1] run function asset:mob/0078.messenger_of_thunder/skill/1/5.thunder_attack

# リセット
    execute if entity @s[scores={26.Tick=30..}] run function asset:mob/0078.messenger_of_thunder/tick/reset


text:
#> asset:mob/0078.messenger_of_thunder/skill/1/5.thunder_attack
#
#
#
# @within function asset:mob/0078.messenger_of_thunder/skill/1/1

# 演出
    particle dust 1 1 0 1 ~ ~3 ~ 0.7 3 0.7 0 250
    particle dust 1 1 0 1 ~ ~5 ~ 0.1 5 0.1 0 250
    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 ~ ~ ~ 0.8 2 0
    playsound entity.lightning_bolt.impact hostile @a ~ ~ ~ 0.8 0 0

# ダメージ設定
    # 与えるダメージ
        data modify storage lib: Argument.Damage set value 20.0f
    # 魔法属性
        data modify storage lib: Argument.AttackType set value "Physical"
    # 雷属性
        data modify storage lib: Argument.ElementType set value "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=..2] run function lib:damage/
# リセット
    function lib:damage/reset

# キル
    kill @e[type=area_effect_cloud,tag=26.SkillThunderMarker,distance=..0.01,sort=nearest,limit=1]


text:
#> asset:mob/0078.messenger_of_thunder/skill/1/4.vfx
#
#
#
# @within function asset:mob/0078.messenger_of_thunder/skill/1/1

# 円
    particle electric_spark ^0 ^ ^-1 0 0 0 0 1
    particle electric_spark ^0.30902 ^ ^-0.95106 0 0 0 0 1
    particle electric_spark ^0.58779 ^ ^-0.80902 0 0 0 0 1
    particle electric_spark ^0.80902 ^ ^-0.58779 0 0 0 0 1
    particle electric_spark ^0.95106 ^ ^-0.30902 0 0 0 0 1
    particle electric_spark ^1 ^ ^0 0 0 0 0 1
    particle electric_spark ^0.95106 ^ ^0.30902 0 0 0 0 1
    particle electric_spark ^0.80902 ^ ^0.58779 0 0 0 0 1
    particle electric_spark ^0.58779 ^ ^0.80902 0 0 0 0 1
    particle electric_spark ^0.30902 ^ ^0.95106 0 0 0 0 1
    particle electric_spark ^0 ^ ^1 0 0 0 0 1
    particle electric_spark ^-0.30902 ^ ^0.95106 0 0 0 0 1
    particle electric_spark ^-0.58779 ^ ^0.80902 0 0 0 0 1
    particle electric_spark ^-0.80902 ^ ^0.58779 0 0 0 0 1
    particle electric_spark ^-0.95106 ^ ^0.30902 0 0 0 0 1
    particle electric_spark ^-1 ^ ^0 0 0 0 0 1
    particle electric_spark ^-0.95106 ^ ^-0.30902 0 0 0 0 1
    particle electric_spark ^-0.80902 ^ ^-0.58779 0 0 0 0 1
    particle electric_spark ^-0.58779 ^ ^-0.80902 0 0 0 0 1
    particle electric_spark ^-0.30902 ^ ^-0.95106 0 0 0 0 1


text:
#> asset:mob/0078.messenger_of_thunder/skill/1/3.thunder_point2
#
#
#
# @within function asset:mob/0078.messenger_of_thunder/skill/1/2.thunder_point1

# AECを召喚
    summon area_effect_cloud ~ ~ ~ {CustomNameVisible:0b,Particle:"block air",Duration:30,Tags:["Object","26.SkillThunderMarker"]}
    data modify storage lib: Argument.Bounds set value [[3d,3d],[0d,0d],[3d,3d]]
    execute as @e[type=area_effect_cloud,tag=26.SkillThunderMarker,distance=..0.01,limit=1] run function lib:spread_entity/

# 演出
    playsound minecraft:entity.zombie_villager.converted hostile @a ^ ^ ^ 1 1.2 0

# リセット
    data remove storage lib: Argument


text:
#> asset:mob/0078.messenger_of_thunder/skill/1/2.thunder_point1
#
#
#
# @within function asset:mob/0078.messenger_of_thunder/skill/1/1

# AECを召喚して拡散するを5回繰り返す
    function asset:mob/0078.messenger_of_thunder/skill/1/3.thunder_point2
    function asset:mob/0078.messenger_of_thunder/skill/1/3.thunder_point2
    function asset:mob/0078.messenger_of_thunder/skill/1/3.thunder_point2
    function asset:mob/0078.messenger_of_thunder/skill/1/3.thunder_point2
    function asset:mob/0078.messenger_of_thunder/skill/1/3.thunder_point2


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

# 演出
    particle dust 1 1 0 1 ~ ~1.7 ~ 0.2 0.2 0.2 0 3 normal @a
    particle dust 0.2 0.2 0.2 1 ~ ~1.7 ~ 0.2 0.2 0.2 0 3 normal @a

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

# 技選択
    execute if entity @s[scores={26.Tick=0}] run function asset:mob/0078.messenger_of_thunder/tick/3.skill_select

# スキル
    execute if entity @s[scores={26.Tick=0..}] run function asset:mob/0078.messenger_of_thunder/tick/4.skill_branch

# ワープのクールダウン処理(0以下ならワープ可能になる)
    execute if entity @s[scores={26.TPCool=0..}] run scoreboard players remove @s 26.TPCool 1

# ハメ対策
    execute unless entity @s[scores={26.TPCool=0..}] unless block ~ ~ ~ #lib:no_collision_without_fluid at @p[gamemode=!spectator,distance=..50] unless block ~ ~ ~ #walls run function asset:mob/0078.messenger_of_thunder/tick/teleport

# 落下対策
    execute unless entity @s[scores={26.TPCool=0..}] if block ~ ~-0.5 ~ #lib:no_collision if block ~ ~-1.5 ~ #lib:no_collision if block ~ ~-2.5 ~ #lib:no_collision if block ~ ~-3.5 ~ #lib:no_collision at @p[gamemode=!spectator,distance=..50] run function asset:mob/0078.messenger_of_thunder/tick/teleport


text:
#> asset:mob/0078.messenger_of_thunder/tick/4.skill_branch
#
# スキルを分岐して実行するfunction
#
# @within function asset:mob/0078.messenger_of_thunder/tick/2.tick

# 震雷
    execute if entity @s[scores={26.SkillSelect=0}] run function asset:mob/0078.messenger_of_thunder/skill/1/1

# 執雷
    execute if entity @s[scores={26.SkillSelect=1}] run function asset:mob/0078.messenger_of_thunder/skill/2/1

# 瞬雷
    execute if entity @s[scores={26.SkillSelect=2}] run function asset:mob/0078.messenger_of_thunder/skill/3/1

# 幕雷
    execute if entity @s[scores={26.SkillSelect=3}] run function asset:mob/0078.messenger_of_thunder/skill/4/1


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

execute if data storage asset:context {id:78} run function asset:mob/0078.messenger_of_thunder/tick/2.tick


text:
#> asset:mob/0078.messenger_of_thunder/tick/3.skill_select
#
# スキル選択
#
# @within function asset:mob/0078.messenger_of_thunder/tick/2.tick

#> Private
# @private
    #declare score_holder $Random

# 疑似乱数取得
    execute store result score $Random Temporary run function lib:random/
# ほしい範囲に剰余算
    scoreboard players operation $Random Temporary %= $4 Const
# ランダムの数値をスキル選択スコアと同じに
    scoreboard players operation @s 26.SkillSelect = $Random Temporary
# リセット
    scoreboard players reset $Random Temporary


text:
#> asset:mob/0078.messenger_of_thunder/tick/teleport
#
#
#
# @within function
#   asset:mob/0078.messenger_of_thunder/tick/2.tick

# 演出
    playsound block.respawn_anchor.charge hostile @a ~ ~ ~ 1 2 0

# ランダムでワープ
    data modify storage lib: Argument.Bounds set value [[8d,8d],[0d,0d],[8d,8d]]
    function lib:spread_entity/

# リセット
    data remove storage lib: Argument

# ワープのクールダウンを設定
    scoreboard players set @s 26.TPCool 30


text:
#> asset:mob/0078.messenger_of_thunder/tick/reset
#
#
#
# @within function
#   asset:mob/0078.messenger_of_thunder/skill/*/1

# リセット
    scoreboard players reset @s 26.SkillSelect
    scoreboard players set @s 26.Tick -60


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

#> 定義類はここに
# @within function asset:mob/0174.burning_blaze/**
    scoreboard objectives add 4U.ActionTime dummy
    scoreboard objectives add 4U.NowAction dummy


text:
#> asset:mob/0174.burning_blaze/_index.d
# @private

#> tag
# @within function asset:mob/0174.burning_blaze/**
    #declare tag Hit
    #declare tag Line


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

# 元となるMobを召喚する
    summon blaze ~ ~ ~ {Tags:["MobInit"],DeathLootTable:"asset:mob/death/0174.burning_blaze"}
# ID (int)
    data modify storage asset:mob ID set value 174
# Type (string) Wikiを参照
    data modify storage asset:mob Type set value "Enemy.Boss"
# 干渉可能か否か (boolean)
    data modify storage asset:mob Interferable set value true
# 名前 (TextComponentString) (オプション)
    data modify storage asset:mob Name set value '[{"text":"バーニング・ブレイズ","color":"dark_red"}]'
# 武器
    # メインハンド (Compound(Item)) (オプション)
        data modify storage asset:mob Weapon.Mainhand set value {id:"minecraft:stone",tag:{Enchantments:[{id:"fire_aspect",lvl:2}]}}
    # オフハンド (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 20000
# 攻撃力 (double) (オプション)
    data modify storage asset:mob AttackDamage set value 1
# 防御力 (double) (オプション) // 被ダメージがある程度大きい場合1ptにつき0.8%カット、小さい場合1ptにつき約4%カット 20pt以上は頭打ち
    data modify storage asset:mob Defense set value 0
# 特殊防御力 (double) (オプション) // 4pointにつきダメージを大きく減らす
    # data modify storage asset:mob SpecialDefense set value
# 移動速度 (double) (オプション)
    data modify storage asset:mob Speed set value 0.3
# 索敵範囲 (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.5
    # 魔法倍率 (float) (オプション)
        data modify storage asset:mob Resist.Magic set value 0.6
    # 火倍率 (float) (オプション)
        data modify storage asset:mob Resist.Fire set value 0.4
    # 水倍率 (float) (オプション)
        data modify storage asset:mob Resist.Water set value 1
    # 雷倍率 (float) (オプション)
        data modify storage asset:mob Resist.Thunder set value 0.75

# スコア
    scoreboard players set @e[type=blaze,tag=MobInit,distance=..0.01] 4U.ActionTime 0
    scoreboard players set @e[type=blaze,tag=MobInit,distance=..0.01] 4U.NowAction 0

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


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

execute if data storage asset:context {id:174} run function asset:mob/0174.burning_blaze/summon/2.summon


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

# 被ダメ時、飛ぶ
    data modify storage lib: Argument.VectorMagnitude set value 0.5
    execute facing entity @p[tag=Attacker] feet rotated ~180 ~ run function lib:motion/
    data remove storage lib: Argument


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

execute if data storage asset:context {id:174} run function asset:mob/0174.burning_blaze/hurt/2.hurt


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

execute if data storage asset:context {id:174} run function asset:mob/0174.burning_blaze/attack/2.attack


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

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


text:
#> asset:mob/0174.burning_blaze/action/laser.shot
#
#
#
# @within function asset:mob/0174.burning_blaze/action/laser.tick

# ダメージ設定
    data modify storage lib: Argument set value {Damage:30,AttackType:Physical,AttackElement:Fire}

# プレイヤー方向にレーザー発射
    execute facing entity @p[tag=!PlayerShouldInvulnerable,distance=..32] feet anchored eyes run function asset:mob/0174.burning_blaze/action/laser.shot.loop

# ダメージ補正
    function lib:damage/modifier
# ヒット対象にダメージ
    execute as @a[tag=Hit] run function lib:damage/

# リセット
    function lib:damage/reset
    tag @a[tag=Hit] remove Hit

# スコア戻す
    scoreboard players set @s 4U.ActionTime 0
    scoreboard players set @s 4U.NowAction 0

# 射程内のプレイヤーがこいつの方向からレーザー発射音を聞けるように
    execute as @a[distance=..32] at @s facing entity @e[type=blaze,tag=this,distance=..32] eyes positioned ^ ^ ^3 run playsound entity.generic.explode hostile @s ~ ~ ~ 1 2


text:
#> asset:mob/0174.burning_blaze/action/laser.shot.loop
#
#
#
# @within function asset:mob/0174.burning_blaze/action/laser.shot
# @within function asset:mob/0174.burning_blaze/action/laser.shot.loop

# 演出
    particle dripping_lava ^ ^ ^ 0.1 0.1 0.1 0 5 force @a
    particle lava ~ ~ ~ 0.1 0.1 0.1 0 3 force @a

# ヒット判定
    execute positioned ~-1 ~-1 ~-1 run tag @a[tag=!PlayerShouldInvulnerable,dx=1,dz=1] add Hit

# 再帰
    execute unless entity @p[tag=Hit] positioned ^ ^ ^0.5 if entity @s[distance=..32] if block ^ ^ ^ #lib:no_collision run function asset:mob/0174.burning_blaze/action/laser.shot.loop


text:
#> asset:mob/0174.burning_blaze/action/rush
#
#
#
# @within function asset:mob/0174.burning_blaze/tick/2.tick

# NoAI化
    data modify entity @s NoAI set value true
# スコア設定
    scoreboard players set @s 4U.ActionTime 30
    scoreboard players set @s 4U.NowAction 1
# 向き設定
    execute facing entity @p feet run tp @s ~ ~1 ~ ~ ~
# 透明化
    effect give @s invisibility 3 1 true
# 音
    playsound entity.generic.extinguish_fire hostile @a ~ ~ ~ 2 0 0.5
    playsound entity.generic.extinguish_fire hostile @a ~ ~ ~ 2 0 0.5
    playsound entity.generic.extinguish_fire hostile @a ~ ~ ~ 2 0 0.5


text:
#> asset:mob/0174.burning_blaze/action/laser.tick
#
#
#
# @within function asset:mob/0174.burning_blaze/tick/2.tick

# スコア減らす
    scoreboard players remove @s 4U.ActionTime 1

# プレイヤーへの警告表示
    execute facing entity @p[tag=!PlayerShouldInvulnerable,distance=..32] feet anchored eyes run function asset:mob/0174.burning_blaze/action/laser.line

# スコアがなくなったら発動
    execute if score @s 4U.ActionTime matches ..0 run function asset:mob/0174.burning_blaze/action/laser.shot


text:
#> asset:mob/0174.burning_blaze/action/shot
#
#
#
# @within function asset:mob/0174.burning_blaze/tick/2.tick

#> private
# @private
    #declare tag Spread

# 周囲のスモールファイヤーボールけす
    kill @e[type=small_fireball,distance=..3]

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

# 前進拡散
    summon marker ~ ~ ~ {Tags:[Spread]}
    execute as @e[type=marker,tag=Spread] at @s facing entity @p[tag=!PlayerShouldInvulnerable] feet run tp @s ~ ~ ~ ~ ~
    data modify storage lib: Argument set value {Distance:20,Spread:2}
    execute as @e[type=marker,tag=Spread] at @s run function lib:forward_spreader/circle

# さっき召喚したAECを前進拡散に向ける
    execute as @e[type=area_effect_cloud,distance=..0.01,limit=1] facing entity @e[type=marker,tag=Spread,limit=1] feet anchored eyes positioned ^ ^ ^0.02 run tp @s ~ ~0.5 ~ ~ ~

# 前進拡散マーカー消す
    kill @e[type=marker,tag=Spread,distance=..30]


text:
#> asset:mob/0174.burning_blaze/action/rush.hit
#
#
#
# @within function asset:mob/0174.burning_blaze/action/rush.tick

# ダメージ
    data modify storage lib: Argument set value {Damage:25,AttackType:Physical,AttackElement:Fire}
    function lib:damage/modifier
    execute as @a[tag=Hit] run function lib:damage/
    function lib:damage/reset

# スコア設定
    scoreboard players set @s 4U.NowAction 0
    scoreboard players set @s 4U.ActionTime 0
# NoAIもどす
    data modify entity @s NoAI set value false
# エフェクトけす
    effect clear @s invisibility

# 演出
    playsound block.anvil.land hostile @a ~ ~ ~ 2 0 0.5


text:
#> asset:mob/0174.burning_blaze/action/laser
#
#
#
# @within function asset:mob/0174.burning_blaze/tick/2.tick

# スコア設定
    scoreboard players set @s 4U.ActionTime 60
    scoreboard players set @s 4U.NowAction 2


text:
#> asset:mob/0174.burning_blaze/action/laser.line
#
#
#
# @within function asset:mob/0174.burning_blaze/action/laser.tick
# @within function asset:mob/0174.burning_blaze/action/laser.line

# 演出
    particle dust 0.627 0.016 0.016 0.75 ~ ~ ~ 0 0 0 0 1

# 警告音を鳴らす
    execute positioned ~-1 ~-1 ~-1 if entity @p[dx=1,dy=1] run playsound minecraft:block.note_block.bell hostile @p[tag=!PlayerShouldInvulnerable,distance=..32] ~ ~ ~ 1 2 1

# 再帰
    execute positioned ^ ^ ^0.5 if entity @s[distance=..32] if block ^ ^ ^0.5 #lib:no_collision run function asset:mob/0174.burning_blaze/action/laser.line


text:
#> asset:mob/0174.burning_blaze/action/rush.tick
#
#
#
# @within function asset:mob/0174.burning_blaze/tick/2.tick

# スコアを減らす
    scoreboard players remove @s 4U.ActionTime 1

# ヒットした相手にタグをつける
    execute positioned ^ ^ ^0.5 positioned ~-1 ~-1 ~-1 run tag @a[tag=!PlayerShouldInvulnerable,dx=1,dz=1] add Hit
    execute positioned ^ ^ ^1.0 positioned ~-1 ~-1 ~-1 run tag @a[tag=!PlayerShouldInvulnerable,dx=1,dz=1] add Hit

# 演出
    execute positioned ^ ^ ^0.5 run particle dripping_lava ~ ~0.5 ~ 0.2 0.2 0.2 0 10 normal
    execute positioned ^ ^ ^1.0 run particle dripping_lava ~ ~0.5 ~ 0.2 0.2 0.2 0 10 normal

# ActionTimeが終わった時に実行
    execute if score @s 4U.ActionTime matches 0 run function asset:mob/0174.burning_blaze/action/rush.hit
# ActionTimeが残ってるときに実行
    # ブロックにぶつかると発動
        execute if score @s 4U.ActionTime matches ..40 unless block ^ ^ ^1.0 #lib:air run function asset:mob/0174.burning_blaze/action/rush.hit
    # プレイヤーにヒットすると発動
        execute if score @s 4U.ActionTime matches ..40 if entity @p[tag=Hit] run function asset:mob/0174.burning_blaze/action/rush.hit

# ヒットタグを消す
    tag @a[tag=Hit] remove Hit

# ActionTimeが残ってる場合前進
    execute if score @s 4U.ActionTime matches ..40 if block ^ ^ ^1.0 #lib:air run tp @s ^ ^ ^1.0


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

#> private
# @private
    #declare score_holder $Random
    #declare score_holder $Probability

# 演出
    particle falling_lava ~ ~0.8 ~ 0.5 0.5 0.5 0 10 force @a
    particle dust 1 0.149 0 1 ~ ~0.7 ~ 0.3 0.3 0.3 0 10 force @a

# 行動決定乱数生成
    execute store result score $Random Temporary run function lib:random/
    scoreboard players operation $Random Temporary %= $900 Const

# 各行動の処理
    execute if score @s 4U.NowAction matches 1 run function asset:mob/0174.burning_blaze/action/rush.tick
    execute if score @s 4U.NowAction matches 2 run function asset:mob/0174.burning_blaze/action/laser.tick

# 行動決定
    execute if entity @p[tag=!PlayerShouldInvulnerable,distance=..32] if score $Random Temporary matches 0..5 if score @s 4U.ActionTime matches ..0 run function asset:mob/0174.burning_blaze/action/rush
    execute if entity @p[tag=!PlayerShouldInvulnerable,distance=..32] if score $Random Temporary matches 6..10 if score @s 4U.ActionTime matches ..0 run function asset:mob/0174.burning_blaze/action/laser

# バニラ火球を置き換え
    execute if entity @e[type=small_fireball,distance=..3] run function asset:mob/0174.burning_blaze/action/shot

# リセット
    scoreboard players reset $Random Temporary
    scoreboard players reset $Probability Temporary


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

execute if data storage asset:context {id:174} run function asset:mob/0174.burning_blaze/tick/2.tick


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

# 骨をばらまく
    summon item ~ ~ ~ {Motion:[0.0,0.5,0.0],Item:{id:"minecraft:bone",Count:1b}}
    summon item ~ ~ ~ {Motion:[0.0,0.5,-0.4],Item:{id:"minecraft:bone",Count:1b}}
    summon item ~ ~ ~ {Motion:[0.0,0.5,0.4],Item:{id:"minecraft:bone",Count:1b}}
    summon item ~ ~ ~ {Motion:[0.4,0.5,0.0],Item:{id:"minecraft:bone",Count:1b}}
    summon item ~ ~ ~ {Motion:[-0.4,0.5,0.0],Item:{id:"minecraft:bone",Count:1b}}


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

execute if data storage asset:context {id:89} run function asset:mob/0089.decapitation/death/2.death


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

# 元となるMobを召喚する
    summon skeleton ~ ~ ~ {Tags:["MobInit","AlwaysInvisible"],DeathLootTable:"asset:mob/death/0089.decapitation"}
# ID (int)
    data modify storage asset:mob ID set value 89
# Type (string) Wikiを参照
    data modify storage asset:mob Type set value "Enemy"
# 干渉可能か否か (boolean)
    data modify storage asset:mob Interferable set value true
# 名前 (TextComponentString) (オプション)
    data modify storage asset:mob Name set value '{"text":"断切者","color":"dark_red"}'
# 武器
    # メインハンド (Compound(Item)) (オプション)
        data modify storage asset:mob Weapon.Mainhand set value {id:"minecraft:stick",Count:1b,tag:{CustomModelData:20022}}
    # オフハンド (Compound(Item)) (オプション)
        # data modify storage asset:mob Weapon.Offhand set value
# 武器ドロップ率 ([float, float]) (オプション)
    # data modify storage asset:mob WeaponDropChances set value
# 防具
    # 頭 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Head set value {id:"minecraft:stick",Count:1b,tag:{CustomModelData:20021}}
    # 胴 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Chest set value {id:"minecraft:leather_chestplate",Count:1b,tag:{display:{color:9207149}}}
    # 脚 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Legs set value {id:"minecraft:leather_leggings",Count:1b,tag:{display:{color:9207149}}}
    # 足 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Feet set value {id:"minecraft:leather_boots",Count:1b,tag:{display:{color:9207149}}}
# 防具ドロップ率 ([float, float]) (オプション)
    # data modify storage asset:mob ArmorDropChances set value
# 体力 (double) (オプション)
    data modify storage asset:mob Health set value 310
# 攻撃力 (double) (オプション)
    data modify storage asset:mob AttackDamage set value 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.22
# 索敵範囲 (double) (オプション)
    data modify storage asset:mob FollowRange set value 32
# ノックバック耐性 (double) (オプション)
    data modify storage asset:mob KnockBackResist set value 0.8
# 属性倍率 // 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 0.9
    # 火倍率 (float) (オプション)
        data modify storage asset:mob Resist.Fire set value 0.9
    # 水倍率 (float) (オプション)
        data modify storage asset:mob Resist.Water set value 0.7
    # 雷倍率 (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/0089.decapitation/summon/1.trigger
#
# Mob召喚処理の呼び出し時に実行されるfunction
#
# @within tag/function asset:mob/summon

execute if data storage asset:context {id:89} run function asset:mob/0089.decapitation/summon/2.summon


text:
#> asset:mob/0089.decapitation/hurt/2.1.bone_drop
#
# 骨を落とす
#
# @within function asset:mob/0089.decapitation/hurt/2.hurt

# 演出
    playsound entity.skeleton.death hostile @a ~ ~ ~
# 骨召喚
    summon item ~ ~ ~ {Motion:[0.0,0.5,0.0],Item:{id:"minecraft:bone",Count:1b}}

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


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

# 一定確率でダメージを受けて骨を落とす
    execute if predicate lib:random_pass_per/30 run function asset:mob/0089.decapitation/hurt/2.1.bone_drop

# 被ダメ時に加速
    effect give @s speed 1 2 true


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

execute if data storage asset:context {id:89} run function asset:mob/0089.decapitation/hurt/2.hurt


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

execute if data storage asset:context {id:89} run function asset:mob/0089.decapitation/attack/2.attack


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

# 演出
    execute as @p[tag=Victim] at @s run particle block redstone_block ~ ~ ~ 0.1 0 0.1 0 10
    playsound minecraft:entity.evoker_fangs.attack hostile @a ~ ~ ~ 1 1.5

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

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


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

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


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

execute if data storage asset:context {id:219} run function asset:mob/0219.aorta/death/2.death


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

# 元となるMobを召喚する
    summon zombie ~ ~ ~ {Silent:1b,Tags:["MobInit"],DeathLootTable:"asset:mob/death/0219.aorta"}
# ID (int)
    data modify storage asset:mob ID set value 219
# 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:nether_wart_block",Count:1b,tag:{Enchantments:[{}]}}
    # 胴 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Chest set value {id:"minecraft:leather_chestplate",Count:1b,tag:{Enchantments:[{}],display:{color:12845056}}}
    # 脚 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Legs set value {id:"minecraft:leather_leggings",Count:1b,tag:{Enchantments:[{}],display:{color:12845056}}}
    # 足 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Feet set value {id:"minecraft:leather_boots",Count:1b,tag:{Enchantments:[{}],display:{color:12845056}}}
# 防具ドロップ率 ([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 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 0.0
# 移動速度 (double) (オプション)
    data modify storage asset:mob Speed set value 0.3
# 索敵範囲 (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.4
    # 魔法倍率 (float) (オプション)
        data modify storage asset:mob Resist.Magic set value 1.0
    # 火倍率 (float) (オプション)
        data modify storage asset:mob Resist.Fire set value 0.8
    # 水倍率 (float) (オプション)
        data modify storage asset:mob Resist.Water set value 1.0
    # 雷倍率 (float) (オプション)
        data modify storage asset:mob Resist.Thunder set value 0.4

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


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

execute if data storage asset:context {id:219} run function asset:mob/0219.aorta/summon/2.summon


text:
#> asset:mob/0219.aorta/hurt/3.rupture
#
# 破裂して周囲を回復するよ
#
# @within function asset:mob/0219.aorta/hurt/2.hurt

# 演出
    particle block nether_wart_block ~ ~1.2 ~ 0.4 0.4 0.4 0 50 normal @a
    particle dust 0.769 0 0 2.5 ~ ~1.2 ~ 2 0.4 2 0 150 normal @a
    playsound block.conduit.ambient hostile @a ~ ~ ~ 1 1.2 0

# 透明化する
    effect give @s invisibility 10 10 true

# 周囲を回復
    data modify storage lib: Argument.Heal set value 400f
    function lib:heal/modifier
    execute as @e[type=#lib:living,tag=Enemy,tag=!this,tag=!Uninterferable,distance=..5] run function lib:heal/
    function lib:heal/reset

# 移動速度上昇を付与
    effect give @e[type=#lib:living,tag=Enemy,tag=!this,tag=!Uninterferable,distance=..5] speed 3 2 true

# 奈落行き
    tp @s ~ -999 ~


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

#> Private
# @private
    #declare score_holder $Health

# 演出
    particle dust 0.769 0 0 1 ~ ~1 ~ 0.6 0.6 0.6 0 50 normal @a
    playsound block.conduit.ambient hostile @a ~ ~ ~ 0.8 1.5 0

# 移動速度上昇を得る
    effect give @s speed 3 1 true

# 現在体力を数値化する
    execute store result score $Health Temporary run data get entity @s AbsorptionAmount 1.0

# もし体力が600以下の場合、高確率で破裂する
    execute if score $Health Temporary matches ..600 if predicate lib:random_pass_per/70 run function asset:mob/0219.aorta/hurt/3.rupture

# スコアリセット
    scoreboard players reset $Health Temporary


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

execute if data storage asset:context {id:219} run function asset:mob/0219.aorta/hurt/2.hurt


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

execute if data storage asset:context {id:219} run function asset:mob/0219.aorta/attack/2.attack


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

# 演出
    execute at @p[tag=Victim,distance=..6] run particle dust 0.769 0 0 2 ~ ~1 ~ 0.6 0.6 0.6 0 50 normal @a
    execute at @p[tag=Victim,distance=..6] run playsound block.conduit.ambient hostile @a ~ ~ ~ 0.8 1.5 0

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

# 自身を回復
    data modify storage lib: Argument.Heal set value 500f
    function lib:heal/modifier
    function lib:heal/
# リセット
    function lib:heal/reset

# 周囲に移動速度上昇を付与
    effect give @e[type=#lib:living,tag=Enemy,tag=!Uninterferable,distance=..5] speed 3 1 true


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

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

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


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

execute if data storage asset:context {id:142} run function asset:mob/0142.honey_soldier/summon/2.summon


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

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


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

execute if data storage asset:context {id:142} run function asset:mob/0142.honey_soldier/hurt/2.hurt


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

execute if data storage asset:context {id:142} run function asset:mob/0142.honey_soldier/attack/2.attack


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

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

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

# 与えるダメージ
    data modify storage lib: Argument.Damage set value 28f
# 属性
    data modify storage lib: Argument.AttackType set value "Magic"
    data modify storage lib: Argument.ElementType set value "Water"
# デスログ
    data modify storage lib: Argument.DeathMessage append value '{"translate": "%1$sは%2$sによってべとべとに斬り裂かれた","with":[{"selector":"@s"},{"nbt":"Return.AttackerName","storage":"lib:","interpret":true}]}'
    data modify storage lib: Argument.DeathMessage append value '{"translate": "%1$sは%2$sにハチの巣の材料にされた","with":[{"selector":"@s"},{"nbt":"Return.AttackerName","storage":"lib:","interpret":true}]}'
# 補正functionを実行
    function lib:damage/modifier
# 対象
    execute as @p[tag=Victim,distance=..32] run function lib:damage/
# リセット
    function lib:damage/reset


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

#> 定義類はここに
# @within function asset:mob/1005.blue_star/**
    scoreboard objectives add RX.Time dummy


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

# loop
    execute if entity @a[scores={RX.Time=1..},limit=1] run schedule function asset:mob/1005.blue_star/attack/3.scheduleloop 1t replace


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

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


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

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


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

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

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


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

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


text:
#> asset:mob/1005.blue_star/attack/5.reset
#
#
#
# @within function asset:mob/1005.blue_star/attack/4.mp_inversion

# 0になった時
    playsound entity.generic.extinguish_fire player @a ~ ~ ~ 1 1
    scoreboard players reset @s RX.Time
# 消す
    data modify storage api: Argument.UUID set value [I;1,2,1005,0]
    function api:modifier/mp_regen/remove
# リセット
    scoreboard players reset @s RX.Time


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

# 実行
    execute as @a[scores={RX.Time=1..}] at @s run function asset:mob/1005.blue_star/attack/4.mp_inversion
# loop
    execute if entity @a[scores={RX.Time=1..},limit=1] run schedule function asset:mob/1005.blue_star/attack/3.scheduleloop 1t replace


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

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


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

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

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

# 引数の設定
    # UUID
        data modify storage api: Argument.UUID set value [I;1,2,1005,0]
    # 補正値
        data modify storage api: Argument.Amount set value -1
    # 補正方法
        data modify storage api: Argument.Operation set value "multiply"
# 補正の追加
    execute as @a[tag=Victim,distance=..30] run function api:modifier/mp_regen/add

# スコアを与える
    scoreboard players add @a[tag=Victim,distance=..30] RX.Time 40
# Schedulelooopするやつ
    schedule function asset:mob/1005.blue_star/attack/3.scheduleloop 1t replace


text:
#> asset:mob/1005.blue_star/attack/4.mp_inversion
#
#
#
# @within function asset:mob/1005.blue_star/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 RX.Time 1

# 途中で死んだ時
    execute if entity @s[tag=Death] run function asset:mob/1005.blue_star/attack/5.reset

# 0になった時
    execute if score @s RX.Time matches 0 run function asset:mob/1005.blue_star/attack/5.reset


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

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


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

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


text:
#> asset:mob/1010.starfury/_index.d
# @private

#> tag
# @within function asset:mob/1010.starfury/**
    #declare tag S2.Wait
    #declare tag S2.Fire
    #declare tag S2.Water
    #declare tag S2.Thunder


text:
#> asset:mob/1010.starfury/summon/2.summon
#
# Mobの召喚時の処理
#
# @within function asset:mob/1010.starfury/summon/1.trigger
#> private
# @private
    #declare score_holder $Random

# 元となるMobを召喚する
    summon area_effect_cloud ~ ~ ~ {Tags:["MobInit","S2.Wait"],CustomNameVisible:0b,Particle:"block air",Duration:100}
# ID (int)
    data modify storage asset:mob ID set value 1010
# 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 store result score $Random Temporary run function lib:random/
# ほしい範囲に剰余算する
    scoreboard players operation $Random Temporary %= $3 Const
# デバッグのコマンド
    #scoreboard players set $Random Temporary 0
# スキル選択
    execute if score $Random Temporary matches 0 run tag @e[type=area_effect_cloud,tag=MobInit,distance=..0.01] add S2.Fire
    execute if score $Random Temporary matches 1 run tag @e[type=area_effect_cloud,tag=MobInit,distance=..0.01] add S2.Water
    execute if score $Random Temporary matches 2 run tag @e[type=area_effect_cloud,tag=MobInit,distance=..0.01] add S2.Thunder
# リセット
    scoreboard players reset $Random Temporary

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


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

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


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

# particle
    execute if entity @s[tag=S2.Fire] run particle minecraft:dust 1000000000 1 0 1 ~ ~ ~ 0 0 0 0 1 force @a[distance=..100]
    execute if entity @s[tag=S2.Water] run particle dust 1 1000000000 1000000000 1 ~ ~ ~ 0 0 0 1 1 force @a[distance=..100]
    execute if entity @s[tag=S2.Thunder] run particle dust 10000000000 10000000000 1 1 ~ ~ ~ 0 0 0 1 1 force @a[distance=..100]
    particle electric_spark ~ ~ ~ 0 0 0 0.1 1 force @a

# タグがある状態なら実行
    execute unless entity @s[tag=S2.Wait] at @s run function asset:mob/1010.starfury/tick/3.move
    execute unless entity @s[tag=S2.Wait] at @s run function asset:mob/1010.starfury/tick/3.move
    execute unless entity @s[tag=S2.Wait] at @s run function asset:mob/1010.starfury/tick/3.move
    execute unless entity @s[tag=S2.Wait] at @s run function asset:mob/1010.starfury/tick/3.move


text:
#> asset:mob/1010.starfury/tick/3.move
#
#
#
# @within function asset:mob/1010.starfury/tick/2.tick

# particle
    execute if entity @s[tag=S2.Fire] run particle minecraft:dust 1000000000 1 0 1 ~ ~ ~ 0 0 0 0 1 force @a[distance=..30]
    execute if entity @s[tag=S2.Water] run particle dust 1 1000000000 1000000000 1 ~ ~ ~ 0 0 0 1 1 force @a[distance=..30]
    execute if entity @s[tag=S2.Thunder] run particle dust 10000000000 10000000000 1 1 ~ ~ ~ 0 0 0 1 1 force @a[distance=..30]
    particle electric_spark ~ ~ ~ 0 0 0 0.1 1 force @a[distance=..30]

# 着弾
    execute unless block ~ ~ ~ #lib:no_collision run function asset:mob/1010.starfury/tick/5.landing

# TP
    tp ^ ^ ^0.8

# ダメージ
    execute if entity @p[distance=..1] run function asset:mob/1010.starfury/tick/4.damage


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

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


text:
#> asset:mob/1010.starfury/tick/5.landing
#
#
#
# @within function asset:mob/1010.starfury/tick/3.move

kill @s


text:
#> asset:mob/1010.starfury/tick/4.damage
#
#
#
# @within function asset:mob/1010.starfury/tick/3.move

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

# キル
    kill @s


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

#> 定義類はここに
# @within function asset:mob/0188.fireball/**
    scoreboard objectives add 58.Range dummy
    scoreboard objectives add 58.Speed dummy
    scoreboard objectives add 58.Recursive dummy


text:
#> asset:mob/0188.fireball/_index.d
# @private

#> tag
# @within function asset:mob/0188.fireball/**
    #declare tag 58.Start

#> tag
# @within function
#   asset:mob/0188.fireball/**
#   asset:mob/0187.flame_mage/event/shoot_magic
    #declare tag 58.Init


text:
#> asset:mob/0188.fireball/event/hit
#
#
#
# @within function asset:mob/0188.fireball/tick/move

# 引数の設定
    # 与えるダメージ = 7.5
        data modify storage lib: Argument.Damage set value 30.0f
    # 第一属性
        data modify storage lib: Argument.AttackType set value "Magic"
    # 第二属性
        data modify storage lib: Argument.ElementType set value "Fire"
# 補正functionを実行
    function lib:damage/modifier
# ダメージを与える
    execute as @p[dx=0] unless entity @s[gamemode=!adventure,gamemode=!survival] at @s run function lib:damage/
# リセット
    function lib:damage/reset

# 消失
    kill @s


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

# 元となるMobを召喚する
    summon marker ~ ~ ~ {Tags:["MobInit","58.Init"]}
# ID (int)
    data modify storage asset:mob ID set value 188
# 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/0188.fireball/summon/1.trigger
#
# Mob召喚処理の呼び出し時に実行されるfunction
#
# @within tag/function asset:mob/summon

execute if data storage asset:context {id:188} run function asset:mob/0188.fireball/summon/2.summon


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

# パーティクル
    particle smoke ~ ~ ~ 0.1 0.1 0.1 0.001 3

# 再帰カウントが0なら弾速からセット
    scoreboard players operation @s 58.Recursive = @s 58.Speed

# 移動
    execute if entity @s[tag=58.Start] run function asset:mob/0188.fireball/tick/move

# Init
    execute if entity @s[tag=58.Init] run function asset:mob/0188.fireball/tick/init


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

execute if data storage asset:context {id:188} run function asset:mob/0188.fireball/tick/2.tick


text:
#> asset:mob/0188.fireball/tick/move
#
#
#
# @within function
#   asset:mob/0188.fireball/tick/2.tick
#   asset:mob/0188.fireball/tick/move

# パーティクル
    particle flame ~ ~ ~ 0.1 0.1 0.1 0.005 1
    particle dust 1 0.5 0 1 ~ ~ ~ 0 0 0 0 1 force @a[distance=..30]

# 前進
    execute if entity @s[scores={58.Recursive=1..,58.Range=1..}] run tp @s ^ ^ ^0.25 ~ ~

# スコア減算
    scoreboard players remove @s 58.Recursive 1
    scoreboard players remove @s 58.Range 1

# プレイヤーの衝突判定
    execute positioned ~-0.5 ~0.0 ~-0.5 if entity @p[dx=0] run function asset:mob/0188.fireball/event/hit

# 壁の衝突判定
    execute unless block ~ ~ ~ #lib:no_collision run function asset:mob/0188.fireball/event/hit

# 再帰
    execute if entity @s[scores={58.Recursive=1..,58.Range=1..}] at @s run function asset:mob/0188.fireball/tick/move

# キル
    execute if entity @s[scores={58.Range=0}] run kill @s


text:
#> asset:mob/0188.fireball/tick/init
#
#
#
# @within function asset:mob/0188.fireball/tick/2.tick

# スコア
    scoreboard players set @s 58.Range 100
    scoreboard players set @s 58.Speed 4

# タグ整理
    tag @s remove 58.Init
    tag @s add 58.Start


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

#> 定義類はここに
# @within function asset:mob/0190.thunder_mage/**
    scoreboard objectives add 5A.Tick dummy


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

# 音
    playsound minecraft:entity.vex.ambient hostile @a ~ ~ ~ 1 0.5
    playsound minecraft:entity.phantom.hurt hostile @a ~ ~ ~ 1 0


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

execute if data storage asset:context {id:190} run function asset:mob/0190.thunder_mage/death/2.death


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

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

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


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

execute if data storage asset:context {id:190} run function asset:mob/0190.thunder_mage/summon/2.summon


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

# サウンド
    playsound minecraft:entity.vex.hurt hostile @a ~ ~ ~ 1 0.5
    playsound minecraft:entity.vex.hurt hostile @a ~ ~ ~ 1 0.7


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

execute if data storage asset:context {id:190} run function asset:mob/0190.thunder_mage/hurt/2.hurt


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

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

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

# 発動
    execute if score @s 5A.Tick matches 80 run function asset:mob/0190.thunder_mage/tick/3.attack


text:
#> asset:mob/0190.thunder_mage/tick/3.attack
#
#
#
# @within function asset:mob/0190.thunder_mage/tick/2.tick
#> Private
# @private
    #declare score_holder $Random

# 最寄りのプレイヤーに対して発動（範囲内にいないなら不発）
    data modify storage api: Argument.ID set value 191
    execute at @r[gamemode=!spectator,distance=..15] run function api:mob/summon

# 次に攻撃するタイミングをランダムにする
# 疑似乱数取得
    execute store result score $Random Temporary run function lib:random/
# 剰余算する
    scoreboard players operation $Random Temporary %= $31 Const
# スコアセットセット
    scoreboard players operation @s 5A.Tick = $Random Temporary
# スコアセットされたものから少し減らす
    scoreboard players remove @s 5A.Tick 60

# リセット
    scoreboard players reset $Random Temporary