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

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


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

#> 定義類はここに
# @within function asset:mob/0156.infringement/**
    scoreboard objectives add 4C.Tick dummy

repo_name: ProjectTSB/TheSkyBlessing

repo_language: mcfunction

mime_type: text/plain


text:
#> asset:mob/0156.infringement/_index.d
# @private

#> tag
# @within function asset:mob/0156.infringement/**
    #declare tag 4C.Alert


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

# 元となるMobを召喚する
    summon zombie ~ ~ ~ {Tags:["MobInit","AlwaysInvisible"],Silent:1b,DeathLootTable:"asset:mob/death/0156.infringement"}
# ID (int)
    data modify storage asset:mob ID set value 156
# 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 {id:"minecraft:stick",Count:1b,tag:{CustomModelData:20066,Enchantments:[{id:"minecraft:knockback",lvl:3s}]}}
    # オフハンド (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:blue_glazed_terracotta",Count:1b}
    # 胴 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Chest set value {id:"minecraft:leather_chestplate",Count:1b,tag:{display:{color:4228863}}}
    # 脚 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Legs set value {id:"minecraft:leather_leggings",Count:1b,tag:{display:{color:2511001}}}
    # 足 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Feet set value {id:"minecraft:leather_boots",Count:1b,tag:{display:{color:1123397}}}
# 防具ドロップ率 ([float, float]) (オプション)
    # data modify storage asset:mob ArmorDropChances set value
# 体力 (double) (オプション)
    data modify storage asset:mob Health set value 2700
# 攻撃力 (double) (オプション)
    data modify storage asset:mob AttackDamage set value 5
# 防御力 (double) (オプション) // 被ダメージがある程度大きい場合1ptにつき0.8%カット、小さい場合1ptにつき約4%カット 20pt以上は頭打ち
    data modify storage asset:mob Defense set value -6
# 特殊防御力 (double) (オプション) // 4pointにつきダメージを大きく減らす
    # data modify storage asset:mob SpecialDefense set value
# 移動速度 (double) (オプション)
    # data modify storage asset:mob Speed set value
# 索敵範囲 (double) (オプション)
    # data modify storage asset:mob FollowRange set value
# ノックバック耐性 (double) (オプション)
    # data modify storage asset:mob KnockBackResist set value
# 属性倍率 // 1.0fで100% 最低でも25%は軽減されずに入る
    # 物理倍率 (float) (オプション)
        data modify storage asset:mob Resist.Physical set value 1
    # 魔法倍率 (float) (オプション)
        data modify storage asset:mob Resist.Magic set value 1
    # 火倍率 (float) (オプション)
        data modify storage asset:mob Resist.Fire set value 0.4
    # 水倍率 (float) (オプション)
        data modify storage asset:mob Resist.Water set value 0.7
    # 雷倍率 (float) (オプション)
        data modify storage asset:mob Resist.Thunder set value 0.8

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


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

execute if data storage asset:context {id:156} run function asset:mob/0156.infringement/summon/2.summon


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

# 演出
    playsound minecraft:entity.guardian.hurt hostile @a ~ ~ ~ 1 2


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

execute if data storage asset:context {id:156} run function asset:mob/0156.infringement/hurt/2.hurt


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

execute if data storage asset:context {id:156} run function asset:mob/0156.infringement/attack/2.attack


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

# 演出
    execute at @p[tag=Victim,distance=..32] run particle splash ~ ~1.2 ~ 0.6 0.5 0.6 0 50 normal @a
    execute at @p[tag=Victim,distance=..32] run particle dust 0.145 0.792 0.812 1.3 ~ ~1.2 ~ 0.5 0.4 0.5 1 30 normal @a
    playsound minecraft:entity.guardian.hurt hostile @a ~ ~ ~ 0.6 1 0
    playsound minecraft:entity.generic.swim hostile @a ~ ~ ~ 0.5 0.7 0
    playsound minecraft:block.glass.break hostile @a ~ ~ ~ 1.4 1.3 0

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

# 鈍足を与える
    effect give @p[tag=Victim,distance=..32] slowness 1 3


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

# 周囲にプレイヤーがいたらスコアを増やす
    execute if entity @a[distance=..6] unless entity @s[tag=4C.Alert] run scoreboard players add @s 4C.Tick 1
# タグがついたら強制的に増え続ける
    execute if entity @s[tag=4C.Alert] run scoreboard players add @s 4C.Tick 1

# 一定時間で発動
    execute if score @s 4C.Tick matches 70 run function asset:mob/0156.infringement/tick/3.alert

# 自爆する
    execute if score @s 4C.Tick matches 100 run function asset:mob/0156.infringement/tick/4.explode


text:
#> asset:mob/0156.infringement/tick/3.alert
#
#
#
# @within function asset:mob/0156.infringement/tick/2.tick

# タグ付け
    tag @s add 4C.Alert

# 演出
    playsound entity.creeper.primed hostile @a
    item replace entity @s armor.head with budding_amethyst 1
    item replace entity @s armor.chest with leather_chestplate{display:{color:10376447}} 1
    item replace entity @s armor.legs with leather_leggings{display:{color:8075474}} 1
    item replace entity @s armor.feet with leather_boots{display:{color:4919448}} 1

# 発光
    effect give @s glowing 9999 1 true


text:
#> asset:mob/0156.infringement/tick/vfx
#
#
#
# @within function asset:mob/0156.infringement/tick/4.explode

# 演出
    playsound minecraft:block.anvil.land hostile @a ~ ~ ~ 1 1
    playsound minecraft:entity.evoker.prepare_attack hostile @s ~ ~ ~ 1 1.4
