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

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

# 毒
    effect give @a[tag=!PlayerShouldInvulnerable,distance=..3] poison 5 6 false

# 演出
    particle dust 0 0.4 0 1 ~ ~1.2 ~ 1 0.4 1 0 4 normal @a
    particle dust 0.6 0 1 1 ~ ~1.2 ~ 1 0.4 1 0 4 normal @a
    playsound block.fire.extinguish hostile @a ~ ~ ~ 0.4 2 0

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


text:
#> asset:mob/0105.potion_projectile/tick/water/2.water_damage
#
#
#
# @within function asset:mob/0105.potion_projectile/tick/water/1.break

# デバフ
    effect give @a[tag=!PlayerShouldInvulnerable,distance=..3] slowness 5 2 true

# ダメージ
    data modify storage lib: Argument.Damage set value 25.0
    data modify storage lib: Argument.AttackType set value "Magic"
    data modify storage lib: Argument.ElementType set value "Water"
# デスログ
    data modify storage lib: Argument.DeathMessage append value '[{"translate": "%1$sは%2$sの氷の薬品により氷に閉ざされた","with":[{"selector":"@s"},{"nbt":"Return.AttackerName","storage":"lib:","interpret":true}]}]'
# 補正
    function lib:damage/modifier
# 実行
    execute as @a[tag=!PlayerShouldInvulnerable,distance=..3] run function lib:damage/
# リセット
    function lib:damage/reset

repo_name: ProjectTSB/TheSkyBlessing

repo_language: mcfunction

mime_type: text/plain


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

# 演出
    particle snowflake ~ ~1.2 ~ 1 0.4 1 0 50 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 end_rod ~ ~ ~ 0 0 0 0.4 200
    particle minecraft:large_smoke ~ ~ ~ 0 0 0 0.4 10

# ダメージとデバフ
    execute if entity @a[tag=!PlayerShouldInvulnerable,distance=..3] run function asset:mob/0105.potion_projectile/tick/water/2.water_damage

# 自身をkill
    kill @s


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

#> 定義類はここに
# @within function asset:mob/0019.horus_priest/**
    scoreboard objectives add J.HealCool dummy


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

# 演出
    particle minecraft:soul ~ ~0.5 ~ 0 0 0 0.04 100


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

execute if data storage asset:context {id:19} run function asset:mob/0019.horus_priest/death/2.death


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

# 元となるMobを召喚する
    summon skeleton ~ ~ ~ {Tags:["MobInit"],DeathLootTable:"asset:mob/death/0019.horus_priest"}
# ID (int)
    data modify storage asset:mob ID set value 19
# 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":"light_purple"}'
# 武器
    # メインハンド (Compound(Item)) (オプション)
        data modify storage asset:mob Weapon.Mainhand set value {id:"minecraft:carrot_on_a_stick",Count:1b,tag:{CustomModelData:191}}
    # オフハンド (Compound(Item)) (オプション)
        data modify storage asset:mob Weapon.Offhand 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 {}
    # 脚 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Legs set value {}
    # 足 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Feet set value {}
# 体力 (double) (オプション)
    data modify storage asset:mob Health set value 300
# 攻撃力 (double) (オプション)
    data modify storage asset:mob AttackDamage set value 0
# 防御力 (double) (オプション) // 被ダメージがある程度大きい場合1ptにつき0.8%カット、小さい場合1ptにつき約4%カット 20pt以上は頭打ち
    data modify storage asset:mob Defense set value 0
# 特殊防御力 (double) (オプション) // 4pointにつきダメージを大きく減らす
    data modify storage asset:mob SpecialDefense set value 0
# 移動速度 (double) (オプション)
    data modify storage asset:mob Speed set value 0.2
# 索敵範囲 (double) (オプション)
    data modify storage asset:mob FollowRange set value 25.0
# ノックバック耐性 (double) (オプション)
    data modify storage asset:mob KnockBackResist set value 0.6
# 属性倍率 // 1.0fで100% 最低でも25%は軽減されずに入る
    # 物理倍率 (float) (オプション)
        data modify storage asset:mob Resist.Physical set value 1
    # 魔法倍率 (float) (オプション)
        data modify storage asset:mob Resist.Magic set value 0.95
    # 火倍率 (float) (オプション)
        data modify storage asset:mob Resist.Fire set value 0.9
    # 水倍率 (float) (オプション)
        data modify storage asset:mob Resist.Water set value 1.0
    # 雷倍率 (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/0019.horus_priest/summon/1.trigger
#
# Mob召喚処理の呼び出し時に実行されるfunction
#
# @within tag/function asset:mob/summon

execute if data storage asset:context {id:19} run function asset:mob/0019.horus_priest/summon/2.summon


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

# スコアを増やしていく
    scoreboard players add @s J.HealCool 1

# 特定のスコアに達したら効果発動
    execute if score @s J.HealCool matches 160 run playsound entity.elder_guardian.hurt hostile @a ~ ~ ~ 0.6 0.8
    execute if score @s J.HealCool matches 160 run particle minecraft:dragon_breath ~ ~ ~ 0.2 0.2 0.2 0.06 100
    execute if score @s J.HealCool matches 180 run function asset:mob/0019.horus_priest/tick/2.1.heal


text:
#> asset:mob/0019.horus_priest/tick/2.1.heal
#
# Mobのtick時の処理
#
# @within function asset:mob/0019.horus_priest/tick/2.tick

# 効果を発動する
    data modify storage lib: Argument.Heal set value 100f
    function lib:heal/modifier
    execute as @e[tag=Enemy,distance=..10] run function lib:heal/
    execute as @e[tag=Enemy,distance=..10] at @s run particle heart ~ ~1 ~ 0.3 0.3 0.3 0 10
    playsound minecraft:entity.arrow.hit_player hostile @a ~ ~ ~ 1 1
# リセット
    function lib:heal/reset
    scoreboard players set @s J.HealCool 0


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

execute if data storage asset:context {id:19} run function asset:mob/0019.horus_priest/tick/2.tick


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

# 元となるMobを召喚する
    summon area_effect_cloud ~ ~ ~ {Tags:["MobInit"],CustomNameVisible:0b,Particle:"block air",Duration:40}
# ID (int)
    data modify storage asset:mob ID set value 1012
# 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"}'
# MobInitタグ持ちを対象にして召喚関数呼び出し
    execute as @e[type=area_effect_cloud,tag=MobInit,distance=..0.01] run function asset:mob/common/summon


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

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


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

# 演出
    particle minecraft:lava ~ ~ ~ 0.1 0.1 0.1 1 5
    particle minecraft:flame ~ ~ ~ 0.1 0.1 0.1 0 5

# 着弾
    execute unless block ~ ~ ~ #lib:no_collision run function asset:mob/1012.meteor_big/tick/3.landing

# 落下する
    tp @s ~ ~-0.4 ~


text:
#> asset:mob/1012.meteor_big/tick/3.landing
#
#
#
# @within function asset:mob/1012.meteor_big/tick/2.tick

# 演出
    particle minecraft:explosion ~ ~ ~ 3 1 3 0 6
    particle minecraft:large_smoke ~ ~ ~ 0 0 0 0.4 30
    particle minecraft:lava ~ ~ ~ 3 1 3 0.42 30

    playsound entity.lightning_bolt.impact hostile @a ~ ~ ~ 1 0
    playsound entity.generic.explode hostile @a ~ ~ ~ 1 0
    playsound entity.generic.explode hostile @a ~ ~ ~ 1 0.5

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

# 自害する
    kill @s


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

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


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

#> 定義類はここに
# @within function asset:mob/0261.laser_eye_mk2/**
    scoreboard objectives add 79.Time dummy


text:
#> asset:mob/0261.laser_eye_mk2/_index.d
# @private

#> tag
# @within function asset:mob/0261.laser_eye_mk2/**
    #declare tag LandingTarget
    #declare tag Landing
    #declare tag 79.Ready


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

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


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

execute if data storage asset:context {id:261} run function asset:mob/0261.laser_eye_mk2/death/2.death


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

# 元となるMobを召喚する
    summon zombie ~ ~ ~ {Tags:["MobInit","AlwaysInvisible"],Silent:1b,NoAI:1b,DeathLootTable:"asset:mob/death/0261.laser_eye_mk2"}
# ID (int)
    data modify storage asset:mob ID set value 261
# 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":"レーザーアイMk-Ⅱ","color":"green"}'
# 武器
    # メインハンド (Compound(Item)) (オプション)
        # data modify storage asset:mob Weapon.Mainhand set value
    # オフハンド (Compound(Item)) (オプション)
        # data modify storage asset:mob Weapon.Offhand set value
# 武器ドロップ率 ([float, float]) (オプション)
    # data modify storage asset:mob WeaponDropChances set value
# 防具
    # 頭 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Head set value {id:"minecraft:stick",Count:1b,tag:{CustomModelData:20139}}
    # 胴 (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 160
# 攻撃力 (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.7
    # 魔法倍率 (float) (オプション)
        data modify storage asset:mob Resist.Magic set value 1
    # 火倍率 (float) (オプション)
        data modify storage asset:mob Resist.Fire set value 0.7
    # 水倍率 (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/0261.laser_eye_mk2/summon/1.trigger