# [ImportKey]: NobwRALgngDgpmAXGAxgSwE4oDYIDRgCuhaAJkmAEYAcADHAEwAstAzALQBmTnHPc1dtWoBDAJztSpJiO60A7J1o0wBAHYiAtgmSAwxQAEARlVgYIjFoDOScCgD2hNRCQsCKOE7gYbYAG4jsQh1wAA8kWgIocIBfaIILUjRCa0QmAksIc2dECLA4bGw0GEsdQ1pcjDtMiB1ctEsAUQKikoaAR0IA7CgAZTN3ckROAJLYvHBoeAp0LFwTYjJpkVYAVlZ6DjhuFfYeaiZ2SkpxdloGADZWSlZhw3l5VhMNbQoDQ3Z7GCiCMwtNFNsDicLly7k83kQ4H8gWCYDCOUiMTiYASSRSrHSmQw2Vy+UKxVK5XiVRENXCBHqTXxrQ6XV6-Tgg2G2FGcQmsB0qEwOHwRBIgzAhhWtBWTDgrEEhhoEh4Yg4lBW5x21E4cjE8kotBQIgYTy0nLeHzsXyNXxMvysPnsjmyDFBHhqEKhASCPnhuSiOTGKJEiWSSAYmKy5LyzQJSDKFRJZIRYEpYZpnQK9JEAyQzNZ40gHIoMDs3QA5nY1PN+RQxShDChSCgGOx7kwDkwGJx5Id5NRKOwxCJqOd5CgUKw4Irec9OYAsTUAS5GAI30jObzJbIaggdlqG4HV4fNDXcv3YivcjUf7UkHsSG8S1CVHqrU3HYMGot4hDIYCAArQiaGARgiUOAAF5oM+aRxo0CZwO0SbdH0qaMkgEAYEEFKWAAQoBwEYFBdKwWmiCIUEsQALpAA_3
# 円 1-copy-copy
particle crit ^0 ^ ^-2 0 0 0 0 1
particle crit ^0.61803 ^ ^-1.90211 0 0 0 0 1
particle crit ^1.17557 ^ ^-1.61803 0 0 0 0 1
particle crit ^1.61803 ^ ^-1.17557 0 0 0 0 1
particle crit ^1.90211 ^ ^-0.61803 0 0 0 0 1
particle crit ^2 ^ ^0 0 0 0 0 1
particle crit ^1.90211 ^ ^0.61803 0 0 0 0 1
particle crit ^1.61803 ^ ^1.17557 0 0 0 0 1
particle crit ^1.17557 ^ ^1.61803 0 0 0 0 1
particle crit ^0.61803 ^ ^1.90211 0 0 0 0 1
particle crit ^0 ^ ^2 0 0 0 0 1
particle crit ^-0.61803 ^ ^1.90211 0 0 0 0 1
particle crit ^-1.17557 ^ ^1.61803 0 0 0 0 1
particle crit ^-1.61803 ^ ^1.17557 0 0 0 0 1
particle crit ^-1.90211 ^ ^0.61803 0 0 0 0 1
particle crit ^-2 ^ ^0 0 0 0 0 1
particle crit ^-1.90211 ^ ^-0.61803 0 0 0 0 1
particle crit ^-1.61803 ^ ^-1.17557 0 0 0 0 1
particle crit ^-1.17557 ^ ^-1.61803 0 0 0 0 1
particle crit ^-0.61803 ^ ^-1.90211 0 0 0 0 1
# 円 1
particle crit ^0 ^ ^-4 0 0 0 0 1
particle crit ^0.62574 ^ ^-3.95075 0 0 0 0 1
particle crit ^1.23607 ^ ^-3.80423 0 0 0 0 1
particle crit ^1.81596 ^ ^-3.56403 0 0 0 0 1
particle crit ^2.35114 ^ ^-3.23607 0 0 0 0 1
particle crit ^2.82843 ^ ^-2.82843 0 0 0 0 1
particle crit ^3.23607 ^ ^-2.35114 0 0 0 0 1
particle crit ^3.56403 ^ ^-1.81596 0 0 0 0 1
particle crit ^3.80423 ^ ^-1.23607 0 0 0 0 1
particle crit ^3.95075 ^ ^-0.62574 0 0 0 0 1
particle crit ^4 ^ ^0 0 0 0 0 1
particle crit ^3.95075 ^ ^0.62574 0 0 0 0 1
particle crit ^3.80423 ^ ^1.23607 0 0 0 0 1
particle crit ^3.56403 ^ ^1.81596 0 0 0 0 1
particle crit ^3.23607 ^ ^2.35114 0 0 0 0 1
particle crit ^2.82843 ^ ^2.82843 0 0 0 0 1
particle crit ^2.35114 ^ ^3.23607 0 0 0 0 1
particle crit ^1.81596 ^ ^3.56403 0 0 0 0 1
particle crit ^1.23607 ^ ^3.80423 0 0 0 0 1
particle crit ^0.62574 ^ ^3.95075 0 0 0 0 1
particle crit ^0 ^ ^4 0 0 0 0 1
particle crit ^-0.62574 ^ ^3.95075 0 0 0 0 1
particle crit ^-1.23607 ^ ^3.80423 0 0 0 0 1
particle crit ^-1.81596 ^ ^3.56403 0 0 0 0 1
particle crit ^-2.35114 ^ ^3.23607 0 0 0 0 1
particle crit ^-2.82843 ^ ^2.82843 0 0 0 0 1
particle crit ^-3.23607 ^ ^2.35114 0 0 0 0 1
particle crit ^-3.56403 ^ ^1.81596 0 0 0 0 1
particle crit ^-3.80423 ^ ^1.23607 0 0 0 0 1
particle crit ^-3.95075 ^ ^0.62574 0 0 0 0 1
particle crit ^-4 ^ ^0 0 0 0 0 1
particle crit ^-3.95075 ^ ^-0.62574 0 0 0 0 1
particle crit ^-3.80423 ^ ^-1.23607 0 0 0 0 1
particle crit ^-3.56403 ^ ^-1.81596 0 0 0 0 1
particle crit ^-3.23607 ^ ^-2.35114 0 0 0 0 1
particle crit ^-2.82843 ^ ^-2.82843 0 0 0 0 1
particle crit ^-2.35114 ^ ^-3.23607 0 0 0 0 1
particle crit ^-1.81596 ^ ^-3.56403 0 0 0 0 1
particle crit ^-1.23607 ^ ^-3.80423 0 0 0 0 1
particle crit ^-0.62574 ^ ^-3.95075 0 0 0 0 1
# 円 1-copy
particle crit ^0 ^ ^-3 0 0 0 0 1
particle crit ^0.4693 ^ ^-2.96307 0 0 0 0 1
particle crit ^0.92705 ^ ^-2.85317 0 0 0 0 1
particle crit ^1.36197 ^ ^-2.67302 0 0 0 0 1
particle crit ^1.76336 ^ ^-2.42705 0 0 0 0 1
particle crit ^2.12132 ^ ^-2.12132 0 0 0 0 1
particle crit ^2.42705 ^ ^-1.76336 0 0 0 0 1
particle crit ^2.67302 ^ ^-1.36197 0 0 0 0 1
particle crit ^2.85317 ^ ^-0.92705 0 0 0 0 1
particle crit ^2.96307 ^ ^-0.4693 0 0 0 0 1
particle crit ^3 ^ ^0 0 0 0 0 1
particle crit ^2.96307 ^ ^0.4693 0 0 0 0 1
particle crit ^2.85317 ^ ^0.92705 0 0 0 0 1
particle crit ^2.67302 ^ ^1.36197 0 0 0 0 1
particle crit ^2.42705 ^ ^1.76336 0 0 0 0 1
particle crit ^2.12132 ^ ^2.12132 0 0 0 0 1
particle crit ^1.76336 ^ ^2.42705 0 0 0 0 1
particle crit ^1.36197 ^ ^2.67302 0 0 0 0 1
particle crit ^0.92705 ^ ^2.85317 0 0 0 0 1
particle crit ^0.4693 ^ ^2.96307 0 0 0 0 1
particle crit ^0 ^ ^3 0 0 0 0 1
particle crit ^-0.4693 ^ ^2.96307 0 0 0 0 1
particle crit ^-0.92705 ^ ^2.85317 0 0 0 0 1
particle crit ^-1.36197 ^ ^2.67302 0 0 0 0 1
particle crit ^-1.76336 ^ ^2.42705 0 0 0 0 1
particle crit ^-2.12132 ^ ^2.12132 0 0 0 0 1
particle crit ^-2.42705 ^ ^1.76336 0 0 0 0 1
particle crit ^-2.67302 ^ ^1.36197 0 0 0 0 1
particle crit ^-2.85317 ^ ^0.92705 0 0 0 0 1
particle crit ^-2.96307 ^ ^0.4693 0 0 0 0 1
particle crit ^-3 ^ ^0 0 0 0 0 1
particle crit ^-2.96307 ^ ^-0.4693 0 0 0 0 1
particle crit ^-2.85317 ^ ^-0.92705 0 0 0 0 1
particle crit ^-2.67302 ^ ^-1.36197 0 0 0 0 1
particle crit ^-2.42705 ^ ^-1.76336 0 0 0 0 1
particle crit ^-2.12132 ^ ^-2.12132 0 0 0 0 1
particle crit ^-1.76336 ^ ^-2.42705 0 0 0 0 1
particle crit ^-1.36197 ^ ^-2.67302 0 0 0 0 1
particle crit ^-0.92705 ^ ^-2.85317 0 0 0 0 1
particle crit ^-0.4693 ^ ^-2.96307 0 0 0 0 1
# 多角形 1
particle crit ^0 ^ ^-4 0 0 0 0 1
particle crit ^0.32868 ^ ^-4.49937 0 0 0 0 1
particle crit ^0.68765 ^ ^-4.97728 0 0 0 0 1
particle crit ^1.10323 ^ ^-5.40582 0 0 0 0 1
particle crit ^1.64488 ^ ^-5.60134 0 0 0 0 1
particle crit ^1.99474 ^ ^-5.14395 0 0 0 0 1
particle crit ^2.11255 ^ ^-4.55873 0 0 0 0 1
particle crit ^2.15603 ^ ^-3.9626 0 0 0 0 1
particle crit ^2.16243 ^ ^-3.36481 0 0 0 0 1
particle crit ^2.70888 ^ ^-3.60726 0 0 0 0 1
particle crit ^3.26923 ^ ^-3.81527 0 0 0 0 1
particle crit ^3.85051 ^ ^-3.95116 0 0 0 0 1
particle crit ^4.41188 ^ ^-3.82286 0 0 0 0 1
particle crit ^4.45895 ^ ^-3.24894 0 0 0 0 1
particle crit ^4.2417 ^ ^-2.69293 0 0 0 0 1
particle crit ^3.95603 ^ ^-2.16791 0 0 0 0 1
particle crit ^3.63826 ^ ^-1.66154 0 0 0 0 1
particle crit ^4.22904 ^ ^-1.5701 0 0 0 0 1
particle crit ^4.81291 ^ ^-1.4422 0 0 0 0 1
particle crit ^5.37539 ^ ^-1.24229 0 0 0 0 1
particle crit ^5.77831 ^ ^-0.83088 0 0 0 0 1
particle crit ^5.50767 ^ ^-0.3226 0 0 0 0 1
particle crit ^5.02433 ^ ^0.02773 0 0 0 0 1
particle crit ^4.50018 ^ ^0.31501 0 0 0 0 1
particle crit ^3.95911 ^ ^0.56923 0 0 0 0 1
particle crit ^4.40667 ^ ^0.96557 0 0 0 0 1
particle crit ^4.82869 ^ ^1.38885 0 0 0 0 1
particle crit ^5.19379 ^ ^1.86114 0 0 0 0 1
particle crit ^5.31031 ^ ^2.42507 0 0 0 0 1
particle crit ^4.80783 ^ ^2.70635 0 0 0 0 1
particle crit ^4.21181 ^ ^2.73975 0 0 0 0 1
particle crit ^3.61555 ^ ^2.69804 0 0 0 0 1
particle crit ^3.02292 ^ ^2.61938 0 0 0 0 1
particle crit ^3.1851 ^ ^3.19478 0 0 0 0 1
particle crit ^3.31122 ^ ^3.77903 0 0 0 0 1
particle crit ^3.36296 ^ ^4.37375 0 0 0 0 1
particle crit ^3.15604 ^ ^4.91113 0 0 0 0 1
particle crit ^2.58127 ^ ^4.87603 0 0 0 0 1
particle crit ^2.06184 ^ ^4.58183 0 0 0 0 1
particle crit ^1.58283 ^ ^4.22433 0 0 0 0 1
particle crit ^1.12685 ^ ^3.8377 0 0 0 0 1
particle crit ^0.95224 ^ ^4.40945 0 0 0 0 1
particle crit ^0.74252 ^ ^4.96916 0 0 0 0 1
particle crit ^0.46457 ^ ^5.49746 0 0 0 0 1
particle crit ^0 ^ ^5.8377 0 0 0 0 1
particle crit ^-0.46457 ^ ^5.49746 0 0 0 0 1
particle crit ^-0.74252 ^ ^4.96916 0 0 0 0 1
particle crit ^-0.95224 ^ ^4.40945 0 0 0 0 1
particle crit ^-1.12685 ^ ^3.8377 0 0 0 0 1
particle crit ^-1.58283 ^ ^4.22433 0 0 0 0 1
particle crit ^-2.06184 ^ ^4.58183 0 0 0 0 1
particle crit ^-2.58127 ^ ^4.87603 0 0 0 0 1
particle crit ^-3.15604 ^ ^4.91113 0 0 0 0 1
particle crit ^-3.36296 ^ ^4.37375 0 0 0 0 1
particle crit ^-3.31122 ^ ^3.77903 0 0 0 0 1
particle crit ^-3.1851 ^ ^3.19478 0 0 0 0 1
particle crit ^-3.02292 ^ ^2.61938 0 0 0 0 1
particle crit ^-3.61555 ^ ^2.69804 0 0 0 0 1
particle crit ^-4.21181 ^ ^2.73975 0 0 0 0 1
particle crit ^-4.80783 ^ ^2.70635 0 0 0 0 1
particle crit ^-5.31031 ^ ^2.42507 0 0 0 0 1
particle crit ^-5.19379 ^ ^1.86114 0 0 0 0 1
particle crit ^-4.82869 ^ ^1.38885 0 0 0 0 1
particle crit ^-4.40667 ^ ^0.96557 0 0 0 0 1
particle crit ^-3.95911 ^ ^0.56923 0 0 0 0 1
particle crit ^-4.50018 ^ ^0.31501 0 0 0 0 1
particle crit ^-5.02433 ^ ^0.02773 0 0 0 0 1
particle crit ^-5.50767 ^ ^-0.3226 0 0 0 0 1
particle crit ^-5.77831 ^ ^-0.83088 0 0 0 0 1
particle crit ^-5.37539 ^ ^-1.24229 0 0 0 0 1
particle crit ^-4.81291 ^ ^-1.4422 0 0 0 0 1
particle crit ^-4.22904 ^ ^-1.5701 0 0 0 0 1
particle crit ^-3.63826 ^ ^-1.66154 0 0 0 0 1
particle crit ^-3.95603 ^ ^-2.16791 0 0 0 0 1
particle crit ^-4.2417 ^ ^-2.69293 0 0 0 0 1
particle crit ^-4.45895 ^ ^-3.24894 0 0 0 0 1
particle crit ^-4.41188 ^ ^-3.82286 0 0 0 0 1
particle crit ^-3.85051 ^ ^-3.95116 0 0 0 0 1
particle crit ^-3.26923 ^ ^-3.81527 0 0 0 0 1
particle crit ^-2.70888 ^ ^-3.60726 0 0 0 0 1
particle crit ^-2.16243 ^ ^-3.36481 0 0 0 0 1
particle crit ^-2.15603 ^ ^-3.9626 0 0 0 0 1
particle crit ^-2.11255 ^ ^-4.55873 0 0 0 0 1
particle crit ^-1.99474 ^ ^-5.14395 0 0 0 0 1
particle crit ^-1.64488 ^ ^-5.60134 0 0 0 0 1
particle crit ^-1.10323 ^ ^-5.40582 0 0 0 0 1
particle crit ^-0.68765 ^ ^-4.97728 0 0 0 0 1
particle crit ^-0.32868 ^ ^-4.49937 0 0 0 0 1


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

execute if data storage asset:context {id:156} run function asset:mob/0156.infringement/tick/2.tick


text:
#> asset:mob/0156.infringement/tick/4.explode
#
#
#
# @within function asset:mob/0156.infringement/tick/2.tick

# 周囲のプレイヤーがサバイバルなら周囲の羊毛を全部砂利にする
    execute if entity @p[gamemode=survival,distance=..40] run fill ~3 ~3 ~3 ~-3 ~-3 ~-3 gravel replace #wool

# 周囲のプレイヤーがアドベンチャーなら周囲のプレイヤーをスタンさせる
    # 演出
        execute if entity @p[gamemode=adventure,distance=..40] positioned ~ ~0.3 ~ run function asset:mob/0156.infringement/tick/vfx
    # 効果
        execute if entity @p[gamemode=adventure,distance=..40] run effect give @a[distance=..5] slowness 3 10

# 演出
    particle explosion_emitter ~ ~ ~ 0 0 0 1 2
    playsound entity.generic.explode hostile @a ~ ~ ~

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

# キル
    kill @s


text:
#> asset:mob/0229.burning_blaze.shot/hit
#
#
#
# @within function asset:mob/0229.burning_blaze.shot/tick/2.tick

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

# タグ消し
    tag @a[tag=Hit,distance=..5] remove Hit

# 自殺
    kill @s


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

#> tag
# @within function asset:mob/0229.burning_blaze.shot/**
    #declare tag Hit


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

# 元となるMobを召喚する
    summon area_effect_cloud ~ ~ ~ {Tags:["MobInit"],Particle:"block air",Duration:40}
# ID (int)
    data modify storage asset:mob ID set value 229
# 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":"dark_red"}'

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


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

execute if data storage asset:context {id:229} run function asset:mob/0229.burning_blaze.shot/summon/2.summon


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

# ヒット検知
    execute positioned ^ ^ ^0.5 positioned ~-1 ~-1 ~-1 run tag @a[tag=!PlayerShouldInvulnerable,dx=1,dz=1] add Hit
    execute positioned ^ ^ ^1 positioned ~-1 ~-1 ~-1 run tag @a[tag=!PlayerShouldInvulnerable,dx=1,dz=1] add Hit

# 演出
    particle flame ^ ^ ^0.5 0.1 0.1 0.1 0 3 normal
    particle flame ^ ^ ^1 0.1 0.1 0.1 0 3 normal

# ヒット時実行
    execute if entity @p[tag=Hit,tag=!PlayerShouldInvulnerable,distance=..5] run function asset:mob/0229.burning_blaze.shot/hit

# テレポ
    tp @s ^ ^ ^1

# 前方壁なら自殺
    execute unless block ^ ^ ^1 #lib:air run kill @s


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

execute if data storage asset:context {id:229} run function asset:mob/0229.burning_blaze.shot/tick/2.tick


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

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

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


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

execute if data storage asset:context {id:146} run function asset:mob/0146.prismarine_warrior/summon/2.summon


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

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


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

execute if data storage asset:context {id:146} run function asset:mob/0146.prismarine_warrior/hurt/2.hurt


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

execute if data storage asset:context {id:146} run function asset:mob/0146.prismarine_warrior/attack/2.attack


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

# 演出
    execute at @p[tag=Victim,distance=..6] run particle splash ~ ~1.2 ~ 0.6 0.5 0.6 0 50 normal @a
    execute at @p[tag=Victim,distance=..6] run particle dust_color_transition 0.310 0.820 0.910 1.3 0.290 0.843 0.863 ~ ~1.2 ~ 0.5 0.4 0.5 1 30 normal @a
    execute at @p[tag=Victim,distance=..6] run playsound minecraft:entity.guardian.attack hostile @a ~ ~ ~ 0.8 1.5 0
    execute at @p[tag=Victim,distance=..6] run playsound entity.player.splash.high_speed hostile @a ~ ~ ~ 0.4 1.7 0

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

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


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

#> 定義類はここに
# @within function asset:mob/0245.fire_creeper/**
    scoreboard objectives add 6T.FuseTime dummy


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

# 元となるMobを召喚する
    summon creeper ~ ~ ~ {Tags:["MobInit"],HasVisualFire:1b,Fuse:100s,ExplosionRadius:0b,DeathLootTable:"asset:mob/death/0245.fire_creeper",Passengers:[{id:"minecraft:falling_block",BlockState:{Name:"minecraft:fire"},NoGravity:1b,Time:2147483647,Tags:["AutoKillWhenDieVehicle","AssetMob"]}]}
# ID (int)
    data modify storage asset:mob ID set value 245
# 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
    # 胴 (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 310
# 攻撃力 (double) (オプション)
    # data modify storage asset:mob AttackDamage set value
# 防御力 (double) (オプション) // 被ダメージがある程度大きい場合1ptにつき0.8%カット、小さい場合1ptにつき約4%カット 20pt以上は頭打ち
    # data modify storage asset:mob Defense set value
# 特殊防御力 (double) (オプション) // 4pointにつきダメージを大きく減らす
    # data modify storage asset:mob SpecialDefense set value
# 移動速度 (double) (オプション)
    data modify storage asset:mob Speed set value 0.28
# 索敵範囲 (double) (オプション)
    # data modify storage asset:mob FollowRange set value
# ノックバック耐性 (double) (オプション)
    data modify storage asset:mob KnockBackResist set value 1
# 属性倍率 // 1.0fで100% 最低でも25%は軽減されずに入る
    # 物理倍率 (float) (オプション)
        data modify storage asset:mob Resist.Physical set value 1
    # 魔法倍率 (float) (オプション)
        data modify storage asset:mob Resist.Magic set value 1
    # 火倍率 (float) (オプション)
        data modify storage asset:mob Resist.Fire set value 0
    # 水倍率 (float) (オプション)
        data modify storage asset:mob Resist.Water set value 1
    # 雷倍率 (float) (オプション)
        data modify storage asset:mob Resist.Thunder set value 1

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


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

execute if data storage asset:context {id:245} run function asset:mob/0245.fire_creeper/summon/2.summon


text:
#> asset:mob/0245.fire_creeper/tick/2.tick
#
# Mobのtick時の処理
#
# @within function asset:mob/0245.fire_creeper/tick/1.trigger
#> tag
# @private
    #declare tag ScoreAdd

# プレイヤーが周囲にいたら発動
    execute if entity @p[distance=..3] run tag @s add ScoreAdd
# プレイヤーが一度近づいてスコアを持っている状態だとして、視界内にプレイヤーがいたらそのままカウントをすすめる
    execute if score @s 6T.FuseTime matches 1.. positioned ^ ^ ^6 if entity @p[distance=..6] run tag @s add ScoreAdd

# プレイヤーを検知できたらスコアを上げる
    execute if entity @s[tag=ScoreAdd] run scoreboard players add @s 6T.FuseTime 1

# プレイヤーが周囲にいないとリセット
    execute unless entity @s[tag=ScoreAdd] run scoreboard players reset @s 6T.FuseTime

# タグを消す
    tag @s remove ScoreAdd

# 一定時間で爆破
    execute if score @s 6T.FuseTime matches 30.. run function asset:mob/0245.fire_creeper/tick/3.explosion


text:
#> asset:mob/0245.fire_creeper/tick/3.explosion
#
#
#
# @within function asset:mob/0245.fire_creeper/tick/2.tick

# 火を撒く(サバイバルのみで発動。アドベンチャーで出さないこと前提)
    execute if predicate world_manager:area/02.islands run function asset:mob/0245.fire_creeper/tick/4.fire_summon