#
# Mob召喚処理の呼び出し時に実行されるfunction
#
# @within tag/function asset:mob/summon

execute if data storage asset:context {id:261} run function asset:mob/0261.laser_eye_mk2/summon/2.summon


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

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


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

execute if data storage asset:context {id:261} run function asset:mob/0261.laser_eye_mk2/hurt/2.hurt


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

# タグを持たないならホーミングじみた移動
    execute if entity @s[tag=!79.Ready] facing entity @p feet positioned ^ ^ ^-100 rotated as @s positioned ^ ^ ^-800 facing entity @s feet positioned as @s run tp @s ^ ^ ^0.1 ~ ~

# タグを持っているならその場でプレイヤー追尾
    execute if entity @s[tag=79.Ready] facing entity @p feet positioned ^ ^ ^-100 rotated as @s positioned ^ ^ ^-600 facing entity @s feet positioned as @s run tp @s ^ ^ ^ ~ ~

# プレイヤーが一定の距離にいたらスコアを付与
    execute if entity @p[gamemode=!spectator,distance=..8] unless score @s 79.Time matches -2147483648..2147483647 run scoreboard players set @s 79.Time 0

# スコアを持っているなら実行
    execute if score @s 79.Time matches 0.. run function asset:mob/0261.laser_eye_mk2/tick/3.ready


text:
#> asset:mob/0261.laser_eye_mk2/tick/6.end
#
#
#
# @within function asset:mob/0261.laser_eye_mk2/tick/3.ready

# リセット
    tag @s remove 79.Ready
    scoreboard players reset @s 79.Time


text:
#> asset:mob/0261.laser_eye_mk2/tick/3.ready
#
#
#
# @within function asset:mob/0261.laser_eye_mk2/tick/2.tick

# スコアを増やす
    scoreboard players add @s 79.Time 1

# タグを与える
    execute if score @s 79.Time matches 1 run tag @s add 79.Ready
# 音を鳴らす
    execute if score @s 79.Time matches 1 run playsound minecraft:block.beacon.activate hostile @a ~ ~ ~ 1 2
# 一定スコアで射撃準備
    execute if score @s 79.Time matches ..20 anchored eyes positioned ^ ^ ^1.6 rotated ~ ~90 run function asset:mob/0261.laser_eye_mk2/tick/particle

# 一定スコアで射撃
    execute if score @s 79.Time matches 20 anchored eyes positioned ^ ^ ^1.6 run function asset:mob/0261.laser_eye_mk2/tick/4.shoot
    execute if score @s 79.Time matches 20 run tag @s remove Landing
    execute if score @s 79.Time matches 20 run tag @s remove 79.Ready
# 発砲演出
    execute if score @s 79.Time matches 20 run playsound minecraft:block.respawn_anchor.deplete hostile @a ~ ~ ~ 1 1

# 一定スコアで終了
    execute if score @s 79.Time matches 70 run function asset:mob/0261.laser_eye_mk2/tick/6.end


text:
#> asset:mob/0261.laser_eye_mk2/tick/particle
#
#
#
# @within function asset:mob/0261.laser_eye_mk2/tick/3.ready

# [ImportKey]: NobwRALgngDgpmAXGGB7ANlA5qgdmAGjAFdiBLAEyTACYBWAIwE4AWAMwHYKBaOOugBzd2TONwFsBPAIZMAbAGM5cOSwoK4HQmFzSAtgmSAsTUBLkYCN9AAQBGbTGkAnfQGck4BamK4ISOkQ1e4e1cwADdpdGJDcAAPJAAGIih4gF9kokcKMmIXRDiAOgBmIicIB29EFl8wOHR0MhgnQys4hLB7VFKIQ1b3e1xApBYiACtiPRgkKyIGOAAvMgHcojInAFFa+sbVgEdicMwAZTsNKkQ2cMblpwAhOYX7Hb3aqCPpE6Rz9EbUgnBoeGoaEwOHwRFIlGoNGkcQEcQoBR4VgKDA4wiYHAK4hRTG4cQ4dGkLBobBYLAU8m0ugM1FMlis3HcMCSRDsjj0OTcHi8Pj8cACQUQ4DCESiYFiSzASVyPza0ky2XieSqJTK8SINTqDSaLXSHWkXTVYF6-QFQzAo3GSBo0zui1aK3Wmq2u32L2OcFOn0uYBWt3mgUerte7zOFzgPz+sEMYDq-W04NOYDoLAYDHoBXpcRTNGEChocW40jYTBzHBmFDgKYEHA4TGklP00cAW74WAq2BzOYLuTzlKpsdp6YLCyLBcW4vIcRJIcccGUQVBD8IjwVi6f5SeSteFGWoNhsRrlVozf0C+03W0PF3PYMej5hiOQKPUWMIMHkRPyAQFFhxKw5hRWHQYiknACjcEwAh0GBcjyFYLBfoSzACA21LIC2mKMsyKAduyXZcr2RD9qgg4rsOoriuuU6IDOc4LqRS7kYqRSbtR647nuB6Gse9yGr6F6Bte7qeveaSRgCyAvvG77UHEMEQVYTBgQoGgFvBHDSOIKaYrWXA0FCbAZjWKHNq2DKoEyZlMu2bIcka+E8mAREkUKDGjoqG5SuOBS0YuIpubkE5UTRaRgLu+5wIeNonrx54ngJhxCXeXzhqJj7iTGZBxm+ELIHEGh7m8OZ8MwwgpjIcTIrichWLCKgUHKSjGdQ6GWVArWtdZnYrt23KIH2A6+cuMTuVR+TeSF86DYxAUee57HhZFYDcXaVx+vc8Vum8t6hslD7-NGknZYmzAFMmRaogILAwWiNXcAwcgMDwDAKCwgFbQobAUMhRBUiZGHmW1mHtZhnW4d19l9YRA30X5K4UYFLFsRNdEubDw0BcxUpI0QYWcRKy2nqt-FXglW3CbtqX7c+mWviQ0m5RQNAPQUbzcFB10sLIF0CCobNwAINCM3pBL4k1aGmUDksA8DAOg7ZPUEY50Oo0Nq6sQjWMTj5MOq2OY2jVrIW4xFXEXjFa0BiTm0hl6KW-GlB001JOVgPVDCEtWYHSAUPOlRQdDgXlOIKOpxJsFCD0KHEYtgC1UsWfHgPSyDLI4fLEP9cRU3+TOBvjUQk069NueI4bOMcSb+NmxKfFxVbN7k98lNPhJTtHdQbBwFYhJyDQmIFLW9JEiS4jSFw3AUBQxY0AwGZwEw5wx3Hyey6nNl4T2DlOdncNbrN6uzsjO-o15QXY6FFeLQT5vE08pM2yJAC6QA_3
# 多角形 1-copy
particle composter ^0 ^ ^-0.5 0 0 0 0 1
particle composter ^0 ^ ^-0.3 0 0 0 0 1
particle composter ^0 ^ ^-0.1 0 0 0 0 1
particle composter ^0 ^ ^0.1 0 0 0 0 1
particle composter ^0 ^ ^0.3 0 0 0 0 1
particle composter ^0.5 ^ ^0 0 0 0 0 1
particle composter ^0.3 ^ ^0 0 0 0 0 1
particle composter ^0.1 ^ ^0 0 0 0 0 1
particle composter ^-0.1 ^ ^0 0 0 0 0 1
particle composter ^-0.3 ^ ^0 0 0 0 0 1
particle composter ^0 ^ ^0.5 0 0 0 0 1
particle composter ^0 ^ ^0.3 0 0 0 0 1
particle composter ^0 ^ ^0.1 0 0 0 0 1
particle composter ^0 ^ ^-0.1 0 0 0 0 1
particle composter ^0 ^ ^-0.3 0 0 0 0 1
particle composter ^-0.5 ^ ^0 0 0 0 0 1
particle composter ^-0.3 ^ ^0 0 0 0 0 1
particle composter ^-0.1 ^ ^0 0 0 0 0 1
particle composter ^0.1 ^ ^0 0 0 0 0 1
particle composter ^0.3 ^ ^0 0 0 0 0 1
# 多角形 1
particle composter ^0.21213 ^ ^-0.21213 0 0 0 0 1
particle composter ^0.21213 ^ ^-0.12728 0 0 0 0 1
particle composter ^0.21213 ^ ^-0.04243 0 0 0 0 1
particle composter ^0.21213 ^ ^0.04243 0 0 0 0 1
particle composter ^0.21213 ^ ^0.12728 0 0 0 0 1
particle composter ^0.21213 ^ ^0.21213 0 0 0 0 1
particle composter ^0.12728 ^ ^0.21213 0 0 0 0 1
particle composter ^0.04243 ^ ^0.21213 0 0 0 0 1
particle composter ^-0.04243 ^ ^0.21213 0 0 0 0 1
particle composter ^-0.12728 ^ ^0.21213 0 0 0 0 1
particle composter ^-0.21213 ^ ^0.21213 0 0 0 0 1
particle composter ^-0.21213 ^ ^0.12728 0 0 0 0 1
particle composter ^-0.21213 ^ ^0.04243 0 0 0 0 1
particle composter ^-0.21213 ^ ^-0.04243 0 0 0 0 1
particle composter ^-0.21213 ^ ^-0.12728 0 0 0 0 1
particle composter ^-0.21213 ^ ^-0.21213 0 0 0 0 1
particle composter ^-0.12728 ^ ^-0.21213 0 0 0 0 1
particle composter ^-0.04243 ^ ^-0.21213 0 0 0 0 1
particle composter ^0.04243 ^ ^-0.21213 0 0 0 0 1
particle composter ^0.12728 ^ ^-0.21213 0 0 0 0 1
# 線 3
particle composter ^-0.7 ^ ^-0.7 0 0 0 0 1
particle composter ^-0.7 ^ ^-0.6 0 0 0 0 1
particle composter ^-0.7 ^ ^-0.5 0 0 0 0 1
particle composter ^-0.7 ^ ^-0.4 0 0 0 0 1
particle composter ^-0.7 ^ ^-0.3 0 0 0 0 1
# 線 3-copy
particle composter ^0.7 ^ ^-0.7 0 0 0 0 1
particle composter ^0.6 ^ ^-0.7 0 0 0 0 1
particle composter ^0.5 ^ ^-0.7 0 0 0 0 1
particle composter ^0.4 ^ ^-0.7 0 0 0 0 1
particle composter ^0.3 ^ ^-0.7 0 0 0 0 1
# 線 3-copy-copy
particle composter ^0.7 ^ ^-0.3 0 0 0 0 1
particle composter ^0.7 ^ ^-0.4 0 0 0 0 1
particle composter ^0.7 ^ ^-0.5 0 0 0 0 1
particle composter ^0.7 ^ ^-0.6 0 0 0 0 1
particle composter ^0.7 ^ ^-0.7 0 0 0 0 1
# 線 3-copy-copy-copy
particle composter ^0.7 ^ ^0.3 0 0 0 0 1
particle composter ^0.7 ^ ^0.4 0 0 0 0 1
particle composter ^0.7 ^ ^0.5 0 0 0 0 1
particle composter ^0.7 ^ ^0.6 0 0 0 0 1
particle composter ^0.7 ^ ^0.7 0 0 0 0 1
# 線 3-copy-copy-copy-copy
particle composter ^0.7 ^ ^0.7 0 0 0 0 1
particle composter ^0.6 ^ ^0.7 0 0 0 0 1
particle composter ^0.5 ^ ^0.7 0 0 0 0 1
particle composter ^0.4 ^ ^0.7 0 0 0 0 1
particle composter ^0.3 ^ ^0.7 0 0 0 0 1
# 線 3-copy-copy-copy-copy-copy
particle composter ^-0.7 ^ ^0.7 0 0 0 0 1
particle composter ^-0.6 ^ ^0.7 0 0 0 0 1
particle composter ^-0.5 ^ ^0.7 0 0 0 0 1
particle composter ^-0.4 ^ ^0.7 0 0 0 0 1
particle composter ^-0.3 ^ ^0.7 0 0 0 0 1
# 線 3-copy-copy-copy-copy-copy-copy
particle composter ^-0.7 ^ ^0.3 0 0 0 0 1
particle composter ^-0.7 ^ ^0.4 0 0 0 0 1
particle composter ^-0.7 ^ ^0.5 0 0 0 0 1
particle composter ^-0.7 ^ ^0.6 0 0 0 0 1
particle composter ^-0.7 ^ ^0.7 0 0 0 0 1
# 線 3-copy-copy
particle composter ^-0.7 ^ ^-0.7 0 0 0 0 1
particle composter ^-0.6 ^ ^-0.7 0 0 0 0 1
particle composter ^-0.5 ^ ^-0.7 0 0 0 0 1
particle composter ^-0.4 ^ ^-0.7 0 0 0 0 1
particle composter ^-0.3 ^ ^-0.7 0 0 0 0 1