# 演出
    particle explosion_emitter ~ ~ ~ 0 0 0 1 2
    playsound entity.generic.explode hostile @a ~ ~ ~

# 自殺
    tp ~ -500 ~
    kill @s


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

execute if data storage asset:context {id:245} run function asset:mob/0245.fire_creeper/tick/2.tick


text:
#> asset:mob/0245.fire_creeper/tick/4.fire_summon
#
#
#
# @within function asset:mob/0245.fire_creeper/tick/3.explosion

# 火本体を召喚
    execute if predicate lib:random_pass_per/30 run summon falling_block ~ ~ ~ {BlockState:{Name:"minecraft:fire"},Time:1,Motion:[0.11,0.23,0.15]}
    execute if predicate lib:random_pass_per/30 run summon falling_block ~ ~ ~ {BlockState:{Name:"minecraft:fire"},Time:1,Motion:[0.02,0.16,0.08]}
    execute if predicate lib:random_pass_per/30 run summon falling_block ~ ~ ~ {BlockState:{Name:"minecraft:fire"},Time:1,Motion:[0.5,0.33,-0.54]}
    execute if predicate lib:random_pass_per/30 run summon falling_block ~ ~ ~ {BlockState:{Name:"minecraft:fire"},Time:1,Motion:[-0.3,0.21,-0.46]}
    execute if predicate lib:random_pass_per/30 run summon falling_block ~ ~ ~ {BlockState:{Name:"minecraft:fire"},Time:1,Motion:[0.07,0.32,0.54]}
    execute if predicate lib:random_pass_per/30 run summon falling_block ~ ~ ~ {BlockState:{Name:"minecraft:fire"},Time:1,Motion:[-0.2,0.56,0.11]}
    execute if predicate lib:random_pass_per/30 run summon falling_block ~ ~ ~ {BlockState:{Name:"minecraft:fire"},Time:1,Motion:[0.43,0.22,0.2]}
    execute if predicate lib:random_pass_per/30 run summon falling_block ~ ~ ~ {BlockState:{Name:"minecraft:fire"},Time:1,Motion:[-0.25,0.54,0.48]}
    execute if predicate lib:random_pass_per/30 run summon falling_block ~ ~ ~ {BlockState:{Name:"minecraft:fire"},Time:1,Motion:[0.03,0.44,0.11]}
    execute if predicate lib:random_pass_per/30 run summon falling_block ~ ~ ~ {BlockState:{Name:"minecraft:fire"},Time:1,Motion:[-0.46,0.2,0.11]}
    execute if predicate lib:random_pass_per/30 run summon falling_block ~ ~ ~ {BlockState:{Name:"minecraft:fire"},Time:1,Motion:[-0.36,0.05,0.51]}
    execute if predicate lib:random_pass_per/30 run summon falling_block ~ ~ ~ {BlockState:{Name:"minecraft:fire"},Time:1,Motion:[0.18,0.1,0.24]}
    execute if predicate lib:random_pass_per/30 run summon falling_block ~ ~ ~ {BlockState:{Name:"minecraft:fire"},Time:1,Motion:[-0.26,0.12,0.04]}
    execute if predicate lib:random_pass_per/30 run summon falling_block ~ ~ ~ {BlockState:{Name:"minecraft:fire"},Time:1,Motion:[-0.15,0.42,0.2]}
    execute if predicate lib:random_pass_per/30 run summon falling_block ~ ~ ~ {BlockState:{Name:"minecraft:fire"},Time:1,Motion:[0.06,0.47,0.33]}
    execute if predicate lib:random_pass_per/30 run summon falling_block ~ ~ ~ {BlockState:{Name:"minecraft:fire"},Time:1,Motion:[-0.48,0.55,-0.2]}
    execute if predicate lib:random_pass_per/30 run summon falling_block ~ ~ ~ {BlockState:{Name:"minecraft:fire"},Time:1,Motion:[-0.04,0.17,0.07]}
    execute if predicate lib:random_pass_per/30 run summon falling_block ~ ~ ~ {BlockState:{Name:"minecraft:fire"},Time:1,Motion:[0.17,0.42,0.51]}
    execute if predicate lib:random_pass_per/30 run summon falling_block ~ ~ ~ {BlockState:{Name:"minecraft:fire"},Time:1,Motion:[-0.47,0.41,-0.11]}
    execute if predicate lib:random_pass_per/30 run summon falling_block ~ ~ ~ {BlockState:{Name:"minecraft:fire"},Time:1,Motion:[0.27,0.2,-0.11]}
    execute if predicate lib:random_pass_per/30 run summon falling_block ~ ~ ~ {BlockState:{Name:"minecraft:fire"},Time:1,Motion:[-0.43,0.15,-0.22]}
    execute if predicate lib:random_pass_per/30 run summon falling_block ~ ~ ~ {BlockState:{Name:"minecraft:fire"},Time:1,Motion:[-0.42,0.44,0.11]}
    execute if predicate lib:random_pass_per/30 run summon falling_block ~ ~ ~ {BlockState:{Name:"minecraft:fire"},Time:1,Motion:[-0.21,0.48,-0.55]}
    execute if predicate lib:random_pass_per/30 run summon falling_block ~ ~ ~ {BlockState:{Name:"minecraft:fire"},Time:1,Motion:[-0.25,0.42,0.1]}
    execute if predicate lib:random_pass_per/30 run summon falling_block ~ ~ ~ {BlockState:{Name:"minecraft:fire"},Time:1,Motion:[0.54,0.41,0.55]}
    execute if predicate lib:random_pass_per/30 run summon falling_block ~ ~ ~ {BlockState:{Name:"minecraft:fire"},Time:1,Motion:[0.2,0.6,-0.11]}
    execute if predicate lib:random_pass_per/30 run summon falling_block ~ ~ ~ {BlockState:{Name:"minecraft:fire"},Time:1,Motion:[-0.28,0.08,-0.11]}
    execute if predicate lib:random_pass_per/30 run summon falling_block ~ ~ ~ {BlockState:{Name:"minecraft:fire"},Time:1,Motion:[0.14,0.43,-0.32]}
    execute if predicate lib:random_pass_per/30 run summon falling_block ~ ~ ~ {BlockState:{Name:"minecraft:fire"},Time:1,Motion:[0.43,0.19,-0.1]}
    execute if predicate lib:random_pass_per/30 run summon falling_block ~ ~ ~ {BlockState:{Name:"minecraft:fire"},Time:1,Motion:[0.09,0.51,0.46]}
    execute if predicate lib:random_pass_per/30 run summon falling_block ~ ~ ~ {BlockState:{Name:"minecraft:fire"},Time:1,Motion:[-0.55,0.5,-0.17]}
    execute if predicate lib:random_pass_per/30 run summon falling_block ~ ~ ~ {BlockState:{Name:"minecraft:fire"},Time:1,Motion:[0.39,0.19,-0.19]}
    execute if predicate lib:random_pass_per/30 run summon falling_block ~ ~ ~ {BlockState:{Name:"minecraft:fire"},Time:1,Motion:[-0.2,0.04,0.29]}
    execute if predicate lib:random_pass_per/30 run summon falling_block ~ ~ ~ {BlockState:{Name:"minecraft:fire"},Time:1,Motion:[0.05,0.26,-0.57]}
    execute if predicate lib:random_pass_per/30 run summon falling_block ~ ~ ~ {BlockState:{Name:"minecraft:fire"},Time:1,Motion:[0.3,0.09,-0.31]}
    execute if predicate lib:random_pass_per/30 run summon falling_block ~ ~ ~ {BlockState:{Name:"minecraft:fire"},Time:1,Motion:[0.35,0.07,-0.15]}
    execute if predicate lib:random_pass_per/30 run summon falling_block ~ ~ ~ {BlockState:{Name:"minecraft:fire"},Time:1,Motion:[0.1,0.6,0.43]}
    execute if predicate lib:random_pass_per/30 run summon falling_block ~ ~ ~ {BlockState:{Name:"minecraft:fire"},Time:1,Motion:[-0.27,0.01,-0.14]}
    execute if predicate lib:random_pass_per/30 run summon falling_block ~ ~ ~ {BlockState:{Name:"minecraft:fire"},Time:1,Motion:[0.09,0.58,0.34]}


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

#> 定義類はここに
# @within function asset:mob/0234.walleye/**
    scoreboard objectives add 6i.Phase dummy
    scoreboard objectives add 6i.LockOnTime dummy


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

# 元となるMobを召喚する
    summon zombie ~ ~ ~ {Tags:["MobInit","AntiBurn","AlwaysInvisible"],DeathLootTable:"asset:mob/death/0234.walleye",Silent:1b,NoAI:1b}
# ID (int)
    data modify storage asset:mob ID set value 234
# 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:20176}}
    # 胴 (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 500
# 攻撃力 (double) (オプション)
    # data modify storage asset:mob AttackDamage set value
# 防御力 (double) (オプション) // 被ダメージがある程度大きい場合1ptにつき0.8%カット、小さい場合1ptにつき約4%カット 20pt以上は頭打ち
    # data modify storage asset:mob Defense set value
# 特殊防御力 (double) (オプション) // 4pointにつきダメージを大きく減らす
    # data modify storage asset:mob SpecialDefense set value
# 移動速度 (double) (オプション)
    data modify storage asset:mob Speed set value 0
# 索敵範囲 (double) (オプション)
    data modify storage asset:mob FollowRange set value 16
# ノックバック耐性 (double) (オプション)
    data modify storage asset:mob KnockBackResist set value 1.0
# 属性倍率 // 1.0fで100% 最低でも25%は軽減されずに入る
    # 物理倍率 (float) (オプション)
        data modify storage asset:mob Resist.Physical set value 1.0
    # 魔法倍率 (float) (オプション)
        data modify storage asset:mob Resist.Magic set value 1.0
    # 火倍率 (float) (オプション)
        data modify storage asset:mob Resist.Fire set value 1.0
    # 水倍率 (float) (オプション)
        data modify storage asset:mob Resist.Water set value 1.0
    # 雷倍率 (float) (オプション)
        data modify storage asset:mob Resist.Thunder set value 1.0

# Phaseの初期状態セット
    scoreboard players set @e[type=zombie,tag=MobInit,distance=..0.01] 6i.Phase 0

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


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

execute if data storage asset:context {id:234} run function asset:mob/0234.walleye/summon/2.summon


text:
#> asset:mob/0234.walleye/tick/2.1.search
#
# @within
#   function asset:mob/0234.walleye/tick/2.tick

#> prv
# @private
    #declare score_holder $6i.GameTime
    #declare score_holder $6i.LockTime
    #declare score_holder $6i.SoundTime
    #declare tag 6i.TargetCandidate

# LockTime定義
    execute store result score $6i.GameTime Temporary run time query gametime
    execute store result score $6i.LockTime Temporary run time query gametime
    scoreboard players add $6i.LockTime Temporary 60

# 攻撃範囲内にプレイヤーか友好mobがいる場合ロックオン終了予定時間をセットして向きを変える
    execute positioned ~-10 ~-20 ~-10 if entity @e[tag=Friend,dx=20,dy=20,dz=20] unless score @s 6i.LockOnTime matches -2147483648..2147483647 run tag @e[tag=Friend,dx=20,dy=20,dz=20] add 6i.TargetCandidate
    execute positioned ~-10 ~-20 ~-10 if entity @e[tag=6i.TargetCandidate,dx=20,dy=20,dz=20] at @s positioned ~ ~1.5 ~ run tp @s ~ ~-1.5 ~ facing entity @e[tag=6i.TargetCandidate,distance=..25,sort=nearest,limit=1]
    execute positioned ~-10 ~-20 ~-10 if entity @e[tag=6i.TargetCandidate,dx=20,dy=20,dz=20] run scoreboard players operation @s 6i.LockOnTime = $6i.LockTime Temporary

# 攻撃範囲内にプレイヤーか友好mobがいない場合ロックオン終了予定時間をリセット
    execute positioned ~-10 ~-20 ~-10 unless entity @e[tag=Friend,dx=20,dy=20,dz=20] run scoreboard players reset @s 6i.LockOnTime

# 音
    execute if score @s 6i.LockOnTime matches -2147483648..2147483647 run scoreboard players operation $6i.SoundTime Temporary = @s 6i.LockOnTime
    execute if score @s 6i.LockOnTime matches -2147483648..2147483647 run scoreboard players operation $6i.SoundTime Temporary -= $6i.GameTime Temporary
    execute if score @s 6i.LockOnTime matches -2147483648..2147483647 run scoreboard players operation $6i.SoundTime Temporary %= $10 Const
    execute if score @s 6i.LockOnTime matches -2147483648..2147483647 if score $6i.SoundTime Temporary matches 9 run playsound minecraft:block.note_block.bit hostile @a[distance=..32] ~ ~ ~ 3 1.334840 1

# ロックオン終了予定時間に達した場合Phaseを1にして移動状態へ移行する
    execute if score $6i.GameTime Temporary >= @s 6i.LockOnTime run scoreboard players set @s 6i.Phase 1
    execute if score $6i.GameTime Temporary >= @s 6i.LockOnTime run function asset:mob/0234.walleye/tick/jet_start

# reset
    tag @e[tag=Friend,tag=6i.TargetCandidate,distance=..25] remove 6i.TargetCandidate
    scoreboard players reset $6i.GameTime Temporary
    scoreboard players reset $6i.LockTime Temporary
    scoreboard players reset $6i.SoundTime Temporary


text:
#> asset:mob/0234.walleye/tick/2.tick
#
# Mobのtick時の処理
# phase=0: 索敵
# phase=1: 移動
# phase=2: 起爆
#
# @within function asset:mob/0234.walleye/tick/1.trigger

# 探知フェーズの場合の処理
    execute if score @s 6i.Phase matches 0 at @s run function asset:mob/0234.walleye/tick/2.1.search

# 移動フェーズの場合の処理
    execute if score @s 6i.Phase matches 1 run function asset:mob/0234.walleye/tick/2.2.move

# 爆発フェーズの場合の処理
    execute if score @s 6i.Phase matches 2 run function asset:mob/0234.walleye/tick/2.3.explode


text:
#> asset:mob/0234.walleye/tick/2.3.explode
#
# @within
#   function asset:mob/0234.walleye/tick/2.tick

# 音とパーティクル
    playsound entity.generic.explode hostile @a[distance=..32] ~ ~ ~ 2 1 1
    particle large_smoke ~ ~ ~ 2 2 2 0 300 normal
    particle flame ~ ~ ~ 2 2 2 0 200 normal
    particle lava ~ ~ ~ 2 2 2 0 100 normal

# ダメージ: 半径1ブロック以内は60ダメージ、1ブロック離れるごとに10減少
# 攻撃データ設定
    data modify storage lib: Argument.AttackType set value "Physical"
    data modify storage lib: Argument.ElementType set value "Fire"
    data modify storage lib: Argument.DeathMessage set value ['[{"translate": "%1$sはウォールアイの爆発に巻き込まれた。","with":[{"selector":"@s"}]}]']
# ダメージ
    data modify storage lib: Argument.Damage set value 10.0f
    function lib:damage/modifier
    execute as @p[gamemode=!creative,distance=..1] at @s run function lib:damage/
    execute as @e[type=!player,tag=!this,distance=..1] at @s run function lib:damage/

    data modify storage lib: Argument.Damage set value 10.0f
    function lib:damage/modifier_continuation
    execute as @p[gamemode=!creative,distance=..2] at @s run function lib:damage/
    execute as @e[type=!player,tag=!this,distance=..2] at @s run function lib:damage/

    data modify storage lib: Argument.Damage set value 10.0f
    function lib:damage/modifier_continuation
    execute as @p[gamemode=!creative,distance=..3] at @s run function lib:damage/
    execute as @e[type=!player,tag=!this,distance=..3] at @s run function lib:damage/

    data modify storage lib: Argument.Damage set value 10.0f
    function lib:damage/modifier_continuation
    execute as @p[gamemode=!creative,distance=..4] at @s run function lib:damage/
    execute as @e[type=!player,tag=!this,distance=..4] at @s run function lib:damage/

    data modify storage lib: Argument.Damage set value 10.0f
    function lib:damage/modifier_continuation
    execute as @p[gamemode=!creative,distance=..5] at @s run function lib:damage/
    execute as @e[type=!player,tag=!this,distance=..5] at @s run function lib:damage/

    data modify storage lib: Argument.Damage set value 10.0f
    function lib:damage/modifier_continuation
    execute as @p[gamemode=!creative,distance=..6] at @s run function lib:damage/
    execute as @e[type=!player,tag=!this,distance=..6] at @s run function lib:damage/

# 引数リセット
    function lib:damage/reset

# 自死
    kill @s


text:
#> asset:mob/0234.walleye/tick/2.2.move
#
# @within
#   function asset:mob/0234.walleye/tick/2.tick

# 向いてる方向に向かって移動、ブロックにめり込むorエンティティが半径1ブロック以内に入るor奈落に行くで爆発
    execute at @s run tp @s ^ ^ ^0.5
    execute at @s run tp @s ^ ^ ^0.5
    execute at @s run tp @s ^ ^ ^0.5
    execute at @s positioned ~ ~1.5 ~ positioned ^ ^ ^-1 run particle poof ~ ~ ~ 0 0 0 0.005 1
    execute at @s unless block ~ ~ ~ #lib:no_collision run scoreboard players set @s 6i.Phase 2
    execute at @s if entity @e[tag=Friend,distance=..1] run scoreboard players set @s 6i.Phase 2
    execute positioned ~ -64 ~ if entity @s[dy=-128] run scoreboard players set @s 6i.Phase 2


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

execute if data storage asset:context {id:234} run function asset:mob/0234.walleye/tick/2.tick


text:
#> asset:mob/0234.walleye/tick/jet_start
#
# ドゴオオ！
#
# @within function asset:mob/0234.walleye/tick/2.1.search

# サウンド
    playsound minecraft:block.note_block.bell hostile @a[distance=..32] ~ ~ ~ 3 1.334840 1
    playsound minecraft:block.fire.extinguish hostile @a ~ ~ ~ 1 1
    playsound minecraft:entity.blaze.shoot hostile @a ~ ~ ~ 1 1.5

# パーティクル
    execute positioned ~ ~1.5 ~ positioned ^ ^ ^-1 run particle lava ~ ~ ~ 0 0 0 0 10
    execute positioned ~ ~1.5 ~ positioned ^ ^ ^-1 run particle explosion ~ ~ ~ 0 0 0 0 10


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

#> 定義類はここに
# @within function asset:mob/0065.night_shadow/**
    scoreboard objectives add 1T.Sunrise dummy


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

# 元となるMobを召喚する
    summon phantom ~ ~ ~ {Silent:1b,Tags:["MobInit","AlwaysInvisible","AntiBurn"],DeathLootTable:"asset:mob/death/0065.night_shadow"}
# ID (int)
    data modify storage asset:mob ID set value 65
# 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_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 310
# 攻撃力 (double) (オプション)
    data modify storage asset:mob AttackDamage set value 7.0
# 防御力 (double) (オプション) // 被ダメージがある程度大きい場合1ptにつき0.8%カット、小さい場合1ptにつき約4%カット 20pt以上は頭打ち
    data modify storage asset:mob Defense set value 0
# 特殊防御力 (double) (オプション) // 4pointにつきダメージを大きく減らす
    # data modify storage asset:mob SpecialDefense set value
# 移動速度 (double) (オプション)
    data modify storage asset:mob Speed set value 0.30
# 索敵範囲 (double) (オプション)
    data modify storage asset:mob FollowRange set value 30.0
# ノックバック耐性 (double) (オプション)
    data modify storage asset:mob KnockBackResist set value 0.0