text:
#> asset:mob/0261.laser_eye_mk2/tick/4.shoot
#
# ビーム処理
#
# @within function
#   asset:mob/0261.laser_eye_mk2/tick/3.ready
#   asset:mob/0261.laser_eye_mk2/tick/4.shoot

# ここから先は神器側の効果の処理を書く
# 着弾検知
    execute positioned ~-0.5 ~-0.5 ~-0.5 if entity @e[type=#lib:living,type=player,dx=0] run tag @s add Landing
    execute unless block ^ ^ ^0.5 #lib:no_collision run tag @s add Landing

# ターゲットにタグ付与
    execute positioned ~-0.5 ~-0.5 ~-0.5 if entity @e[type=#lib:living,type=player,dx=0] run tag @e[type=#lib:living,type=player,gamemode=!spectator,dx=0,limit=1] add LandingTarget

# 演出
    particle minecraft:composter ~ ~ ~ 0.1 0.1 0.1 0 1
    particle minecraft:composter ~ ~ ~ 0.3 0.3 0.3 0 9
    particle minecraft:dust 0.075 0.604 0.063 0.7 ~ ~ ~ 0 0 0 0 0
    particle minecraft:dust 0.075 0.604 0.063 0.7 ~ ~ ~ 0.3 0.3 0.3 0 9

# 着弾
    execute if entity @s[tag=Landing] run function asset:mob/0261.laser_eye_mk2/tick/5.damage

# 再起
    execute positioned ^ ^ ^0.5 if entity @s[tag=!Landing,distance=..30] run function asset:mob/0261.laser_eye_mk2/tick/4.shoot


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

execute if data storage asset:context {id:261} run function asset:mob/0261.laser_eye_mk2/tick/2.tick


text:
#> asset:mob/0261.laser_eye_mk2/tick/5.damage
#
# ダメージ与える所
#
# @within function
#   asset:mob/0261.laser_eye_mk2/tick/4.shoot

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

# ダメージ設定
    # 与えるダメージ
        data modify storage lib: Argument.Damage set value 18f
    # 第一属性
        data modify storage lib: Argument.AttackType set value "Magic"
    # 第二属性
        data modify storage lib: Argument.ElementType set value "Thunder"
    # ダメージ
        function lib:damage/modifier
        execute as @p[tag=LandingTarget,tag=!PlayerShouldInvulnerable,distance=..20,limit=1] run function lib:damage/
# リセット
    function lib:damage/reset

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


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

# 元となるMobを召喚する
    summon sheep ~ ~ ~ {Tags:["MobInit"],DeathLootTable:"asset:mob/death/0162.sheep_chan"}
# ID (int)
    data modify storage asset:mob ID set value 162
# Type (string) Wikiを参照
    data modify storage asset:mob Type set value "Friend"
# 干渉可能か否か (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
    # 胴 (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 0.1
# 攻撃力 (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=sheep,tag=MobInit,distance=..0.01] run function asset:mob/common/summon


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

execute if data storage asset:context {id:162} run function asset:mob/0162.sheep_chan/summon/2.summon


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

#> 定義類はここに
# @within function asset:mob/0263.orange/**
    scoreboard objectives add 7B.Tick dummy


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

# 元となるMobを召喚する
    summon item ~ ~ ~ {Age:5950s,PickupDelay:-1s,Tags:["MobInit"],Item:{id:"player_head",Count:1b,tag:{SkullOwner:{Id:[I;463153349,-1660531863,-1823714981,703784498],Properties:{textures:[{Value:"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNjViMWRiNTQ3ZDFiNzk1NmQ0NTExYWNjYjE1MzNlMjE3NTZkN2NiYzM4ZWI2NDM1NWEyNjI2NDEyMjEyIn19fQ=="}]}}}}}
# ID (int)
    data modify storage asset:mob ID set value 263
# 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
# 武器
    # メインハンド (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
# 攻撃力 (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=item,tag=MobInit,distance=..0.01] run function asset:mob/common/summon


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

execute if data storage asset:context {id:263} run function asset:mob/0263.orange/summon/2.summon


text:
#> asset:mob/0263.orange/tick/3.on_block
#
#
#
# @within function asset:mob/0263.orange/tick/2.tick

# 一定間隔で音を鳴らす
    scoreboard players operation $Temp Temporary = @s 7B.Tick
    scoreboard players operation $Temp Temporary %= $8 Const
    execute if score $Temp Temporary matches 0 run playsound block.note_block.pling hostile @a[distance=..5] ~ ~ ~ 0.3 2 0
    scoreboard players reset $Temp Temporary

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

# 爆発
    execute if entity @s[scores={7B.Tick=24..}] run function asset:mob/0263.orange/tick/4.boom


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

#> Private
# @private
    #declare score_holder $Temp

# 演出
    particle dust 1 0.5 0 1 ~ ~ ~ 0.05 0.05 0.05 0 1 normal @a

# ここからは足元がブロックの場合のみ動く
    execute unless block ~ ~-0.3 ~ #lib:no_collision run function asset:mob/0263.orange/tick/3.on_block


text:
#> asset:mob/0263.orange/tick/4.boom
#
# 爆発
#
# @within function
#   asset:mob/0263.orange/tick/2.tick
#   asset:mob/0263.orange/tick/3.on_block

# 演出
    particle dust 0 1 0 1 ~ ~0.7 ~ 0.02 0.02 0.02 0 5 normal @a
    particle dust 1 0.5 0 1 ~ ~0.2 ~ 0.4 0.4 0.4 0 200 normal @a
    playsound entity.item.pickup hostile @a ~ ~ ~ 1 0.5 0
    playsound entity.generic.explode hostile @a ~ ~ ~ 0.1 1 0

# 効果を付与
    effect give @a[gamemode=!spectator,distance=..1.5] saturation 3 0 true

# ダメージ
    data modify storage lib: Argument.Damage set value 15f
    data modify storage lib: Argument.AttackType set value "Physical"
    data modify storage lib: Argument.ElementType set value "Water"
# デスログ
    data modify storage lib: Argument.DeathMessage append value '[{"translate": "%1$sは%2$sによって橙色になった。","with":[{"selector":"@s"},{"nbt":"Return.AttackerName","storage":"lib:","interpret":true}]}]'
    data modify storage lib: Argument.DeathMessage append value '[{"translate": "%1$sは%2$sによってみかんを食わされ窒息した","with":[{"selector":"@s"},{"nbt":"Return.AttackerName","storage":"lib:","interpret":true}]}]'
# 補正
    function lib:damage/modifier
# ダメージ
    execute as @a[tag=!PlayerShouldInvulnerable,distance=..1.5] run function lib:damage/
# リセット
    function lib:damage/reset

# 1%で蜜柑をドロップ
    execute if predicate lib:random_pass_per/1 run summon item ~ ~ ~ {Item:{id:"minecraft:player_head",Count:1b,tag:{display:{Name:'{"text":"みかん","color":"#FFAA00"}',Lore:['[{"text":"みかんを投げる者の落としたみかん"}]','{"text":"極稀に形が残るが"}','{"text":"食べることが出来ず"}','{"text":"飾ることしかできない"}']},SkullOwner:{Id:[I;463153349,-1660531863,-1823714981,703784498],Properties:{textures:[{Value:"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNjViMWRiNTQ3ZDFiNzk1NmQ0NTExYWNjYjE1MzNlMjE3NTZkN2NiYzM4ZWI2NDM1NWEyNjI2NDEyMjEyIn19fQ=="}]}}}}}

# 消滅
    kill @s


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

execute if data storage asset:context {id:263} run function asset:mob/0263.orange/tick/2.tick


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

# 元となるMobを召喚する
    summon area_effect_cloud ~ ~ ~ {Tags:["MobInit"],CustomNameVisible:0b,Particle:"block air",Duration:100}
# ID (int)
    data modify storage asset:mob ID set value 1011
# 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"}'
# MobInitタグ持ちを対象にして召喚関数呼び出し
    execute as @e[type=area_effect_cloud,tag=MobInit,distance=..0.01] run function asset:mob/common/summon


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

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


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

# 演出
    particle minecraft:lava ~ ~ ~ 0.1 0.1 0.1 1 5
    particle minecraft:flame ~ ~ ~ 0.1 0.1 0.1 0 5

# 着弾
    execute unless block ~ ~ ~ #lib:no_collision run function asset:mob/1011.meteor/tick/3.landing

# 落下する
    tp @s ~ ~-0.3 ~


text:
#> asset:mob/1011.meteor/tick/3.landing
#
#
#
# @within function asset:mob/1011.meteor/tick/2.tick

# 演出
    particle minecraft:explosion_emitter ~ ~ ~ 0 0 0 1 1
    particle minecraft:large_smoke ~ ~ ~ 0 0 0 0.4 30
    particle minecraft:lava ~ ~ ~ 3 1 3 0.42 13

    playsound entity.lightning_bolt.impact hostile @a ~ ~ ~ 1 0
    playsound entity.generic.explode hostile @a ~ ~ ~ 1 0
    playsound entity.generic.explode hostile @a ~ ~ ~ 1 0.5

# ダメージ設定
    # 与えるダメージ
        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 "Fire"
    # ダメージ
        function lib:damage/modifier
        execute as @a[tag=!PlayerShouldInvulnerable,distance=..5] at @s run function lib:damage/
# リセット
    function lib:damage/reset

# 終了
    kill @s


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

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


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

# 元となるMobを召喚する
    summon vindicator ~ ~ ~ {Tags:["MobInit"],DeathLootTable:"asset:mob/death/0031.tomb_robbing"}
# ID (int)
    data modify storage asset:mob ID set value 31
# 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:stone_shovel",Count:1b}
    # オフハンド (Compound(Item)) (オプション)
        # data modify storage asset:mob Weapon.Offhand set value
# 武器ドロップ率 ([float, float]) (オプション)
    data modify storage asset:mob WeaponDropChances set value [0.0f,0.0f]
# 防具
    # 頭 (Compound(Item)) (オプション)
        # data modify storage asset:mob Armor.Head set value
    # 胴 (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 30
# 攻撃力 (double) (オプション)
    data modify storage asset:mob AttackDamage set value 0.1
# 防御力 (double) (オプション) // 被ダメージがある程度大きい場合1ptにつき0.8%カット、小さい場合1ptにつき約4%カット 20pt以上は頭打ち
    # data modify storage asset:mob Defense set value
# 特殊防御力 (double) (オプション) // 4pointにつきダメージを大きく減らす
    # data modify storage asset:mob SpecialDefense set value
# 移動速度 (double) (オプション)
    data modify storage asset:mob Speed set value 0.25
# 索敵範囲 (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 1.0
    # 火倍率 (float) (オプション)
        data modify storage asset:mob Resist.Fire set value 1.0
    # 水倍率 (float) (オプション)
        data modify storage asset:mob Resist.Water set value 1.0
    # 雷倍率 (float) (オプション)
        data modify storage asset:mob Resist.Thunder set value 1.0

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


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

execute if data storage asset:context {id:31} run function asset:mob/0031.tomb_robbing/summon/2.summon


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

# 召喚
    data modify storage api: Argument.ID set value 254
    function api:mob/summon
    data modify storage api: Argument.ID set value 255
    execute anchored eyes run function api:mob/summon


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

execute if data storage asset:context {id:253} run function asset:mob/0253.parasitic_soldiers/death/2.death


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

# 元となるMobを召喚する
    summon zombie ~ ~ ~ {Tags:["MobInit","AlwaysInvisible"],DeathTime:19s,DeathLootTable:"asset:mob/death/0253.parasitic_soldiers"}
# ID (int)
    data modify storage asset:mob ID set value 253
# Type (string) Wikiを参照
    data modify storage asset:mob Type set value "Enemy"
# 干渉可能か否か (boolean)
    data modify storage asset:mob Interferable set value true
# 名前 (TextComponentString) (オプション)
     data modify storage asset:mob Name set value '{"text":"憑物の兵","color":"#531E57","italic":true}'
# 武器
    # メインハンド (Compound(Item)) (オプション)
        data modify storage asset:mob Weapon.Mainhand set value {id:"minecraft:stick",Count:1b,tag:{CustomModelData:292}}
    # オフハンド (Compound(Item)) (オプション)
        # data modify storage asset:mob Weapon.Offhand set value
# 武器ドロップ率 ([float, float]) (オプション)
    # data modify storage asset:mob WeaponDropChances set value
# 防具
    # 頭 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Head set value {id:"minecraft:stick",Count:1b,tag:{CustomModelData:20142}}
    # 胴 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Chest set value {id:"minecraft:leather_chestplate",Count:1b,tag:{display:{color:3672861}}}
    # 脚 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Legs set value {id:"minecraft:leather_leggings",Count:1b,tag:{display:{color:3672861}}}
    # 足 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Feet set value {id:"minecraft:leather_boots",Count:1b,tag:{display:{color:3672861}}}
# 防具ドロップ率 ([float, float]) (オプション)
    # data modify storage asset:mob ArmorDropChances set value
# 体力 (double) (オプション)
    data modify storage asset:mob Health set value 100
# 攻撃力 (double) (オプション)
    # data modify storage asset:mob AttackDamage set value
# 防御力 (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=zombie,tag=MobInit,distance=..0.01] run function asset:mob/common/summon


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

execute if data storage asset:context {id:253} run function asset:mob/0253.parasitic_soldiers/summon/2.summon


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

execute if data storage asset:context {id:253} run function asset:mob/0253.parasitic_soldiers/attack/2.attack


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

# 演出
    execute at @p[tag=Victim,distance=..6] run particle dust 0.247 0 0 2 ~ ~1 ~ 0.6 0.6 0.6 0 50 normal @a
    playsound minecraft:entity.blaze.hurt hostile @a ~ ~ ~ 1 1.5

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


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

# 元となるMobを召喚する
    summon pillager ~ ~ ~ {Tags:["MobInit"],DeathLootTable:"asset:mob/death/0177.pillager"}
# ID (int)
    data modify storage asset:mob ID set value 177
# Type (string) Wikiを参照
    data modify storage asset:mob Type set value "Enemy"
# 干渉可能か否か (boolean)
    data modify storage asset:mob Interferable set value true
# 名前 (TextComponentString) (オプション)
    data modify storage asset:mob Name set value '{"translate":"entity.minecraft.pillager","color":"gray"}'
# 武器
    # メインハンド (Compound(Item)) (オプション)
        data modify storage asset:mob Weapon.Mainhand set value {id:"crossbow",Count:1b}
    # オフハンド (Compound(Item)) (オプション)
        data modify storage asset:mob Weapon.Offhand set value {id:"minecraft:tipped_arrow",Count:1b,tag:{CustomPotionColor:16711680}}
# 武器ドロップ率 ([float, float]) (オプション)
    # data modify storage asset:mob WeaponDropChances set value
# 防具
    # 頭 (Compound(Item)) (オプション)
        # data modify storage asset:mob Armor.Head set value
    # 胴 (Compound(Item)) (オプション)
        # data modify storage asset:mob Armor.Chest set value
    # 脚 (Compound(Item)) (オプション)
        # data modify storage asset:mob Armor.Legs set value
    # 足 (Compound(Item)) (オプション)
        # data modify storage asset:mob Armor.Feet set value
# 防具ドロップ率 ([float, float]) (オプション)
    # data modify storage asset:mob ArmorDropChances set value
# 体力 (double) (オプション)
    data modify storage asset:mob Health set value 300
# 攻撃力 (double) (オプション)
    # data modify storage asset:mob AttackDamage set value
# 防御力 (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.23
# 索敵範囲 (double) (オプション)
    data modify storage asset:mob FollowRange set value 32
# ノックバック耐性 (double) (オプション)
    data modify storage asset:mob KnockBackResist set value 0.3
# 属性倍率 // 1.0fで100% 最低でも25%は軽減されずに入る
    # 物理倍率 (float) (オプション)
        # data modify storage asset:mob Resist.Physical set value
    # 魔法倍率 (float) (オプション)
        # data modify storage asset:mob Resist.Magic set value
    # 火倍率 (float) (オプション)
        data modify storage asset:mob Resist.Fire set value 0.5
    # 水倍率 (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=pillager,tag=MobInit,distance=..0.01] run function asset:mob/common/summon


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

execute if data storage asset:context {id:177} run function asset:mob/0177.pillager/summon/2.summon


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

execute if data storage asset:context {id:177} run function asset:mob/0177.pillager/attack/2.attack


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

# 演出
    execute at @p[tag=Victim,distance=..32] run particle lava ~ ~1 ~ 0.4 0.3 0.4 0 20 normal @a
    execute at @p[tag=Victim,distance=..32] run playsound minecraft:entity.blaze.shoot hostile @a ~ ~ ~ 1 0.6 0

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


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

# 元となるMobを召喚する
    summon drowned ~ ~ ~ {Tags:["MobInit","AntiBurn"],DeathLootTable:"asset:mob/death/0062.drowned"}
# ID (int)
    data modify storage asset:mob ID set value 62
# Type (string) Wikiを参照
    data modify storage asset:mob Type set value "Enemy"
# 干渉可能か否か (boolean)
    data modify storage asset:mob Interferable set value true
# 名前 (TextComponentString) (オプション)
    data modify storage asset:mob Name set value '{"translate":"entity.minecraft.drowned","color":"gray"}'
# 武器
    # メインハンド (Compound(Item)) (オプション)
        data modify storage asset:mob Weapon.Mainhand set value {id:"minecraft:trident",Count:1b}
    # オフハンド (Compound(Item)) (オプション)
        # data modify storage asset:mob Weapon.Offhand set value
# 武器ドロップ率 ([float, float]) (オプション)
    data modify storage asset:mob WeaponDropChances set value [0.0f,0.0f]
# 防具
    # 頭 (Compound(Item)) (オプション)
        # data modify storage asset:mob Armor.Head set value
    # 胴 (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 125
# 攻撃力 (double) (オプション)
    data modify storage asset:mob AttackDamage set value -6
# 防御力 (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 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
    # 火倍率 (float) (オプション)
        # data modify storage asset:mob Resist.Fire set value
    # 水倍率 (float) (オプション)
        data modify storage asset:mob Resist.Water set value 0.8
    # 雷倍率 (float) (オプション)
        # data modify storage asset:mob Resist.Thunder set value

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


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

execute if data storage asset:context {id:62} run function asset:mob/0062.drowned/summon/2.summon


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

#> 定義類はここに
# @within function asset:mob/0266.small_dark_ball/**
    scoreboard objectives add 7E.Range dummy
    scoreboard objectives add 7E.Speed dummy
    scoreboard objectives add 7E.MoveTimesPerTick dummy


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

# 元となるMobを召喚する
    summon armor_stand ~ ~ ~ {Invisible:1b,Marker:1b,Tags:["MobInit"],Passengers:[{id:"minecraft:snowball",Tags:["AllowProcessingCommonTag","AutoKillWhenDieVehicle","Uninterferable"],Item:{id:"minecraft:stick",Count:1b,tag:{CustomModelData:20216}}}]}
# ID (int)
    data modify storage asset:mob ID set value 266
# 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":"#B638FF","italic":false}'

# 召喚処理
    execute as @e[type=armor_stand,tag=MobInit,distance=..0.01] run function asset:mob/0266.small_dark_ball/summon/init

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


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

execute if data storage asset:context {id:266} run function asset:mob/0266.small_dark_ball/summon/2.summon


text:
#> asset:mob/0266.small_dark_ball/summon/init
#
#
#
# @within function asset:mob/0266.small_dark_ball/summon/2.summon

#> SpreadLib
    # @private
    #declare tag SpreadMarker

# こっち向く
    execute facing entity @p[gamemode=!spectator,distance=..30] eyes run tp @s ~ ~ ~ ~ ~

# スコア
    scoreboard players set @s 7E.Range 400
    scoreboard players set @s 7E.Speed 5

# 拡散させるEntityを召喚する
    summon marker ~ ~ ~ {Tags:["SpreadMarker"]}

# ステータス設定
    data modify storage lib: Argument.Distance set value 5
    data modify storage lib: Argument.Spread set value 1

# 拡散
    execute facing entity @p[gamemode=!spectator,distance=..30] eyes as @e[type=marker,tag=SpreadMarker,limit=1] run function lib:forward_spreader/circle
    execute facing entity @e[type=marker,tag=SpreadMarker,limit=1] eyes run tp @s ~ ~ ~ ~ ~

# マーカー位置のほうを向く
    kill @e[type=marker,tag=SpreadMarker]


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

# パーティクル
    particle minecraft:witch ~ ~ ~ 0 0 0 0 1 force @a[distance=..30]

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

# 移動
    function asset:mob/0266.small_dark_ball/tick/move


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

execute if data storage asset:context {id:266} run function asset:mob/0266.small_dark_ball/tick/2.tick


text:
#> asset:mob/0266.small_dark_ball/tick/move
#
#
#
# @within function
#   asset:mob/0266.small_dark_ball/tick/2.tick
#   asset:mob/0266.small_dark_ball/tick/move

# 前進
    tp @s ^ ^ ^0.1 ~ ~

# スコア減算
    scoreboard players remove @s 7E.MoveTimesPerTick 1
    scoreboard players remove @s 7E.Range 1

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

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

# 再帰
    execute if entity @s[scores={7E.MoveTimesPerTick=1..,7E.Range=1..}] at @s run function asset:mob/0266.small_dark_ball/tick/move

# キル
    execute if entity @s[scores={7E.Range=0}] run function asset:mob/0266.small_dark_ball/tick/event/kill


text:
#> asset:mob/0266.small_dark_ball/tick/event/hit
#
#
#
# @within function asset:mob/0266.small_dark_ball/tick/move

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

# 消失
    function asset:mob/0266.small_dark_ball/tick/event/kill


text:
#> asset:mob/0266.small_dark_ball/tick/event/kill
#
#
#
# @within function asset:mob/0266.small_dark_ball/tick/**

kill @s
particle minecraft:reverse_portal ~ ~ ~ 0 0 0 0.1 10


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

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


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

execute if data storage asset:context {id:239} run function asset:mob/0239.poltergeist_bow/summon/2.summon


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

#> 定義類はここに
# @within function asset:mob/0276.ksitigarbha_body/**
    scoreboard objectives add 7O.PairID dummy

#> お地蔵さん本体からも参照されるやつ
# @within
#   function asset:mob/0276.ksitigarbha_body/**
#   function asset:mob/0236.ksitigarbha/**
    scoreboard objectives add 7O.SurcideTime dummy


text:
#> asset:mob/0276.ksitigarbha_body/_index.d
# @private

#> PairData
# @within function asset:mob/0276.ksitigarbha_body/**/**
    #declare score_holder $7O.PairID

#> OngaeshiFlag
# @within
#   function asset:mob/0276.ksitigarbha_body/**/**
#   function asset:mob/0236.ksitigarbha/**/**
    #declare tag 7O.Ongaeshied


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

# 元となるMobを召喚する
    summon armor_stand ~ ~ ~ {Tags:["MobInit"],Invisible:1b,Pose:{RightArm:[0f,0f,0f],Head:[0f,0f,0f]},DisabledSlots:4129024,NoBasePlate:0b,NoGravity:1b}
# ID (int)
    data modify storage asset:mob ID set value 276
# Type (string) Wikiを参照
    data modify storage asset:mob Type set value "Object"
# 干渉可能か否か (boolean)
    data modify storage asset:mob Interferable set value false
# 名前 (TextComponentString) (オプション)
    # data modify storage asset:mob Name set value
# 武器
    # メインハンド (Compound(Item)) (オプション)
        data modify storage asset:mob Weapon.Mainhand set value {id:"minecraft:stick",Count:1b,tag:{CustomModelData:20180}}
    # オフハンド (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:quartz_slab",Count:1b}
    # 胴 (Compound(Item)) (オプション)
        # data modify storage asset:mob Armor.Chest set value
    # 脚 (Compound(Item)) (オプション)
        # data modify storage asset:mob Armor.Legs set value
    # 足 (Compound(Item)) (オプション)
        # data modify storage asset:mob Armor.Feet set value
# 防具ドロップ率 ([float, float]) (オプション)
    # data modify storage asset:mob ArmorDropChances set value
# 体力 (double) (オプション)
    # data modify storage asset:mob Health set value
# 攻撃力 (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

# ペアとなるお地蔵さん本体のIDをセット
    scoreboard players operation @e[type=armor_stand,tag=MobInit,distance=..1] 7O.PairID = @e[type=zombie,tag=6K.LinkInit,scores={MobID=236},distance=..1,limit=1] MobUUID

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


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

execute if data storage asset:context {id:276} run function asset:mob/0276.ksitigarbha_body/summon/2.summon


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

# ペアのIDセット
    scoreboard players operation $7O.PairID Temporary = @s 7O.PairID

# ペアのお地蔵さん本体がいない場合いる場所にTP、いない場合キルフラグをつける
    function asset:mob/0276.ksitigarbha_body/tick/2.1.fix_position

# 自分に雪が乗っているか確認して、乗っていなかった場合片割れをキル
    function asset:mob/0276.ksitigarbha_body/tick/2.2.ongaeshi

# キルフラグがついたやつを処理
    function asset:mob/0276.ksitigarbha_body/tick/2.3.garbage_collection

# リセット
    scoreboard players reset $7O.PairID Temporary


text:
#> asset:mob/0276.ksitigarbha_body/tick/2.3.garbage_collection
#
# キル時間を迎えたmobをキル
#
# @within function asset:mob/0276.ksitigarbha_body/tick/2.tick

#> prv
# @private
    #declare score_holder $7O.Gametime

# 死亡時間を迎えたお地蔵さん見た目をkill
    execute store result score $7O.Gametime Temporary run time query gametime
    execute if score $7O.Gametime Temporary >= @s 7O.SurcideTime run kill @s


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

execute if data storage asset:context {id:276} run function asset:mob/0276.ksitigarbha_body/tick/2.tick


text:
#> asset:mob/0276.ksitigarbha_body/tick/2.1.fix_position
#
# ペアのお地蔵さん本体がいない場合いる場所にTP
#
# @within function asset:mob/0276.ksitigarbha_body/tick/2.tick

#> prv
# @private
    #declare tag 7O.ExistPair
    #declare tag 7O.TpTarget
    #declare score_holder $7O.SurcideTime

# ペアが同座標にいるか確認
    execute unless score @s 7O.SurcideTime matches -2147483648..2147483647 as @e[scores={MobID=236},distance=..0.2] if score @s MobUUID = $7O.PairID Temporary run tag @e[tag=this,distance=..0.2] add 7O.ExistPair

# いなかった場合ペアを検索してTP
    execute unless score @s 7O.SurcideTime matches -2147483648..2147483647 unless entity @s[tag=7O.ExistPair] as @e[scores={MobID=236},distance=0.01..] if score @s MobUUID = $7O.PairID Temporary run tag @s add 7O.TpTarget
    execute unless score @s 7O.SurcideTime matches -2147483648..2147483647 unless entity @s[tag=7O.ExistPair] at @e[tag=7O.TpTarget,limit=1] run tp @s ~ ~0.15 ~

# ペアがいない場合自分自身に自殺時間をつける
    execute unless score @s 7O.SurcideTime matches -2147483648..2147483647 at @s unless entity @s[tag=7O.ExistPair] unless entity @e[tag=7O.TpTarget,distance=..0.2,limit=1] store result score $7O.SurcideTime Temporary run time query gametime
    execute if score $7O.SurcideTime Temporary matches -2147483648..2147483647 run scoreboard players add $7O.SurcideTime Temporary 20
    execute if score $7O.SurcideTime Temporary matches -2147483648..2147483647 run scoreboard players operation @s 7O.SurcideTime = $7O.SurcideTime Temporary

# タグリセット
    tag @s[tag=7O.ExistPair] remove 7O.ExistPair
    execute as @s run tag @e[tag=7O.TpTarget,distance=..0.2] remove 7O.TpTarget
    execute if score $7O.SurcideTime Temporary matches -2147483648..2147483647 run scoreboard players reset $7O.SurcideTime Temporary


text:
#> asset:mob/0276.ksitigarbha_body/tick/2.2.ongaeshi
#
# 自分に雪が乗っているか確認して、乗っていなかった場合片割れをキル
#
# @within function asset:mob/0276.ksitigarbha_body/tick/2.tick

#> prv
# @private
    #declare tag 7O.KillTarget
    #declare score_holder $7O.IsSnowRemoved

# 自分に雪が乗っているか確認
    execute unless score @s 7O.SurcideTime matches -2147483648..2147483647 unless data entity @s ArmorItems[3].Count run scoreboard players set $7O.IsSnowRemoved Temporary 1

# 雪が乗っていないならペアを検索してkill
    execute if score $7O.IsSnowRemoved Temporary matches 1 as @e[scores={MobID=236},distance=..0.2] if score @s MobUUID = $7O.PairID Temporary run tag @s add 7O.KillTarget
    execute if score $7O.IsSnowRemoved Temporary matches 1 run kill @e[tag=7O.KillTarget,distance=..0.2,limit=1]

# 雪が乗っていない場合周囲のプレイヤーにバフをかける
    execute if score $7O.IsSnowRemoved Temporary matches 1 run effect give @a[distance=..5] regeneration 5 1
    execute if score $7O.IsSnowRemoved Temporary matches 1 run tellraw @a[distance=..5] [{"translate": "お地蔵さんは雪を払ってもらった恩返しをした","color": "yellow"}]

# 音
    execute if score $7O.IsSnowRemoved Temporary matches 1 run playsound ogg:random.levelup hostile @a[distance=..5] ~ ~ ~ 2 1.5 1

# 恩返しを実行したフラグをつける
    execute if score $7O.IsSnowRemoved Temporary matches 1 run tag @s add 7O.Ongaeshied

# reset
    scoreboard players reset $7O.IsSnowRemoved Temporary


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

# 元となるMobを召喚する
    summon skeleton ~ ~ ~ {Silent:1b,Tags:["MobInit","AlwaysInvisible"],DeathLootTable:"asset:mob/death/0141.honey_archer"}
# ID (int)
    data modify storage asset:mob ID set value 141
# Type (string) Wikiを参照
    data modify storage asset:mob Type set value "Enemy"
# 干渉可能か否か (boolean)
    data modify storage asset:mob Interferable set value true
# 名前 (TextComponentString) (オプション)
    data modify storage asset:mob Name set value '{"text":"ハニーアーチャー","color":"#FFBD24"}'
# 武器
    # メインハンド (Compound(Item)) (オプション)
        data modify storage asset:mob Weapon.Mainhand set value {id:"bow",Count:1b,tag:{CustomModelData:20186}}
    # オフハンド (Compound(Item)) (オプション)
        data modify storage asset:mob Weapon.Offhand set value {id:"minecraft:tipped_arrow",Count:1b,tag:{CustomPotionColor:16760100}}
# 武器ドロップ率 ([float, float]) (オプション)
    data modify storage asset:mob WeaponDropChances set value [0.0f,0.0f]
# 防具
    # 頭 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Head set value {id:"honey_block",Count:1b}
    # 胴 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Chest set value {id:"minecraft:leather_chestplate",Count:1b,tag:{display:{color:16760100}}}
    # 脚 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Legs set value {id:"minecraft:leather_leggings",Count:1b,tag:{display:{color:0}}}
    # 足 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Feet set value {id:"minecraft:leather_boots",Count:1b,tag:{display:{color:16760100}}}
# 防具ドロップ率 ([float, float]) (オプション)
    data modify storage asset:mob ArmorDropChances set value [0.0f,0.0f,0.0f,0.0f]
# 体力 (double) (オプション)
    data modify storage asset:mob Health set value 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/0141.honey_archer/summon/1.trigger
#
# Mob召喚処理の呼び出し時に実行されるfunction
#
# @within tag/function asset:mob/summon

execute if data storage asset:context {id:141} run function asset:mob/0141.honey_archer/summon/2.summon


text:
#> asset:mob/0141.honey_archer/hurt/2.hurt
#
# Mobの被ダメージ時の処理
#
# @within function asset:mob/0141.honey_archer/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/0141.honey_archer/hurt/1.trigger
#
# Mobの被ダメージに実行されるfunction
#
# @within tag/function asset:mob/hurt

execute if data storage asset:context {id:141} run function asset:mob/0141.honey_archer/hurt/2.hurt


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

execute if data storage asset:context {id:141} run function asset:mob/0141.honey_archer/attack/2.attack


text:
#> asset:mob/0141.honey_archer/attack/2.attack
#
# Mobの攻撃時の処理
#
# @within function asset:mob/0141.honey_archer/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] slowness 3 1 true
    effect give @a[tag=Victim,distance=..32] mining_fatigue 3 1 true
    execute if predicate api:global_vars/difficulty/max/normal run effect give @a[tag=Victim,distance=..32] poison 3 1 true
    execute if predicate api:global_vars/difficulty/min/hard run effect give @a[tag=Victim,distance=..32] wither 3 1 true

# 与えるダメージ
    data modify storage lib: Argument.Damage set value 25f
# 属性
    data modify storage lib: Argument.AttackType set value "Magic"
    data modify storage lib: Argument.ElementType set value "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/0153.domination/0.load
#
# MOBに利用するスコアボード等の初期化処理
#
# @within tag/function asset:mob/load

#> 定義類はここに
# @within function asset:mob/0153.domination/**
    scoreboard objectives add 49.PanicTime dummy


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


text:
#> asset:mob/0153.domination/_index.d
# @private

#> tag
# @within function asset:mob/0153.domination/**
    #declare tag 49.Panic


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

# 演出
    playsound minecraft:entity.piglin_brute.death hostile @a ~ ~ ~ 1 0.8


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

execute if data storage asset:context {id:153} run function asset:mob/0153.domination/death/2.death


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

# 元となるMobを召喚する
    summon skeleton ~ ~ ~ {Tags:["MobInit","AlwaysInvisible"],Silent:1b,DeathLootTable:"asset:mob/death/0153.domination"}
# ID (int)
    data modify storage asset:mob ID set value 153
# 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":"#614FFF","underlined":true}'
# 武器
    # メインハンド (Compound(Item)) (オプション)
        data modify storage asset:mob Weapon.Mainhand set value {id:"bow",Count:1b}
    # オフハンド (Compound(Item)) (オプション)
        # data modify storage asset:mob Weapon.Offhand set value
# 武器ドロップ率 ([float, float]) (オプション)
    # data modify storage asset:mob WeaponDropChances set value
# 防具
    # 頭 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Head set value {id:"minecraft:stone",Count:1b,tag:{CustomModelData:20019}}
    # 胴 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Chest set value {id:"minecraft:leather_chestplate",Count:1b,tag:{display:{color:9475112}}}
    # 脚 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Legs set value {id:"minecraft:golden_leggings",Count:1b}
    # 足 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Feet set value {id:"minecraft:leather_boots",Count:1b,tag:{display:{color:9475112}}}
# 防具ドロップ率 ([float, float]) (オプション)
    # data modify storage asset:mob ArmorDropChances set value
# 体力 (double) (オプション)
    data modify storage asset:mob Health set value 2900
# 攻撃力 (double) (オプション)
    data modify storage asset:mob AttackDamage set value 8
# 防御力 (double) (オプション) // 被ダメージがある程度大きい場合1ptにつき0.8%カット、小さい場合1ptにつき約4%カット 20pt以上は頭打ち
    data modify storage asset:mob Defense set value -7
# 特殊防御力 (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 0.4
    # 火倍率 (float) (オプション)
        data modify storage asset:mob Resist.Fire set value 1
    # 水倍率 (float) (オプション)
        data modify storage asset:mob Resist.Water set value 0.6
    # 雷倍率 (float) (オプション)
        data modify storage asset:mob Resist.Thunder set value 0.6

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


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

execute if data storage asset:context {id:153} run function asset:mob/0153.domination/summon/2.summon


text:
#> asset:mob/0153.domination/attack/4.panic
#
#
#
# @within function asset:mob/0153.domination/attack/3.scheduleloop
#> Private
# @private
    #declare score_holder $Random

# 演出
    particle minecraft:electric_spark ~ ~1 ~ 0.4 0.4 0.4 0 2

# スコアをへらす
    scoreboard players remove @a 49.PanicTime 1

# 疑似乱数取得
    execute store result score $Random Temporary run function lib:random/
# ほしい範囲に剰余算
    scoreboard players operation $Random Temporary %= $8 Const
# 向きを適当に変える
    execute if score $Random Temporary matches 0 run tp @s ~ ~ ~ ~2 ~2
    execute if score $Random Temporary matches 1 run tp @s ~ ~ ~ ~-2 ~-2
    execute if score $Random Temporary matches 2 run tp @s ~ ~ ~ ~2 ~-2
    execute if score $Random Temporary matches 3 run tp @s ~ ~ ~ ~-2 ~2
    execute if score $Random Temporary matches 4 run tp @s ~ ~ ~ ~ ~4
    execute if score $Random Temporary matches 5 run tp @s ~ ~ ~ ~ ~-4
    execute if score $Random Temporary matches 6 run tp @s ~ ~ ~ ~-4 ~
    execute if score $Random Temporary matches 7 run tp @s ~ ~ ~ ~4 ~
    scoreboard players reset $Random Temporary

# タグを消す
    execute if score @s 49.PanicTime matches ..0 run tag @s remove 49.Panic
    execute if entity @s[tag=Death] run tag @s remove 49.Panic
    execute if entity @s[tag=Death] run scoreboard players reset @s 49.PanicTime


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

# コマンドを実行する
    execute as @a[tag=49.Panic] at @s run function asset:mob/0153.domination/attack/4.panic
# Scheduleループをする
    execute if entity @a[tag=49.Panic] run schedule function asset:mob/0153.domination/attack/3.scheduleloop 1t


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

execute if data storage asset:context {id:153} run function asset:mob/0153.domination/attack/2.attack


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

# 演出
    execute at @a[tag=Victim] run playsound block.anvil.land hostile @a ~ ~ ~ 1 1.3

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

# プレイヤーをパニック状態にする
# プレイヤーにタグ、スコアを付与する
    tag @p[tag=Victim] add 49.Panic
    scoreboard players set @p[tag=Victim] 49.PanicTime 50
# Scheduleループをする
    schedule function asset:mob/0153.domination/attack/3.scheduleloop 1t


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

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

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


text:
#> asset:mob/0236.ksitigarbha/_index.d
# @private

#> tag
# @within function asset:mob/0236.ksitigarbha/**/**
#
    #declare tag 6K.Body


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

# 祟り
    execute at @a[tag=Killer] run function asset:mob/0236.ksitigarbha/death/2.1.curse

# 首落ちモデルに変更
    execute if entity @a[tag=Killer] as @e[tag=!7O.Ongaeshied,scores={MobID=276},sort=nearest,limit=1] run function asset:mob/0236.ksitigarbha/death/2.2.head_drop


text:
#> asset:mob/0236.ksitigarbha/death/2.1.curse
#
# お地蔵さんの祟り
#
# @input at player
#
# @within function asset:mob/0236.ksitigarbha/death/2.death

# ダメージ設定
    data modify storage lib: Argument.Damage set value 20f
    data modify storage lib: Argument.AttackType set value "Magic"
    data modify storage lib: Argument.DeathMessage set value ['[{"translate": "%1$sはお地蔵さんに祟られた。","with":[{"selector":"@s"}]}]']

# Killerがいた場合Killerとその周囲のFriendにデバフとダメージ
    execute as @e[type=!player,tag=Friend,distance=..5] run function lib:damage/
    execute as @a[gamemode=!creative,tag=Friend,distance=..5] run function lib:damage/
    effect give @e[type=!player,tag=Friend,distance=..5] poison 5 1
    effect give @a[gamemode=!creative,tag=Friend,distance=..5] poison 5 1
    effect give @e[type=!player,tag=Friend,distance=..5] slowness 10 3
    effect give @a[gamemode=!creative,tag=Friend,distance=..5] slowness 10 3
    function lib:damage/reset

# 音
    playsound entity.elder_guardian.curse hostile @a[gamemode=!creative,tag=Friend,distance=..5] ~ ~ ~ 1 1 1

# メッセージ
    execute as @e[gamemode=!creative,tag=Friend,distance=..5] run tellraw @s [{"translate": "%1$sはお地蔵さんを攻撃した罰が当たった。","with":[{"selector":"@s"}]}]


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

execute if data storage asset:context {id:236} run function asset:mob/0236.ksitigarbha/death/2.death


text:
#> asset:mob/0236.ksitigarbha/death/2.2.head_drop
#
# 首落ちモデルに変更し、頭の雪を消す
#
# @within function asset:mob/0236.ksitigarbha/death/2.death

# 首落ちモデルに変更し、頭の雪を消す
    data modify entity @s HandItems[0].tag.CustomModelData set value 20181
    item replace entity @s armor.head with air


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

#> 見た目mobリンク用
# @within
#   function asset:mob/0236.ksitigarbha/summon/2.summon
#   function asset:mob/0276.ksitigarbha_body/summon/2.summon
    #declare tag 6K.LinkInit

# 元となるMobを召喚する
    summon zombie ~ ~ ~ {Tags:["MobInit","AlwaysInvisible","AntiBurn","6K.LinkInit","AlwaysSlowFall"],DeathLootTable:"asset:mob/death/0236.ksitigarbha",Silent:1b,IsBaby:0b}
# ID (int)
    data modify storage asset:mob ID set value 236
# 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
    # 胴 (Compound(Item)) (オプション)
        # data modify storage asset:mob Armor.Chest set value
    # 脚 (Compound(Item)) (オプション)
        # data modify storage asset:mob Armor.Legs set value
    # 足 (Compound(Item)) (オプション)
        # data modify storage asset:mob Armor.Feet set value
# 防具ドロップ率 ([float, float]) (オプション)
    # data modify storage asset:mob ArmorDropChances set value
# 体力 (double) (オプション)
    data modify storage asset:mob Health set value 1
# 攻撃力 (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
# 特殊防御力 (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 2
# ノックバック耐性 (double) (オプション)
    data modify storage asset:mob KnockBackResist set value 1.0
# 属性倍率 // 1.0fで100% 最低でも25%は軽減されずに入る
    # 物理倍率 (float) (オプション)
        data modify storage asset:mob Resist.Physical set value 1.0
    # 魔法倍率 (float) (オプション)
        data modify storage asset:mob Resist.Magic set value 1.0
    # 火倍率 (float) (オプション)
        data modify storage asset:mob Resist.Fire set value 1.0
    # 水倍率 (float) (オプション)
        data modify storage asset:mob Resist.Water set value 1.0
    # 雷倍率 (float) (オプション)
        data modify storage asset:mob Resist.Thunder set value 1.0

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

# 見た目用Mob召喚
    data modify storage api: Argument.ID set value 276
    execute positioned ~ ~0.5 ~ run function api:mob/summon

# リンク用初期化タグリセット
    tag @e[type=zombie,tag=6K.LinkInit,distance=..0.01] remove 6K.LinkInit


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

execute if data storage asset:context {id:236} run function asset:mob/0236.ksitigarbha/summon/2.summon


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

#着地していた場合AlwaysSlowFallを削除
    execute if entity @s[tag=AlwaysSlowFall] if data entity @s {OnGround:1b} run effect clear @s slow_falling
    execute if entity @s[tag=AlwaysSlowFall] if data entity @s {OnGround:1b} run tag @s remove AlwaysSlowFall


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

execute if data storage asset:context {id:236} run function asset:mob/0236.ksitigarbha/tick/2.tick


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

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

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


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

execute if data storage asset:context {id:5} run function asset:mob/0005.thief/summon/2.summon


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

#> 定義類はここに
# @within function asset:mob/0075.watermelon/**
    scoreboard objectives add 23.Tick dummy


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

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

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


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

execute if data storage asset:context {id:75} run function asset:mob/0075.watermelon/summon/2.summon


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

# 前方へ行く処理
    tp @s ^ ^ ^1 ~ ~1

# 演出
    particle dust 0.173 1 0.243 1 ~ ~1.6 ~ 0.4 0.4 0.4 0 2 normal @a

# タイムリミットスコア
    scoreboard players add @s 23.Tick 1

# 炸裂
    execute if score @s 23.Tick matches 20.. run function asset:mob/0075.watermelon/tick/3.explosion
    execute if block ~ ~ ~ #lib:air if entity @a[gamemode=!spectator,distance=..1.5] run function asset:mob/0075.watermelon/tick/3.explosion
    execute unless block ^ ^1 ^1 #lib:no_collision run function asset:mob/0075.watermelon/tick/3.explosion


text:
#> asset:mob/0075.watermelon/tick/3.explosion
#
#
#
# @within function asset:mob/0075.watermelon/tick/2.tick

# 演出
    playsound entity.dolphin.swim hostile @a ~ ~ ~ 2 1 0
    playsound entity.generic.explode hostile @a ~ ~ ~ 1.3 1 0
    particle dust 1 0.141 0.141 3 ~ ~1.6 ~ 2 2 2 0 30 normal @a
    particle explosion ~ ~1.6 ~ 1 1 1 0 20 normal @a

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

# 水属性ダメージ
    # 与えるダメージ
        data modify storage lib: Argument.Damage set value 13.0
    # 第一属性
        data modify storage lib: Argument.AttackType set value "Physical"
    # 第二属性
        data modify storage lib: Argument.ElementType set value "Water"
    # デスログ
        data modify storage lib: Argument.DeathMessage append value '[{"translate": "%1$sは%2$sによってスイカの爆発に巻き込まれた","with":[{"selector":"@s"},{"nbt":"Return.AttackerName","storage":"lib:","interpret":true}]}]'
        data modify storage lib: Argument.DeathMessage append value '[{"translate": "%1$sは%2$sのスイカの爆発の衝撃波に巻き込まれた","with":[{"selector":"@s"},{"nbt":"Return.AttackerName","storage":"lib:","interpret":true}]}]'
    # 補正functionを実行
        function lib:damage/modifier
    # ダメージ対象
        execute as @a[tag=!PlayerShouldInvulnerable,distance=..2.5] run function lib:damage/
    # リセット
        function lib:damage/reset

# 消滅
    kill @s


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

execute if data storage asset:context {id:75} run function asset:mob/0075.watermelon/tick/2.tick


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

#> 定義類はここに
# @within function asset:mob/0282.call_fulstuka/**
    scoreboard objectives add 7U.Tick dummy
    scoreboard objectives add 7U.UserID dummy
    scoreboard objectives add 7U.LifeTime dummy


text:
#> asset:mob/0282.call_fulstuka/_index.d
# @private

#> tag
# @within function asset:mob/0282.call_fulstuka/**
    #declare tag Landing
    #declare tag LandingTarget
    #declare tag 7U.Fulstuka
    #declare tag 7U.SkillGun
    #declare tag 7U.SkillMelee


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

# 元となるMobを召喚する
    summon armor_stand ~ ~ ~ {Tags:["MobInit","7U.Fulstuka"],Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:4144959}
# ID (int)
    data modify storage asset:mob ID set value 282
# Type (string) Wikiを参照
    data modify storage asset:mob Type set value "Friend"
# 干渉可能か否か (boolean)
    data modify storage asset:mob Interferable set value false
# 名前 (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:20194}}
    # オフハンド (Compound(Item)) (オプション)
        data modify storage asset:mob Weapon.Offhand set value {id:"minecraft:stick",Count:1b,tag:{CustomModelData:20196}}
# 防具
    # 頭 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Head set value {id:"minecraft:stick",Count:1b,tag:{CustomModelData:20190}}
    # 胴 (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

# スコアをセットする
    scoreboard players set @e[type=armor_stand,tag=MobInit,distance=..0.01] 7U.Tick -10
# ユーザーID適応
    scoreboard players operation @e[type=armor_stand,tag=MobInit,distance=..0.01] 7U.UserID = @s UserID
# MobInitタグ持ちを対象にして召喚関数呼び出し
    execute as @e[type=armor_stand,tag=MobInit,distance=..0.01] run function asset:mob/common/summon


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

execute if data storage asset:context {id:282} run function asset:mob/0282.call_fulstuka/summon/2.summon


text:
#> asset:mob/0282.call_fulstuka/tick/spreadteleport
#
#
#
# @within function asset:mob/0282.call_fulstuka/tick/**

# 拡散値
    data modify storage lib: Argument.Bounds set value [[2d,2d],[0d,0d],[2d,2d]]
# 拡散する
    function lib:spread_entity/

# 演出
   execute at @s run particle dragon_breath ~ ~1 ~ 0.5 0.5 0.5 0 10 normal @a
   execute at @s run playsound minecraft:entity.enderman.teleport neutral @a ~ ~ ~ 0.7 0.9 0


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

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

# プレイヤーと離れ過ぎたら誰でもいいからプレイヤーにつきまとう
    execute if score @s 7U.Tick matches -5 unless entity @p[distance=..9] at @p run function asset:mob/0282.call_fulstuka/tick/spreadteleport

# 一定時間で帰る
    execute if score @s 7U.Tick matches 0 if score @s 7U.LifeTime matches 600.. run function asset:mob/0282.call_fulstuka/tick/return

# 敵が周囲にいないのに時間が着てしまった場合。スコアを戻す
    execute if score @s 7U.Tick matches 0 unless entity @e[type=#lib:living,tag=Enemy,tag=!Uninterferable,distance=..20] run scoreboard players set @s 7U.Tick -10

# 敵が周囲にいたらスキル選択
    execute if score @s 7U.Tick matches 0 run function asset:mob/0282.call_fulstuka/tick/3.skill_select

# 選択したスキル発動
    execute if score @s 7U.Tick matches 0.. run function asset:mob/0282.call_fulstuka/tick/4.skill_active


text:
#> asset:mob/0282.call_fulstuka/tick/return
#
#
#
# @within function asset:mob/0282.call_fulstuka/tick/2.tick

# 死ぬ
    kill @s

# 演出
    particle portal ~ ~ ~ 0 0 0 2 250 force @a
    particle effect ~ ~ ~ 0 10 0 0.1 250 force @a
    particle cloud ~ ~ ~ 1 1 1 0.1 100
    playsound minecraft:entity.puffer_fish.death hostile @a ~ ~ ~ 1 0


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

execute if data storage asset:context {id:282} run function asset:mob/0282.call_fulstuka/tick/2.tick