# 属性倍率 // 1.0fで100% 最低でも25%は軽減されずに入る
    # 物理倍率 (float) (オプション)
        data modify storage asset:mob Resist.Physical set value 1.0
    # 魔法倍率 (float) (オプション)
        data modify storage asset:mob Resist.Magic set value 0.4
    # 火倍率 (float) (オプション)
        data modify storage asset:mob Resist.Fire set value 1.0
    # 水倍率 (float) (オプション)
        data modify storage asset:mob Resist.Water set value 0.85
    # 雷倍率 (float) (オプション)
        data modify storage asset:mob Resist.Thunder set value 0.9

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


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

execute if data storage asset:context {id:65} run function asset:mob/0065.night_shadow/summon/2.summon


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

execute if data storage asset:context {id:65} run function asset:mob/0065.night_shadow/attack/2.attack


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

# 盲目を付与
    effect give @p[tag=Victim,distance=..6] blindness 4 0 true


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

# 煙を纏う
    particle smoke ~ ~ ~ 0.4 0.4 0.4 0 3 normal @a


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

execute if data storage asset:context {id:65} run function asset:mob/0065.night_shadow/tick/2.tick


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

#> 定義類はここに
# @within function asset:mob/0081.snow_cloud/**
    scoreboard objectives add 29.SnowTick dummy


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

# 元となるMobを召喚する
    summon polar_bear ~ ~ ~ {Silent:1b,NoAI:1b,NoGravity:1b,Tags:["MobInit","AlwaysInvisible","AntiBurn"],DeathLootTable:"asset:mob/death/0081.snow_cloud"}
# ID (int)
    data modify storage asset:mob ID set value 81
# 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":"#B0FFE5"}'
# 武器
    # メインハンド (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 320
# 攻撃力 (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.0
# 属性倍率 // 1.0fで100% 最低でも25%は軽減されずに入る
    # 物理倍率 (float) (オプション)
        data modify storage asset:mob Resist.Physical set value 0.5
    # 魔法倍率 (float) (オプション)
        data modify storage asset:mob Resist.Magic set value 0.8
    # 火倍率 (float) (オプション)
        data modify storage asset:mob Resist.Fire set value 1.0
    # 水倍率 (float) (オプション)
        data modify storage asset:mob Resist.Water set value 0.5
    # 雷倍率 (float) (オプション)
        data modify storage asset:mob Resist.Thunder set value 0.85

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


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

execute if data storage asset:context {id:81} run function asset:mob/0081.snow_cloud/summon/2.summon


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

# プレイヤーが下にいる場合動くコマンド(スコア蓄積、雪が降るパーティクル)
    execute positioned ~-0.75 ~-6 ~-0.75 if entity @a[gamemode=!spectator,dx=1.5,dy=6,dz=1.5] run function asset:mob/0081.snow_cloud/tick/3.near_player

# パーティクル
    particle snowflake ~ ~ ~ 0.6 0.3 0.6 0 2 normal @a
    particle dust 1 1000000000 1000000000 2 ~ ~ ~ 0.6 0.3 0.6 0 2 normal @a

# 最も近いプレイヤーの上に移動
    execute facing entity @p[gamemode=!spectator] feet rotated ~ 0 if block ^ ^ ^0.2 #lib:no_collision run tp @s ^ ^ ^0.1
    execute if entity @a[gamemode=!spectator,distance=..4] if block ~ ~1 ~ #lib:no_collision run tp @s ~ ~1 ~

# プレイヤーの上に移動しすぎたら降下(下30ブロック以内にプレイヤーがいて、下6ブロック以内にプレイヤーがいない場合降下)
    execute positioned ~-1 ~-30 ~-1 if entity @a[gamemode=!spectator,dx=2,dy=30,dz=2] at @s positioned ~-1 ~-6 ~-1 unless entity @a[gamemode=!spectator,dx=2,dy=6,dz=2] at @s if block ~ ~-1 ~ #lib:no_collision run tp @s ~ ~-1 ~
# 近くのプレイヤーに水魔法ダメージ
    execute if entity @a[tag=!PlayerShouldInvulnerable,distance=..3] run function asset:mob/0081.snow_cloud/tick/4.near_damage

# 一定周期の特殊能力(分岐functionに記載)
    execute if score @s 29.SnowTick matches 60.. run function asset:mob/0081.snow_cloud/tick/5.snowing

# 近くにプレイヤーがいない場合は奈落行き
    execute unless entity @a[gamemode=!spectator,distance=..30] run tp @s ~ -999 ~


text:
#> asset:mob/0081.snow_cloud/tick/7.snow_damage
#
#
#
# @within function asset:mob/0081.snow_cloud/tick/6.recursion

# 粉雪が積もる
    execute if entity @s[gamemode=survival] run fill ~ ~ ~ ~ ~ ~ powder_snow replace #lib:air

# 音
    playsound minecraft:block.glass.break hostile @a ~ ~ ~ 0.3 1.5 0

# 重めのデバフ
    effect give @s slowness 4 2 true
    effect give @s mining_fatigue 4 2 true

# ダメージ
    data modify storage lib: Argument.Damage set value 17f
    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}]}]'
# 補正
    execute as @e[type=polar_bear,tag=this,scores={MobID=81},distance=..8,limit=1] run function lib:damage/modifier
# 実行
    function lib:damage/
# リセット
    function lib:damage/reset


text:
#> asset:mob/0081.snow_cloud/tick/5.snowing
#
#
#
# @within function asset:mob/0081.snow_cloud/tick/2.tick

# 再帰処理
    execute positioned ~-0.75 ~-6 ~-0.75 as @a[gamemode=!spectator,dx=1.5,dy=6,dz=1.5] at @s run function asset:mob/0081.snow_cloud/tick/6.recursion

# スコアリセット
    scoreboard players reset @s 29.SnowTick


text:
#> asset:mob/0081.snow_cloud/tick/3.near_player
#
#
#
# @within function asset:mob/0081.snow_cloud/tick/2.tick

# スコア蓄積
    scoreboard players add @s 29.SnowTick 1

# 雪が降る演出
    execute at @s run particle snowflake ~ ~2 ~ 0.75 2.5 0.75 0 3 normal @a


text:
#> asset:mob/0081.snow_cloud/tick/4.near_damage
#
#
#
# @within function asset:mob/0081.snow_cloud/tick/2.tick

# ダメージ
    data modify storage lib: Argument.Damage set value 5.0f
    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 @a[tag=!PlayerShouldInvulnerable,distance=..3] run function lib:damage/
# リセット
    function lib:damage/reset


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

    execute if data storage asset:context {id:81} run function asset:mob/0081.snow_cloud/tick/2.tick


text:
#> asset:mob/0081.snow_cloud/tick/6.recursion
#
#
#
# @within function
#   asset:mob/0081.snow_cloud/tick/5.snowing
#   asset:mob/0081.snow_cloud/tick/6.recursion

# 再帰終了条件を満たしたときの効果
    execute if entity @e[type=polar_bear,scores={MobID=81},distance=..1] at @s run function asset:mob/0081.snow_cloud/tick/7.snow_damage

# 再帰ループ
    execute unless entity @e[type=polar_bear,scores={MobID=81},distance=..1] if block ~ ~1 ~ #lib:no_collision_without_fluid positioned ~ ~1 ~ run function asset:mob/0081.snow_cloud/tick/6.recursion


text:
#> asset:mob/0224.pumpkin_ghost/_index.d
# @private

#> tag
# @within function asset:mob/0224.pumpkin_ghost/**
    #declare tag 68.Init


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

# 元となるMobを召喚する
    summon husk ~ ~ ~ {Tags:["MobInit","AlwaysInvisible"],Silent:1b,DeathLootTable:"asset:mob/death/0224.pumpkin_ghost"}
# ID (int)
    data modify storage asset:mob ID set value 224
# 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":"#FFAA00"}'
# 武器
    # メインハンド (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:carved_pumpkin"}
    # 胴 (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 9999
# 攻撃力 (double) (オプション)
    data modify storage asset:mob AttackDamage set value 0
# 防御力 (double) (オプション) // 被ダメージがある程度大きい場合1ptにつき0.8%カット、小さい場合1ptにつき約4%カット 20pt以上は頭打ち
    data modify storage asset:mob Defense set value 0
# 特殊防御力 (double) (オプション) // 4pointにつきダメージを大きく減らす
    # data modify storage asset:mob SpecialDefense set value
# 移動速度 (double) (オプション)
    data modify storage asset:mob Speed set value 0
# 索敵範囲 (double) (オプション)
    data modify storage asset:mob FollowRange set value 16
# ノックバック耐性 (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 0.5
    # 火倍率 (float) (オプション)
        data modify storage asset:mob Resist.Fire set value 0.5
    # 水倍率 (float) (オプション)
        # data modify storage asset:mob Resist.Water set value
    # 雷倍率 (float) (オプション)
        data modify storage asset:mob Resist.Thunder set value 0.9

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


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

execute if data storage asset:context {id:224} run function asset:mob/0224.pumpkin_ghost/summon/2.summon


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

# 割合ダメージ
    execute store result storage lib: Argument.Damage float 0.020 run attribute @p[tag=Attacker,distance=..50] generic.max_health get 10
# 属性
    data modify storage lib: Argument.AttackType set value "Physical"
    data modify storage lib: Argument.FixedDamage set value 1b
# 死亡メッセージ
    data modify storage lib: Argument.DeathMessage set value ['[{"translate": "%1$sは呪われてしまった！","with":[{"selector":"@s"}]}]']
# 補正
    function lib:damage/modifier
# ダメージ
    execute as @p[tag=Attacker,distance=..50] run function lib:damage/
# リセット
    function lib:damage/reset

# 演出
    particle block_marker barrier ~ ~1 ~ 0 0 0 0 0
    playsound minecraft:entity.witch.celebrate hostile @a ~ ~ ~ 1 2

# 撤退
    tp ~ -1000 ~
    kill @s


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

execute if data storage asset:context {id:224} run function asset:mob/0224.pumpkin_ghost/hurt/2.hurt


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

# 頭をつける
    execute if entity @s[tag=!68.Init] run function asset:mob/0224.pumpkin_ghost/tick/3.head_random

# 演出
    particle dust 1 0.6 0 1 ~ ~0.5 ~ 0.2 0.2 0.2 0 1 normal @a
    particle dust 0.851 0 1 1 ~ ~0.5 ~ 0.2 0.2 0.2 0 1 normal @a


text:
#> asset:mob/0224.pumpkin_ghost/tick/3.head_random
#
#
#
# @within function asset:mob/0224.pumpkin_ghost/tick/2.tick

#> private
# @private
    #declare score_holder $Random

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

# スキル選択
    execute if score $Random Temporary matches 0 run item replace entity @s armor.head with carved_pumpkin{CustomModelData:20201}
    execute if score $Random Temporary matches 1 run item replace entity @s armor.head with carved_pumpkin{CustomModelData:20202}
    execute if score $Random Temporary matches 2 run item replace entity @s armor.head with carved_pumpkin{CustomModelData:20203}
    execute if score $Random Temporary matches 3 run item replace entity @s armor.head with carved_pumpkin{CustomModelData:20204}
    execute if score $Random Temporary matches 4 run item replace entity @s armor.head with carved_pumpkin{CustomModelData:20205}
    execute if score $Random Temporary matches 5 run item replace entity @s armor.head with carved_pumpkin{CustomModelData:20206}
# リセット
    scoreboard players reset $Random Temporary

# 最寄りのプレイヤーを見る
    tp @s ~ ~ ~ facing entity @p

# タグつける
    tag @s add 68.Init


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

execute if data storage asset:context {id:224} run function asset:mob/0224.pumpkin_ghost/tick/2.tick


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

#> 定義類はここに
# @within function asset:mob/0104.mad_scientist/**
    scoreboard objectives add 2W.Tick dummy


text:
#> asset:mob/0104.mad_scientist/_index.d
# @private

#> マッドサイエンティスト単体の定義
# @within function
#   asset:mob/0104.mad_scientist/hurt/**
#   asset:mob/0104.mad_scientist/tick/**
    #declare tag 2W.HPless50Per
    #declare score_holder $Random

#> ポーション側と共通の定義
# @within function
#   asset:mob/0104.mad_scientist/tick/**
#   asset:mob/0105.potion_projectile/summon/2.summon
#   asset:mob/0105.potion_projectile/tick/element_branch
    #declare tag 2W.Poison
    #declare tag 2W.Fire
    #declare tag 2W.Water
    #declare tag 2W.Thunder


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

# 演出
    particle explosion ~ ~1.2 ~ 0.6 0.4 0.6 0 10 normal @a
    particle lava ~ ~1.2 ~ 1 0.4 1 0 5 normal @a
    playsound entity.generic.explode hostile @a ~ ~ ~ 0.7 1 0
    particle dust 0 0.4 0 2 ~ ~1.2 ~ 1 0.4 1 0 5 normal @a
    particle dust 0.6 0 1 1 ~ ~1.2 ~ 1 0.4 1 0 5 normal @a
    playsound block.fire.extinguish hostile @a ~ ~ ~ 0.4 2 0
    particle snowflake ~ ~1.2 ~ 1 0.4 1 0 10 normal @a
    particle falling_dust diamond_block ~ ~1.2 ~ 1 0.4 1 0 20 normal @a
    playsound block.glass.break hostile @a ~ ~ ~ 1 2 0
    particle dust 1 1 0 1.5 ~ ~1.2 ~ 1 0.4 1 0 10 normal @a
    particle firework ~ ~1.2 ~ 1 0.4 1 0.1 10 normal @a
    playsound entity.firework_rocket.twinkle hostile @a ~ ~ ~ 0.8 2 0
    playsound entity.firework_rocket.twinkle hostile @a ~ ~ ~ 0.8 1.5 0


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

execute if data storage asset:context {id:104} run function asset:mob/0104.mad_scientist/death/2.death


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

# 元となるMobを召喚する
    summon skeleton ~ ~ ~ {Silent:1b,Tags:["MobInit","AntiVoid"],DeathLootTable:"asset:mob/death/0104.mad_scientist"}
# ID (int)
    data modify storage asset:mob ID set value 104
# 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":"white"}'
# 武器
    # メインハンド (Compound(Item)) (オプション)
        data modify storage asset:mob Weapon.Mainhand set value {id:"splash_potion",Count:1b}
    # オフハンド (Compound(Item)) (オプション)
        # data modify storage asset:mob Weapon.Offhand set value
# 武器ドロップ率 ([float, float]) (オプション)
    # data modify storage asset:mob WeaponDropChances set value
# 防具
    # 頭 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Head set value {id:"leather_helmet",Count:1b,tag:{Unbreakable:1b,display:{color:16777215}}}
    # 胴 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Chest set value {id:"leather_chestplate",Count:1b,tag:{display:{color:16777215}}}
    # 脚 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Legs set value {id:"leather_leggings",Count:1b,tag:{display:{color:16777215}}}
    # 足 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Feet set value {id:"leather_boots",Count:1b,tag:{display:{color:16777215}}}
# 防具ドロップ率 ([float, float]) (オプション)
    # data modify storage asset:mob ArmorDropChances set value
# 体力 (double) (オプション)
    data modify storage asset:mob Health set value 25000
# 攻撃力 (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 -7
# 特殊防御力 (double) (オプション) // 4pointにつきダメージを大きく減らす
    # data modify storage asset:mob SpecialDefense set value
# 移動速度 (double) (オプション)
    data modify storage asset:mob Speed set value 0.25
# 索敵範囲 (double) (オプション)
    data modify storage asset:mob FollowRange set value 32
# ノックバック耐性 (double) (オプション)
    data modify storage asset:mob KnockBackResist set value 0.5
# 属性倍率 // 1.0fで100% 最低でも25%は軽減されずに入る
    # 物理倍率 (float) (オプション)
        data modify storage asset:mob Resist.Physical set value 1.0
    # 魔法倍率 (float) (オプション)
        data modify storage asset:mob Resist.Magic set value 0.5
    # 火倍率 (float) (オプション)
        data modify storage asset:mob Resist.Fire set value 1.0
    # 水倍率 (float) (オプション)
        data modify storage asset:mob Resist.Water set value 1.0
    # 雷倍率 (float) (オプション)
        data modify storage asset:mob Resist.Thunder set value 1.0

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


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

execute if data storage asset:context {id:104} run function asset:mob/0104.mad_scientist/summon/2.summon


text:
#> asset:mob/0104.mad_scientist/hurt/4.health_check
#
# 体力をチェックする
#
# @within function asset:mob/0104.mad_scientist/hurt/2.hurt

#> Private
# @private
    #declare score_holder $Health
    #declare score_holder $MaxHealth

# 体力チェック
    execute store result score $Health Temporary run data get entity @s AbsorptionAmount 100
    execute store result score $MaxHealth Temporary run function api:mob/get_max_health
    scoreboard players operation $Health Temporary /= $MaxHealth Temporary
    execute if score $Health Temporary matches ..50 run tag @s add 2W.HPless50Per
    scoreboard players reset $Health Temporary
    scoreboard players reset $MaxHealth Temporary


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

# 遠距離で殴られた場合、殺意をむき出しにした最悪なteleport
    execute if entity @p[tag=Attacker,distance=15..] if predicate lib:random_pass_per/45 run function asset:mob/0104.mad_scientist/hurt/3.teleport

# 体力をチェックして50%以下ならTagを付与
    execute if entity @s[tag=!2W.HPless50Per] run function asset:mob/0104.mad_scientist/hurt/4.health_check


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

execute if data storage asset:context {id:104} run function asset:mob/0104.mad_scientist/hurt/2.hurt


text:
#> asset:mob/0104.mad_scientist/hurt/3.teleport
#
# 殺意全開ぶっ殺す攻撃
#
# @within function asset:mob/0104.mad_scientist/hurt/2.hurt
#> Private
# @private
    #declare tag SpreadMarker

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

# リセット
    kill @e[type=marker,tag=SpreadMarker]

# 斧を持ち出してくる
   item replace entity @s weapon.mainhand with netherite_axe

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

# リセット
    data remove storage lib: Argument


text:
#> asset:mob/0104.mad_scientist/tick/5.addition_throw
#
# 追加でポーション投げるfunction
#
# @within function asset:mob/0104.mad_scientist/tick/4.throw_potion

# 一度タグを全消し
    execute if entity @s[tag=2W.Poison] run tag @s remove 2W.Poison
    execute if entity @s[tag=2W.Fire] run tag @s remove 2W.Fire
    execute if entity @s[tag=2W.Water] run tag @s remove 2W.Water
    execute if entity @s[tag=2W.Thunder] run tag @s remove 2W.Thunder

# ポーションを選択
    execute store result score $Random Temporary run function lib:random/
    scoreboard players operation $Random Temporary %= $4 Const
    execute if score $Random Temporary matches 0 run tag @s add 2W.Poison
    execute if score $Random Temporary matches 1 run tag @s add 2W.Fire
    execute if score $Random Temporary matches 2 run tag @s add 2W.Water
    execute if score $Random Temporary matches 3 run tag @s add 2W.Thunder
    scoreboard players reset $Random Temporary

# 薬品投げ
    data modify storage api: Argument.ID set value 105
    function api:mob/summon
    tp @e[type=armor_stand,scores={MobID=105},distance=..0.01] ~ ~1 ~ ~ ~


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

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

# 最初にまず4つの属性に分岐
    execute if score @s 2W.Tick matches 1 run function asset:mob/0104.mad_scientist/tick/3.random_element_select

# 投げる予告音
    execute if score @s 2W.Tick matches 100 run playsound minecraft:entity.wither.ambient hostile @a ~ ~ ~ 1 1.5

# ポーションを投げる(Projectile使用)
    execute if score @s 2W.Tick matches 120.. run function asset:mob/0104.mad_scientist/tick/4.throw_potion

# 体力が半分以下の場合なんかパーティクルを纏う
    execute if entity @s[tag=2W.HPless50Per] run particle witch ~ ~1.2 ~ 0.3 0.4 0.3 0 5 normal @a


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

execute if data storage asset:context {id:104} if entity @a[distance=..50] run function asset:mob/0104.mad_scientist/tick/2.tick


text:
#> asset:mob/0104.mad_scientist/tick/3.random_element_select
#
# 次に投げるポーションを設定
#
# @within function asset:mob/0104.mad_scientist/tick/2.tick

 # 25%ずつの確率で4つに分岐 それぞれ毒、火、水、雷
    execute store result score $Random Temporary run function lib:random/
    scoreboard players operation $Random Temporary %= $4 Const
    execute if score $Random Temporary matches 0 run tag @s add 2W.Poison
    execute if score $Random Temporary matches 1 run tag @s add 2W.Fire
    execute if score $Random Temporary matches 2 run tag @s add 2W.Water
    execute if score $Random Temporary matches 3 run tag @s add 2W.Thunder
    scoreboard players reset $Random Temporary

# せっかくなら持ってるポーションの色合わせたい
    execute if entity @s[tag=2W.Poison] run item replace entity @s weapon.mainhand with splash_potion{CustomPotionColor:26112}
    execute if entity @s[tag=2W.Fire] run item replace entity @s weapon.mainhand with splash_potion{CustomPotionColor:13369344}
    execute if entity @s[tag=2W.Water] run item replace entity @s weapon.mainhand with splash_potion{CustomPotionColor:8454143}
    execute if entity @s[tag=2W.Thunder] run item replace entity @s weapon.mainhand with splash_potion{CustomPotionColor:16776960}


text:
#> asset:mob/0104.mad_scientist/tick/4.throw_potion
#
# ポーション投げるタイミングの処理
#
# @within function asset:mob/0104.mad_scientist/tick/2.tick

# バックステップ
    data modify storage lib: Argument.VectorMagnitude set value 1
    execute facing entity @p[gamemode=!spectator] feet rotated ~180 ~-10 run function lib:motion/

# リセット
    data remove storage lib: Argument

# 薬品投げ
    data modify storage api: Argument.ID set value 105
    function api:mob/summon
    execute facing entity @p[tag=!PlayerShouldInvulnerable] feet run tp @e[type=armor_stand,scores={MobID=105},distance=..0.01] ~ ~1 ~ ~ ~

# 音
    playsound entity.splash_potion.throw hostile @a ~ ~ ~ 1 0.5 0

# 体力が半分以下であることを検知して3way弾にする
    execute if entity @s[tag=2W.HPless50Per] facing entity @p[tag=!PlayerShouldInvulnerable] feet rotated ~20 ~ run function asset:mob/0104.mad_scientist/tick/5.addition_throw
    execute if entity @s[tag=2W.HPless50Per] facing entity @p[tag=!PlayerShouldInvulnerable] feet rotated ~-20 ~ run function asset:mob/0104.mad_scientist/tick/5.addition_throw

# スコアリセット
    scoreboard players reset @s 2W.Tick
# タグを全消し
    execute if entity @s[tag=2W.Poison] run tag @s remove 2W.Poison
    execute if entity @s[tag=2W.Fire] run tag @s remove 2W.Fire
    execute if entity @s[tag=2W.Water] run tag @s remove 2W.Water
    execute if entity @s[tag=2W.Thunder] run tag @s remove 2W.Thunder


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

#> 定義類はここに
# @within function asset:mob/0055.hetukedah/**
    scoreboard objectives add 1J.BossTime dummy


text:
#> asset:mob/0055.hetukedah/_index.d
# @private

#> tag
# @within function asset:mob/0055.hetukedah/**/**
    #declare tag Landing
    #declare tag LandingTarget


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

# 演出
    particle minecraft:explosion_emitter ~ ~ ~ 0 0 0 0 1 normal
    playsound entity.generic.explode hostile @a ~ ~ ~ 1 1
    playsound entity.ravager.death hostile @a ~ ~ ~ 1 0.5


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

execute if data storage asset:context {id:55} run function asset:mob/0055.hetukedah/death/2.death


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

# 元となるMobを召喚する
    summon zombie ~ ~ ~ {Silent:1b,Tags:["MobInit","AlwaysInvisible","AntiVoid"],DeathLootTable:"asset:mob/death/0055.hetukedah"}
# ID (int)
    data modify storage asset:mob ID set value 55
# 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:stick",Count:1b,tag:{CustomModelData:20013}}
    # オフハンド (Compound(Item)) (オプション)
        data modify storage asset:mob Weapon.Offhand set value {id:"minecraft:stick",Count:1b,tag:{CustomModelData:20014}}
# 武器ドロップ率 ([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:20015}}
    # 胴 (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 3100
# 攻撃力 (double) (オプション)
    data modify storage asset:mob AttackDamage set value 10
# 防御力 (double) (オプション) // 被ダメージがある程度大きい場合1ptにつき0.8%カット、小さい場合1ptにつき約4%カット 20pt以上は頭打ち
    #data modify storage asset:mob Defense set value 0
# 特殊防御力 (double) (オプション) // 4pointにつきダメージを大きく減らす
    #data modify storage asset:mob SpecialDefense set value 0
# 移動速度 (double) (オプション)
    data modify storage asset:mob Speed set value 0.2
# 索敵範囲 (double) (オプション)
    data modify storage asset:mob FollowRange set value 32
# ノックバック耐性 (double) (オプション)
    data modify storage asset:mob KnockBackResist set value 1.0
# 属性倍率 // 1.0fで100% 最低でも25%は軽減されずに入る
    # 物理倍率 (float) (オプション)
        data modify storage asset:mob Resist.Physical set value 1.0
    # 魔法倍率 (float) (オプション)
        data modify storage asset:mob Resist.Magic set value 0.8
    # 火倍率 (float) (オプション)
        data modify storage asset:mob Resist.Fire set value 1.0
    # 水倍率 (float) (オプション)
        data modify storage asset:mob Resist.Water set value 1.0
    # 雷倍率 (float) (オプション)
        data modify storage asset:mob Resist.Thunder set value 1.0

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


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

execute if data storage asset:context {id:55} run function asset:mob/0055.hetukedah/summon/2.summon


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

# 演出
    playsound entity.ravager.hurt hostile @a ~ ~ ~ 1 0.7
    particle block redstone_block ~ ~1.3 ~ 0 0 0 1 20


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

execute if data storage asset:context {id:55} run function asset:mob/0055.hetukedah/hurt/2.hurt


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

execute if data storage asset:context {id:55} run function asset:mob/0055.hetukedah/attack/2.attack


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

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


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

# スコア付与
    scoreboard players add @s 1J.BossTime 1

# 一定のスコアになったら実行（スキル発動の予兆）
    execute if score @s 1J.BossTime matches 120.. run particle dragon_breath ~ ~0.5 ~ 2 0 2 0 10
    execute if score @s 1J.BossTime matches 120 run playsound entity.ravager.death hostile @a ~ ~ ~ 1 2
    execute if score @s 1J.BossTime matches 120 run data merge entity @s {NoAI:1b}

# スキル発動
    execute if score @s 1J.BossTime matches 140 run function asset:mob/0055.hetukedah/tick/3.skill

# 演出
    particle dripping_obsidian_tear ~ ~1 ~ 0.4 0.4 0.4 1 1 normal
    particle portal ~ ~1 ~ 0.4 0.4 0.4 1 3 normal


text:
#> asset:mob/0055.hetukedah/tick/6.speedup
#
# 移動速度上がるの
#
# @within function asset:mob/0055.hetukedah/tick/3.skill

# 演出
    playsound entity.wither.shoot hostile @a ~ ~ ~ 1 2
    particle end_rod ~ ~1 ~ 0 0 0 0.4 100
# エフェクト
    effect give @s speed 5 6


text:
#> asset:mob/0055.hetukedah/tick/4.skill1_otetebeam
#
# おててビーム！手からビームを発射する！！！
#
# @within function asset:mob/0055.hetukedah/tick/3.skill

# 弾を進めるための再起開始
    execute anchored eyes positioned ^1 ^ ^ run function asset:mob/0055.hetukedah/tick/otetebeam/4.1.shoot
    execute anchored eyes positioned ^-1 ^ ^ run function asset:mob/0055.hetukedah/tick/otetebeam/4.1.shoot

# 演出
    particle minecraft:explosion ~ ~ ~ 0.3 0 0.3 0 10
    playsound minecraft:entity.wither.hurt hostile @a ~ ~ ~ 1 1.5

# タグを消す
    tag @s remove Landing


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

execute if data storage asset:context {id:55} run function asset:mob/0055.hetukedah/tick/2.tick


text:
#> asset:mob/0055.hetukedah/tick/3.skill
#
# モブが持つスキル一覧、ランダムに実行
#
# @within function asset:mob/0055.hetukedah/tick/2.tick
#> Private
# @private
    #declare score_holder $Random

# ランダム
    # 疑似乱数取得
        execute store result score $Random Temporary run function lib:random/
    # ほしい範囲に剰余算
        scoreboard players operation $Random Temporary %= $3 Const
    # メッセージ出力
        execute if score $Random Temporary matches 0 run function asset:mob/0055.hetukedah/tick/4.skill1_otetebeam
        execute if score $Random Temporary matches 1 run function asset:mob/0055.hetukedah/tick/5.magicattack
        execute if score $Random Temporary matches 2 run function asset:mob/0055.hetukedah/tick/6.speedup

    # リセット
        scoreboard players reset $Random Temporary

# スコアを戻す
    scoreboard players set @s 1J.BossTime 0
# NoAIを戻す
    data merge entity @s {NoAI:0b}