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

#> 定義類はここに
# @within function asset:mob/0059.jack_o_lantern/**
    scoreboard objectives add 1N.Tick dummy


text:
#> asset:mob/0059.jack_o_lantern/_index.d
# @private

#> tag
# @within function asset:mob/0059.jack_o_lantern/**
    #declare tag 1N.SkillQuiz
    #declare tag 1N.SkillMeteor
    #declare tag 1N.SkillMissile
    #declare tag 1N.Hurt

repo_name: ProjectTSB/TheSkyBlessing

repo_language: mcfunction

mime_type: text/plain


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

# 演出
    particle dust 1 0.6 0 1 ~ ~1.2 ~ 0.4 0.4 0.4 0 20 normal @a
    particle dust 0.851 0 1 1 ~ ~1.7 ~ 0.6 0.4 0.6 0 20 normal @a
    particle explosion_emitter ~ ~1.5 ~ 0 0 0 0 0
    playsound minecraft:entity.generic.explode hostile @a ~ ~ ~ 1.5 1.5

# 死亡時カボチャ設置
    execute if predicate world_manager:area/02.islands if block ~ ~ ~ #lib:air run summon falling_block ~ ~1.5 ~ {BlockState:{Name:"minecraft:carved_pumpkin"},Time:1,Motion:[0.0,0.7,0.0]}

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


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

execute if data storage asset:context {id:59} run function asset:mob/0059.jack_o_lantern/death/2.death


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

# 元となるMobを召喚する
    summon husk ~ ~-100 ~ {DeathTime:19s,Silent:1b,Tags:["MobInit","AlwaysInvisible","AntiVoid"],DeathLootTable:"asset:mob/death/0059.jack_o_lantern"}
# ID (int)
    data modify storage asset:mob ID set value 59
# Type (string) Wikiを参照
    data modify storage asset:mob Type set value "Enemy.Boss"
# 干渉可能か否か (boolean)
    data modify storage asset:mob Interferable set value true
# 名前 (TextComponentString) (オプション)
    data modify storage asset:mob Name set value '{"text":"ジャック・オ・ランタン","color":"#FFAA00"}'
# 武器
    # メインハンド (Compound(Item)) (オプション)
        # data modify storage asset:mob Weapon.Mainhand set value
    # オフハンド (Compound(Item)) (オプション)
        # data modify storage asset:mob Weapon.Offhand set value
# 武器ドロップ率 ([float, float]) (オプション)
    # data modify storage asset:mob WeaponDropChances set value
# 防具
    # 頭 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Head set value {id:"minecraft:carved_pumpkin",Count:1b,tag:{CustomModelData:20016}}
    # 胴 (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 5000
# 攻撃力 (double) (オプション)
    data modify storage asset:mob AttackDamage set value 3.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.25
# 索敵範囲 (double) (オプション)
    data modify storage asset:mob FollowRange set value 32
# ノックバック耐性 (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
    # 魔法倍率 (float) (オプション)
        data modify storage asset:mob Resist.Magic set value 0.7
    # 火倍率 (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 0.8

# 演出
    playsound minecraft:entity.enderman.teleport hostile @a ~ ~ ~ 1.5 1
    playsound minecraft:entity.zombie_villager.converted hostile @a ~ ~ ~ 1.5 1.5
    particle minecraft:large_smoke ~ ~1 ~ 0.3 0.5 0.3 0 50

# 上に持ってくる
    execute positioned ~ ~-100 ~ run tp @e[type=husk,tag=MobInit,distance=..0.01] ~ ~100 ~

# プレイヤーをみる
    tp @e[type=husk,tag=MobInit,distance=..0.01] ~ ~ ~ facing entity @p

# スコアをセットする
    scoreboard players set @e[type=husk,tag=MobInit,distance=..0.01] 1N.Tick -30

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


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

execute if data storage asset:context {id:59} run function asset:mob/0059.jack_o_lantern/summon/2.summon


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

# タグをつける
    tag @s add 1N.Hurt
# 演出
    playsound entity.witch.celebrate hostile @a ~ ~ ~ 0.8 1.8 0


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

execute if data storage asset:context {id:59} run function asset:mob/0059.jack_o_lantern/hurt/2.hurt


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

execute if data storage asset:context {id:59} run function asset:mob/0059.jack_o_lantern/attack/2.attack


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

# 演出
    playsound entity.witch.celebrate hostile @a ~ ~ ~ 0.8 1.8 0
    execute at @p[tag=Victim,distance=..6] run particle dust 1 0.651 0 1 ~ ~1.2 ~ 0.4 0.4 0.4 0 15 normal @a
    execute at @p[tag=Victim,distance=..6] run particle dust 0.851 0 1 1 ~ ~1.2 ~ 0.4 0.4 0.4 0 15 normal @a
    particle flame ~ ~1.5 ~ 0.5 0.5 0.5 0 10 normal @a

# 不運を付与
    effect give @p[tag=Victim,distance=..6] unluck 15 2 false

# 火属性ダメージ
    # 与えるダメージ
        data modify storage lib: Argument.Damage set value 14.0
    # 第一属性
        data modify storage lib: Argument.AttackType set value "Magic"
    # 第二属性
        data modify storage lib: Argument.ElementType set value "Fire"
# デスログ
    data modify storage lib: Argument.DeathMessage append value '[{"translate": "%1$sは%2$sによりカボチャの怨念を受け、燃え尽きた","with":[{"selector":"@s"},{"nbt":"Return.AttackerName","storage":"lib:","interpret":true}]}]'
    data modify storage lib: Argument.DeathMessage append value '[{"translate": "%1$sは%2$sにより呪いの炎を受けた","with":[{"selector":"@s"},{"nbt":"Return.AttackerName","storage":"lib:","interpret":true}]}]'
# 補正functionを実行
    function lib:damage/modifier
# ダメージ対象
    execute as @p[tag=Victim,distance=..6] run function lib:damage/
# リセット
    function lib:damage/reset


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

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

# 常時耐性
    effect give @s resistance 9 1 true

# ハメ対策
    execute unless block ~ ~0.5 ~ #lib:no_collision at @p run function asset:mob/0059.jack_o_lantern/tick/spread_tp

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

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

# その後発動するスキル
# プレイヤーが周囲にいたらスキル選択
    execute if score @s 1N.Tick matches 0 run function asset:mob/0059.jack_o_lantern/tick/3.skill_select

# 選択したスキル発動
    execute if score @s 1N.Tick matches 0.. run function asset:mob/0059.jack_o_lantern/tick/4.skill_active

# Hurt時に付くタグを消す
    tag @s[tag=1N.Hurt] remove 1N.Hurt


text:
#> asset:mob/0059.jack_o_lantern/tick/spread_tp
#
#
#
# @within function asset:mob/0059.jack_o_lantern/tick/**

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

# プレイヤーを見る
    execute at @s run tp @s ~ ~ ~ facing entity @p

# 演出
    execute at @s run playsound minecraft:entity.enderman.teleport hostile @a ~ ~ ~ 1.5 1
    execute at @s run playsound minecraft:entity.zombie_villager.converted hostile @a ~ ~ ~ 1.5 1.5
    execute at @s run particle minecraft:large_smoke ~ ~1 ~ 0.3 0.5 0.3 0 50


text:
#> asset:mob/0059.jack_o_lantern/tick/dummy_kill
#
# 1tick送らせないと困るので
#
# @within function asset:mob/0059.jack_o_lantern/tick/**

# 殺す
    tp @e[type=husk,scores={MobID=224}] ~ -100 ~


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

execute if data storage asset:context {id:59} run function asset:mob/0059.jack_o_lantern/tick/2.tick


text:
#> asset:mob/0059.jack_o_lantern/tick/4.skill_active
#
#
#
# @within function asset:mob/0059.jack_o_lantern/tick/2.tick

# クイズ
    execute if entity @s[tag=1N.SkillQuiz] run function asset:mob/0059.jack_o_lantern/tick/1.skill_quiz/1.quiz

# メテオ
    execute if entity @s[tag=1N.SkillMeteor] run function asset:mob/0059.jack_o_lantern/tick/2.skill_meteor/1.meteor

# ミサイル
    execute if entity @s[tag=1N.SkillMissile] run function asset:mob/0059.jack_o_lantern/tick/3.missile/1.missile


text:
#> asset:mob/0059.jack_o_lantern/tick/3.skill_select
#
# スキル設定
#
# @within function asset:mob/0059.jack_o_lantern/tick/2.tick

#> private
# @private
    #declare score_holder $Random

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

# デバッグのコマンド
    #scoreboard players set $Random Temporary 0

# スキル選択
    execute if score $Random Temporary matches 0 run tag @s add 1N.SkillQuiz
    execute if score $Random Temporary matches 1 run tag @s add 1N.SkillMeteor
    execute if score $Random Temporary matches 2 run tag @s add 1N.SkillMissile
# リセット
    scoreboard players reset $Random Temporary


text:
#> asset:mob/0059.jack_o_lantern/tick/reset
#
# 共通リセット処理
#
# @within function asset:mob/0059.jack_o_lantern/tick/**

# タグ消す
    tag @s remove 1N.SkillMeteor
    tag @s remove 1N.SkillMissile
    tag @s remove 1N.SkillQuiz

# スコアを変える
    scoreboard players set @s 1N.Tick -100

# 確率でテレポ
    execute if predicate lib:random_pass_per/20 at @p run function asset:mob/0059.jack_o_lantern/tick/spread_tp


text:
#> asset:mob/0059.jack_o_lantern/tick/1.skill_quiz/4.quiz_clear
#
#
#
# @within function asset:mob/0059.jack_o_lantern/tick/1.skill_quiz/1.quiz

# 1tick後に消す
    schedule function asset:mob/0059.jack_o_lantern/tick/dummy_kill 1t replace
# 演出
    playsound ogg:mob.strider.retreat5 hostile @a ~ ~ ~ 1 1.5
    playsound minecraft:entity.generic.explode hostile @a ~ ~ ~ 1 2
    particle minecraft:end_rod ~ ~1 ~ 0 0 0 0.7 100
# 割合ダメージ
    execute store result storage lib: Argument.Damage float 0.08 run function api:mob/get_max_health
# 属性
    data modify storage lib: Argument.AttackType set value "Physical"
    data modify storage lib: Argument.FixedDamage set value 1b
# 補正
    function lib:damage/modifier
# ダメージ
    function lib:damage/
# リセット
    function lib:damage/reset

# クイズエンド
    function asset:mob/0059.jack_o_lantern/tick/1.skill_quiz/quiz_end


text:
#> asset:mob/0059.jack_o_lantern/tick/1.skill_quiz/2.summon
#
#
#
# @within function asset:mob/0059.jack_o_lantern/tick/1.skill_quiz/1.quiz

# 召喚いっぱい
    function asset:mob/0059.jack_o_lantern/tick/1.skill_quiz/dummy_summon
    function asset:mob/0059.jack_o_lantern/tick/1.skill_quiz/dummy_summon
    function asset:mob/0059.jack_o_lantern/tick/1.skill_quiz/dummy_summon
    function asset:mob/0059.jack_o_lantern/tick/1.skill_quiz/dummy_summon
    function asset:mob/0059.jack_o_lantern/tick/1.skill_quiz/dummy_summon
    function asset:mob/0059.jack_o_lantern/tick/1.skill_quiz/dummy_summon
    function asset:mob/0059.jack_o_lantern/tick/1.skill_quiz/dummy_summon

# パーティクル
    execute at @e[type=#lib:living,scores={MobID=224},distance=..30,limit=7] run particle minecraft:large_smoke ~ ~1 ~ 0.3 0.5 0.3 0 20


text:
#> asset:mob/0059.jack_o_lantern/tick/1.skill_quiz/quiz_end
#
#
#
# @within function asset:mob/0059.jack_o_lantern/tick/1.skill_quiz/**

# 頭を変える
    item replace entity @s armor.head with carved_pumpkin{CustomModelData:20016}

# 共通リセット処理
    function asset:mob/0059.jack_o_lantern/tick/reset


text:
#> asset:mob/0059.jack_o_lantern/tick/1.skill_quiz/1.quiz
#
# クイズスキル
#
# @within function asset:mob/0059.jack_o_lantern/tick/4.skill_active

# 自分を透明化する
    execute if score @s 1N.Tick matches 0 run item replace entity @s armor.head with stone{CustomModelData:20019}
    execute if score @s 1N.Tick matches 0 run effect give @s slowness 12 100 true
# 自分を何処かにテレポートさせる
    execute if score @s 1N.Tick matches 20 run function asset:mob/0059.jack_o_lantern/tick/spread_tp

# 眷属をいっぱいだす
    execute if score @s 1N.Tick matches 20 run function asset:mob/0059.jack_o_lantern/tick/1.skill_quiz/2.summon

# 自分を表示する
    execute if score @s 1N.Tick matches 20 run item replace entity @s armor.head with carved_pumpkin{CustomModelData:20016}

# hurt時につく被ダメタグがあった場合、クイズに正解して、このスキルを終える
    execute if score @s 1N.Tick matches 20..159 if entity @s[tag=1N.Hurt] run function asset:mob/0059.jack_o_lantern/tick/1.skill_quiz/4.quiz_clear

# クイズに失敗した場合、発光する
    execute if score @s 1N.Tick matches 160 run function asset:mob/0059.jack_o_lantern/tick/1.skill_quiz/3.glow

    execute if score @s 1N.Tick matches 260.. run function asset:mob/0059.jack_o_lantern/tick/1.skill_quiz/quiz_end


text:
#> asset:mob/0059.jack_o_lantern/tick/1.skill_quiz/dummy_summon
#
#  周囲に偽物を召喚
#
# @within function asset:mob/0059.jack_o_lantern/tick/1.skill_quiz/**

# 召喚
    data modify storage api: Argument.ID set value 224
    function api:mob/summon
# 拡散値
    data modify storage lib: Argument.Bounds set value [[8d,8d],[0d,0d],[8d,8d]]
# 拡散する
    execute as @e[type=#lib:living,scores={MobID=224},distance=..3,sort=nearest,limit=1] run function lib:spread_entity/


text:
#> asset:mob/0059.jack_o_lantern/tick/1.skill_quiz/3.glow
#
#
#
# @within function asset:mob/0059.jack_o_lantern/tick/1.skill_quiz/1.quiz

# 発光
    item replace entity @s armor.head with jack_o_lantern{CustomModelData:20017}
    effect clear @s slowness
    effect give @s speed 5 6 true

# 演出
    playsound minecraft:entity.wither.hurt hostile @a ~ ~ ~ 0.5 1.5
    particle minecraft:witch ~ ~1 ~ 0 0 0 0.7 100
    playsound minecraft:entity.witch.celebrate hostile @a ~ ~ ~ 1 2

# キル
    tp @e[type=husk,scores={MobID=224},distance=..30,limit=8] ~ -100 ~


text:
#> asset:mob/0059.jack_o_lantern/tick/3.missile/5.suicide
#
#
#
# @within function asset:mob/0059.jack_o_lantern/tick/3.missile/3.tackle

# ぶつかる
    tp @s ~ ~ ~

# 演出
    playsound ogg:mob.strider.retreat5 hostile @a ~ ~ ~ 1 1.5
    particle minecraft:end_rod ~ ~1 ~ 0 0 0 0.7 100
    playsound minecraft:entity.generic.explode hostile @a
# 割合ダメージ
    execute store result storage lib: Argument.Damage float 0.04 run function api:mob/get_max_health
# 属性
    data modify storage lib: Argument.AttackType set value "Physical"
    data modify storage lib: Argument.FixedDamage set value 1b
# 補正
    function lib:damage/modifier
# ダメージ
    function lib:damage/
# リセット
    function lib:damage/reset


text:
#> asset:mob/0059.jack_o_lantern/tick/3.missile/3.tackle
#
#
#
# @within function
#        asset:mob/0059.jack_o_lantern/tick/3.missile/1.missile
#        asset:mob/0059.jack_o_lantern/tick/3.missile/3.tackle

#> tag
# @private
    #declare tag Landing
    #declare tag LandingTarget

# 検知
    execute if entity @p[gamemode=!spectator,distance=..2] run tag @s add Landing
    execute unless block ^ ^ ^1 #lib:no_collision run tag @s add Landing

# 着弾時に発動
    execute if entity @s[tag=Landing] if entity @p[gamemode=!spectator,distance=..2] run function asset:mob/0059.jack_o_lantern/tick/3.missile/4.damage
    execute if entity @s[tag=Landing] unless entity @p[gamemode=!spectator,distance=..2] run function asset:mob/0059.jack_o_lantern/tick/3.missile/5.suicide

# パーティクル
    particle explosion ~ ~ ~ 0 0 0 0 0

# 再起
    execute positioned ^ ^ ^1 if entity @s[tag=!Landing,distance=..15] run function asset:mob/0059.jack_o_lantern/tick/3.missile/3.tackle


text:
#> asset:mob/0059.jack_o_lantern/tick/3.missile/1.missile
#
#
#
# @within function asset:mob/0059.jack_o_lantern/tick/4.skill_active

#> Private
# @private
    #declare tag Landing

# 4tickおきに実行するやつ
# 実行時間を移す
    scoreboard players operation $4tInterval Temporary = @s 1N.Tick
# 4tickおきに実行
    scoreboard players operation $4tInterval Temporary %= $4 Const
    execute if score $4tInterval Temporary matches 0 if score @s 1N.Tick matches ..80 run playsound minecraft:block.note_block.bit hostile @a[distance=..32] ~ ~ ~ 3 1.334840 1
# リセット
    scoreboard players reset $4tInterval

# NoAI化
    execute if score @s 1N.Tick matches 0 run data modify entity @s NoAI set value 1b

# プレイヤーに警告パーティクル
    execute if score @s 1N.Tick matches ..80 anchored eyes positioned ^ ^ ^ run function asset:mob/0059.jack_o_lantern/tick/3.missile/2.check
# プレイヤーを見る
    execute if score @s 1N.Tick matches ..80 run tp @s ~ ~ ~ facing entity @p[tag=!PlayerShouldInvulnerable]

# 突進
    execute if score @s 1N.Tick matches 81 anchored eyes positioned ^ ^ ^ if entity @p[distance=..15] run function asset:mob/0059.jack_o_lantern/tick/3.missile/3.tackle
# タグ消し
    execute if score @s 1N.Tick matches ..81 run tag @s[tag=Landing] remove Landing
# NoAIを戻す
    execute if score @s 1N.Tick matches 81 run data modify entity @s NoAI set value 0b

# リセット
    execute if score @s 1N.Tick matches 100 run function asset:mob/0059.jack_o_lantern/tick/reset


text:
#> asset:mob/0059.jack_o_lantern/tick/3.missile/4.damage
#
#
#
# @within function asset:mob/0059.jack_o_lantern/tick/3.missile/3.tackle

# ぶつかる
    tp @s ~ ~ ~

# 着弾の演出
    playsound minecraft:entity.generic.explode hostile @a
    particle explosion ~ ~ ~ 1 1 1 0 10

# 火属性ダメージ
    # 与えるダメージ
        data modify storage lib: Argument.Damage set value 9.0
    # 第一属性
        data modify storage lib: Argument.AttackType set value "Magic"
    # 第二属性
        data modify storage lib: Argument.ElementType set value "Fire"
# デスログ
    data modify storage lib: Argument.DeathMessage append value '[{"translate": "%1$sは%2$sによりカボチャの怨念を受け、燃え尽きた","with":[{"selector":"@s"},{"nbt":"Return.AttackerName","storage":"lib:","interpret":true}]}]'
    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=!PlayerShouldInvulnerable,distance=..2] run function lib:damage/
# リセット
    function lib:damage/reset


text:
#> asset:mob/0059.jack_o_lantern/tick/3.missile/2.check
#
#
#
# @within function
#        asset:mob/0059.jack_o_lantern/tick/3.missile/1.missile
#        asset:mob/0059.jack_o_lantern/tick/3.missile/2.check

#> tag
# @private
    #declare tag Landing
    #declare tag LandingTarget

# レーザー投射
    execute if entity @p[gamemode=!spectator,distance=..2] run tag @s add Landing
    execute unless block ^ ^ ^1 #lib:no_collision run tag @s add Landing

# 演出
    execute if entity @p[gamemode=!spectator,distance=..2] run playsound block.note_block.bit hostile @p ~ ~ ~ 0.5 2
    particle minecraft:dust 0.58 0 0 0.75 ~ ~ ~ 0 0 0 0 1

# 再起
    execute positioned ^ ^ ^1 if entity @s[tag=!Landing,distance=..15] run function asset:mob/0059.jack_o_lantern/tick/3.missile/2.check


text:
#> asset:mob/0059.jack_o_lantern/tick/2.skill_meteor/summon
#
#
#
# @within function asset:mob/0059.jack_o_lantern/tick/2.skill_meteor/1.meteor

# 演出
    playsound minecraft:entity.generic.explode hostile @a ~ ~ ~ 1 2

# 召喚
    data modify storage api: Argument.ID set value 54
    function api:mob/summon
# 拡散値
    data modify storage lib: Argument.Bounds set value [[7d,7d],[0d,0d],[7d,7d]]

# 拡散する
    execute as @e[type=#lib:living,scores={MobID=54},distance=..3,sort=nearest,limit=1] run function lib:spread_entity/


text:
#> asset:mob/0059.jack_o_lantern/tick/2.skill_meteor/1.meteor
#
# メテオ（メテオとは言っていない）
#
# @within function asset:mob/0059.jack_o_lantern/tick/4.skill_active

# 自分を超鈍足にする
    execute if score @s 1N.Tick matches 0 run effect give @s slowness 12 100 true

# 演出
    execute if score @s 1N.Tick matches 0 run playsound minecraft:block.beacon.activate hostile @a ~ ~ ~ 1.5 1.5
    execute if score @s 1N.Tick matches 0 run playsound minecraft:entity.witch.celebrate hostile @a ~ ~ ~ 1 2
    execute if score @s 1N.Tick matches 0..20 run particle dust 1 0 0 1 ~ ~1.2 ~ 0.8 0.8 0.8 0 20 normal @a
# 眷属をいっぱいだす
    execute if score @s 1N.Tick matches 20 positioned ~ ~7 ~ run function asset:mob/0059.jack_o_lantern/tick/2.skill_meteor/summon
    execute if score @s 1N.Tick matches 30 positioned ~ ~7 ~ run function asset:mob/0059.jack_o_lantern/tick/2.skill_meteor/summon
    execute if score @s 1N.Tick matches 40 positioned ~ ~7 ~ run function asset:mob/0059.jack_o_lantern/tick/2.skill_meteor/summon
    execute if score @s 1N.Tick matches 60 positioned ~ ~7 ~ run function asset:mob/0059.jack_o_lantern/tick/2.skill_meteor/summon
    execute if score @s 1N.Tick matches 80 positioned ~ ~7 ~ run function asset:mob/0059.jack_o_lantern/tick/2.skill_meteor/summon

# リセット
    execute if score @s 1N.Tick matches 200.. run function asset:mob/0059.jack_o_lantern/tick/reset


text:
#> asset:mob/0205.skull_soldier/_index.d
# @private

#>
# @within function asset:mob/0205.skull_soldier/**
    #declare tag 5P.Melee
    #declare tag 5P.Ranged


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

# 元となるMobを召喚する
    summon skeleton ~ ~ ~ {Tags:["MobInit","5P.Melee"],DeathLootTable:"asset:mob/death/0205.skull_soldier"}
# ID (int)
    data modify storage asset:mob ID set value 205
# Type (string) Wikiを参照
    data modify storage asset:mob Type set value "Enemy"
# 干渉可能か否か (boolean)
    data modify storage asset:mob Interferable set value 1b
# 名前 (TextComponentString) (オプション)
    data modify storage asset:mob Name set value '{"text":"スカルソルジャー"}'
# 武器
    # メインハンド (Compound(Item)) (オプション)
        data modify storage asset:mob Weapon.Mainhand set value {id:"minecraft:stone_axe",Count:1b}
# 武器ドロップ率 ([float, float]) (オプション)
    data modify storage asset:mob WeaponDropChances set value [0.0f,0.0f]
# 防具
    # 頭 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Head set value {id:"minecraft:player_head",Count:1b,tag:{SkullOwner:{Id:[I;1076876798,-181975559,-1455522315,1508980085],Properties:{textures:[{Value:"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYTI0MGYyYjFhNjgxMzY2NDU2YmY5ODkyZDFjMGY0NzMzOTliOTZiYTkwYmNhYjY4ZTc3YjY4NDg0NjllYjU3In19fQ=="}]}}}}
# 体力 (double) (オプション)
    data modify storage asset:mob Health set value 100
# 攻撃力 (double) (オプション) 数値が異常なのは石の斧を持ったときを基準としているため
    data modify storage asset:mob AttackDamage set value -4.0d
# 防御力 (double) (オプション) // 被ダメージがある程度大きい場合1ptにつき0.8%カット、小さい場合1ptにつき約4%カット 20pt以上は頭打ち
    data modify storage asset:mob Defense set value 0.0d
# 属性倍率 // 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=skeleton,tag=MobInit,distance=..0.01] run function asset:mob/common/summon


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

execute if data storage asset:context {id:205} run function asset:mob/0205.skull_soldier/summon/2.summon


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

# 離れてる時は弓
    execute if entity @s[tag=5P.Melee] unless entity @a[distance=..5] run function asset:mob/0205.skull_soldier/tick/event/switch_ranged
    tag @s[tag=5P.Ranged] remove 5P.Melee

# 近い時は近接武器
    execute if entity @s[tag=5P.Ranged] if entity @a[distance=..5] run function asset:mob/0205.skull_soldier/tick/event/switch_melee
    tag @s[tag=5P.Melee] remove 5P.Ranged


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

execute if data storage asset:context {id:205} run function asset:mob/0205.skull_soldier/tick/2.tick


text:
#> asset:mob/0205.skull_soldier/tick/event/switch_melee
#
# 近接への持ち替え操作
#
# @within function asset:mob/0205.skull_soldier/tick/2.tick

# VFX
    playsound minecraft:item.armor.equip_iron hostile @a ~ ~ ~ 1.5 1

# 持ち替え
    item replace entity @s weapon.mainhand with minecraft:stone_axe

# リセット
    tag @s add 5P.Melee


text:
#> asset:mob/0205.skull_soldier/tick/event/switch_ranged
#
# 弓への持ち替え
#
# @within function asset:mob/0205.skull_soldier/tick/2.tick

# VFX
    playsound minecraft:item.armor.equip_generic hostile @a ~ ~ ~ 1.5 1

# 持ち替え
    item replace entity @s weapon.mainhand with minecraft:bow

# リセット
    tag @s add 5P.Ranged


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

#> 定義類はここに
# @within function asset:mob/0076.golden_watermelon_bomber/**
    scoreboard objectives add 24.Tick dummy


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

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

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


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

execute if data storage asset:context {id:76} run function asset:mob/0076.golden_watermelon_bomber/death/2.death


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

# 元となるMobを召喚する
    summon zombie ~ ~ ~ {Silent:1b,Tags:["MobInit","AlwaysInvisible"],DeathLootTable:"asset:mob/death/0076.golden_watermelon_bomber"}
# ID (int)
    data modify storage asset:mob ID set value 76
# Type (string) Wikiを参照
    data modify storage asset:mob Type set value "Enemy"
# 干渉可能か否か (boolean)
    data modify storage asset:mob Interferable set value true
# 名前 (TextComponentString) (オプション)
    data modify storage asset:mob Name set value '[{"text":"ゴー","color":"#59FF75"},{"text":"ルデンスイカボ","color":"#F0FF1F"},{"text":"マー","color":"#59FF75"}]'
# 武器
    # メインハンド (Compound(Item)) (オプション)
        data modify storage asset:mob Weapon.Mainhand set value {id:"minecraft:melon",Count:1b,tag:{Enchantments:[{}],CustomModelData:20018}}
    # オフハンド (Compound(Item)) (オプション)
        # data modify storage asset:mob Weapon.Offhand set value
# 武器ドロップ率 ([float, float]) (オプション)
    data modify storage asset:mob WeaponDropChances set value [0.0f,0.0f]
# 防具
    # 頭 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Head set value {id:"minecraft:melon",Count:1b,tag:{Enchantments:[{}]}}
    # 胴 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Chest set value {id:"minecraft:leather_chestplate",Count:1b,tag:{display:{color:15793951}}}
    # 脚 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Legs set value {id:"minecraft:leather_leggings",Count:1b,tag:{display:{color:15793951}}}
    # 足 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Feet set value {id:"minecraft:leather_boots",Count:1b,tag:{display:{color:15793951}}}
# 防具ドロップ率 ([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 2999
# 攻撃力 (double) (オプション)
    data modify storage asset:mob AttackDamage set value 15.0
# 防御力 (double) (オプション) // 被ダメージがある程度大きい場合1ptにつき0.8%カット、小さい場合1ptにつき約4%カット 20pt以上は頭打ち
    #data modify storage asset:mob Defense set value
# 特殊防御力 (double) (オプション) // 4pointにつきダメージを大きく減らす
    # data modify storage asset:mob SpecialDefense set value
# 移動速度 (double) (オプション)
    data modify storage asset:mob Speed set value 0.28
# 索敵範囲 (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.0
    # 魔法倍率 (float) (オプション)
        data modify storage asset:mob Resist.Magic set value 0.9
    # 火倍率 (float) (オプション)
        data modify storage asset:mob Resist.Fire set value 1.0
    # 水倍率 (float) (オプション)
        data modify storage asset:mob Resist.Water set value 0.75
    # 雷倍率 (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/0076.golden_watermelon_bomber/summon/1.trigger
#
# Mob召喚処理の呼び出し時に実行されるfunction
#
# @within tag/function asset:mob/summon

execute if data storage asset:context {id:76} run function asset:mob/0076.golden_watermelon_bomber/summon/2.summon


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

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


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

execute if data storage asset:context {id:76} run function asset:mob/0076.golden_watermelon_bomber/hurt/2.hurt


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

execute if data storage asset:context {id:76} run function asset:mob/0076.golden_watermelon_bomber/attack/2.attack


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

# 水属性ダメージ
    data modify storage lib: Argument.Damage set value 17f
    data modify storage lib: Argument.AttackType set value "Physical"
    data modify storage lib: Argument.ElementType set value "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 @p[tag=Victim,distance=..6] run function lib:damage/
# リセット
    function lib:damage/reset

#　雷属性ダメージ
    data modify storage lib: Argument.Damage set value 17f
    data modify storage lib: Argument.AttackType set value "Physical"
    data modify storage lib: Argument.ElementType set value "Thunder"
# デスログ
    data modify storage lib: Argument.DeathMessage append value '[{"translate": "%1$sは%2$sの金色の輝きにより心停止した","with":[{"selector":"@s"},{"nbt":"Return.AttackerName","storage":"lib:","interpret":true}]}]'
    data modify storage lib: Argument.DeathMessage append value '[{"translate": "%1$sは%2$sのスイカの電撃により死亡した","with":[{"selector":"@s"},{"nbt":"Return.AttackerName","storage":"lib:","interpret":true}]}]'
# 補正functionを実行
    function lib:damage/modifier
# ダメージ対象
    execute as @p[tag=Victim,distance=..6] run function lib:damage/
# リセット
    function lib:damage/reset

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


text:
#> asset:mob/0076.golden_watermelon_bomber/tick/3.throw_watermelon
#
#
#
# @within function asset:mob/0076.golden_watermelon_bomber/tick/2.tick

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

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


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

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

# スイカ投げ
    execute if score @s 24.Tick matches 80.. run function asset:mob/0076.golden_watermelon_bomber/tick/3.throw_watermelon


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

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


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

#> 定義類はここに
# @within function asset:mob/0287.burning_stomper/**
    scoreboard objectives add 7Z.MoveTime dummy


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

# 元となるMobを召喚する
    summon wither_skeleton ~ ~ ~ {CustomNameVisible:0b,Tags:["MobInit","AlwaysInvisible","AntiFallDamage"],DeathLootTable:"asset:mob/death/0287.burning_stomper"}
# ID (int)
    data modify storage asset:mob ID set value 287
# Type (string) Wikiを参照
    data modify storage asset:mob Type set value "Enemy"
# 干渉可能か否か (boolean)
    data modify storage asset:mob Interferable set value True
# 名前 (TextComponentString) (オプション)
    data modify storage asset:mob Name set value '{"text":"バーニングストンパー","color":"red"}'
# 防具
    # 頭 (Compound(Item)) (オプション)
        #data modify storage asset:mob Armor.Head set value {id:"minecraft:player_head",Count:1b,tag:{SkullOwner:{Id:[I;-672593164,1073039141,-1481174912,860659466],Properties:{textures:[{Value:"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvM2JjYmJmOTRkNjAzNzQzYTFlNzE0NzAyNmUxYzEyNDBiZDk4ZmU4N2NjNGVmMDRkY2FiNTFhMzFjMzA5MTRmZCJ9fX0="}]}}}}
        data modify storage asset:mob Armor.Head set value {id:"minecraft:stick",Count:1b,tag:{CustomModelData:20209}}
    # 脚 (Compound(Item)) (オプション)
        #data modify storage asset:mob Armor.Legs set value {id:"minecraft:leather_leggings",Count:1b,tag:{display:{color:7015424}}}
    # 足 (Compound(Item)) (オプション)
        #data modify storage asset:mob Armor.Feet set value {id:"minecraft:diamond_boots",Count:1b,tag:{Enchantments:[{id:"minecraft:blast_protection",lvl:1s}]}}
# 体力 (double) (オプション)
    data modify storage asset:mob Health set value 3000
# 攻撃力 (double) (オプション)
    data modify storage asset:mob AttackDamage set value 0
# 防御力 (double) (オプション) // 被ダメージがある程度大きい場合1ptにつき0.8%カット、小さい場合1ptにつき約4%カット 20pt以上は頭打ち
    # data modify storage asset:mob Defense set value
# 特殊防御力 (double) (オプション) // 4pointにつきダメージを大きく減らす
    # data modify storage asset:mob SpecialDefense set value
# 移動速度 (double) (オプション)
    data modify storage asset:mob Speed set value 0
# 索敵範囲 (double) (オプション)
    #data modify storage asset:mob FollowRange set value 0
# ノックバック耐性 (double) (オプション)
    data modify storage asset:mob KnockBackResist set value 1
# 属性倍率 // 1.0fで100% 最低でも25%は軽減されずに入る
    # 物理倍率 (float) (オプション)
        data modify storage asset:mob Resist.Physical set value 0.8f
    # 魔法倍率 (float) (オプション)
        data modify storage asset:mob Resist.Magic set value 1.0f
    # 火倍率 (float) (オプション)
        data modify storage asset:mob Resist.Fire set value 0.8f
    # 水倍率 (float) (オプション)
        data modify storage asset:mob Resist.Water set value 1.0f
    # 雷倍率 (float) (オプション)
        data modify storage asset:mob Resist.Thunder set value 1.0f

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


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

execute if data storage asset:context {id:287} run function asset:mob/0287.burning_stomper/summon/2.summon


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

# スコア加算
    execute if entity @a[gamemode=!spectator,distance=..30] run scoreboard players add @s 7Z.MoveTime 1

# 付近に対象がいないならスコアリセット
    execute unless entity @a[gamemode=!spectator,distance=..30] run scoreboard players reset @s 7Z.MoveTime

# 飛び上がる
    execute if entity @s[scores={7Z.MoveTime=30},nbt={OnGround:1b}] run function asset:mob/0287.burning_stomper/tick/event/jump

# 着地で爆発
    execute if entity @s[scores={7Z.MoveTime=31..},nbt={OnGround:1b}] run function asset:mob/0287.burning_stomper/tick/event/stomp

# 首固定
    data modify entity @s Rotation[1] set value 0.0f


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

execute if data storage asset:context {id:287} run function asset:mob/0287.burning_stomper/tick/2.tick


text:
#> asset:mob/0287.burning_stomper/tick/event/shape
#
#
#
# @within function asset:mob/0287.burning_stomper/tick/event/stomp

# [ImportKey]: NobwRALgngDgpmAXGAxgSwE4oDYIDRgCuhaAJkmAEwAsA7AMwBGArHIwLTUCGAjAJycADMPZcUKHuzgA2UgDMAHMyaNBcFGAIA7LgFsEyQGGKAAkqwMLhj0BnJOBQB7QlohIaBFHFdwM9sABuXNiEBuAAHkiCBFBRAL5xBNakaIR2iPQENhBWbojRYHDY2GgwNgY8wkmOORAGBWg2AKLFpeVNAI6EwdhQAMqWXuSIcsHlCQC6QA_3
# 円 2
    particle flame ~0 ~ ~-3 0 0 0 1 0 force @a[distance=..30]
    particle flame ~0.77646 ~ ~-2.89778 0 0 0 1 0 force @a[distance=..30]
    particle flame ~1.5 ~ ~-2.59808 0 0 0 1 0 force @a[distance=..30]
    particle flame ~2.12132 ~ ~-2.12132 0 0 0 1 0 force @a[distance=..30]
    particle flame ~2.59808 ~ ~-1.5 0 0 0 1 0 force @a[distance=..30]
    particle flame ~2.89778 ~ ~-0.77646 0 0 0 1 0 force @a[distance=..30]
    particle flame ~3 ~ ~0 0 0 0 1 0 force @a[distance=..30]
    particle flame ~2.89778 ~ ~0.77646 0 0 0 1 0 force @a[distance=..30]
    particle flame ~2.59808 ~ ~1.5 0 0 0 1 0 force @a[distance=..30]
    particle flame ~2.12132 ~ ~2.12132 0 0 0 1 0 force @a[distance=..30]
    particle flame ~1.5 ~ ~2.59808 0 0 0 1 0 force @a[distance=..30]
    particle flame ~0.77646 ~ ~2.89778 0 0 0 1 0 force @a[distance=..30]
    particle flame ~0 ~ ~3 0 0 0 1 0 force @a[distance=..30]
    particle flame ~-0.77646 ~ ~2.89778 0 0 0 1 0 force @a[distance=..30]
    particle flame ~-1.5 ~ ~2.59808 0 0 0 1 0 force @a[distance=..30]
    particle flame ~-2.12132 ~ ~2.12132 0 0 0 1 0 force @a[distance=..30]
    particle flame ~-2.59808 ~ ~1.5 0 0 0 1 0 force @a[distance=..30]
    particle flame ~-2.89778 ~ ~0.77646 0 0 0 1 0 force @a[distance=..30]
    particle flame ~-3 ~ ~0 0 0 0 1 0 force @a[distance=..30]
    particle flame ~-2.89778 ~ ~-0.77646 0 0 0 1 0 force @a[distance=..30]
    particle flame ~-2.59808 ~ ~-1.5 0 0 0 1 0 force @a[distance=..30]
    particle flame ~-2.12132 ~ ~-2.12132 0 0 0 1 0 force @a[distance=..30]
    particle flame ~-1.5 ~ ~-2.59808 0 0 0 1 0 force @a[distance=..30]
    particle flame ~-0.77646 ~ ~-2.89778 0 0 0 1 0 force @a[distance=..30]

# Crit
    particle crit ~0 ~ ~-3 0 1 0 2 0 normal @a
    particle crit ~0.77646 ~ ~-2.89778 0 1 0 2 0 normal @a
    particle crit ~1.5 ~ ~-2.59808 0 1 0 2 0 normal @a
    particle crit ~2.12132 ~ ~-2.12132 0 1 0 2 0 normal @a
    particle crit ~2.59808 ~ ~-1.5 0 1 0 2 0 normal @a
    particle crit ~2.89778 ~ ~-0.77646 0 1 0 2 0 normal @a
    particle crit ~3 ~ ~0 0 1 0 2 0 normal @a
    particle crit ~2.89778 ~ ~0.77646 0 1 0 2 0 normal @a
    particle crit ~2.59808 ~ ~1.5 0 1 0 2 0 normal @a
    particle crit ~2.12132 ~ ~2.12132 0 1 0 2 0 normal @a
    particle crit ~1.5 ~ ~2.59808 0 1 0 2 0 normal @a
    particle crit ~0.77646 ~ ~2.89778 0 1 0 2 0 normal @a
    particle crit ~0 ~ ~3 0 1 0 2 0 normal @a
    particle crit ~-0.77646 ~ ~2.89778 0 1 0 2 0 normal @a
    particle crit ~-1.5 ~ ~2.59808 0 1 0 2 0 normal @a
    particle crit ~-2.12132 ~ ~2.12132 0 1 0 2 0 normal @a
    particle crit ~-2.59808 ~ ~1.5 0 1 0 2 0 normal @a
    particle crit ~-2.89778 ~ ~0.77646 0 1 0 2 0 normal @a
    particle crit ~-3 ~ ~0 0 1 0 2 0 normal @a
    particle crit ~-2.89778 ~ ~-0.77646 0 1 0 2 0 normal @a
    particle crit ~-2.59808 ~ ~-1.5 0 1 0 2 0 normal @a
    particle crit ~-2.12132 ~ ~-2.12132 0 1 0 2 0 normal @a
    particle crit ~-1.5 ~ ~-2.59808 0 1 0 2 0 normal @a
    particle crit ~-0.77646 ~ ~-2.89778 0 1 0 2 0 normal @a

# Crit
    particle crit ~0 ~ ~-3 0 1 0 1 0 normal @a
    particle crit ~0.77646 ~ ~-2.89778 0 1 0 1 0 normal @a
    particle crit ~1.5 ~ ~-2.59808 0 1 0 1 0 normal @a
    particle crit ~2.12132 ~ ~-2.12132 0 1 0 1 0 normal @a
    particle crit ~2.59808 ~ ~-1.5 0 1 0 1 0 normal @a
    particle crit ~2.89778 ~ ~-0.77646 0 1 0 1 0 normal @a
    particle crit ~3 ~ ~0 0 1 0 1 0 normal @a
    particle crit ~2.89778 ~ ~0.77646 0 1 0 1 0 normal @a
    particle crit ~2.59808 ~ ~1.5 0 1 0 1 0 normal @a
    particle crit ~2.12132 ~ ~2.12132 0 1 0 1 0 normal @a
    particle crit ~1.5 ~ ~2.59808 0 1 0 1 0 normal @a
    particle crit ~0.77646 ~ ~2.89778 0 1 0 1 0 normal @a
    particle crit ~0 ~ ~3 0 1 0 1 0 normal @a
    particle crit ~-0.77646 ~ ~2.89778 0 1 0 1 0 normal @a
    particle crit ~-1.5 ~ ~2.59808 0 1 0 1 0 normal @a
    particle crit ~-2.12132 ~ ~2.12132 0 1 0 1 0 normal @a
    particle crit ~-2.59808 ~ ~1.5 0 1 0 1 0 normal @a
    particle crit ~-2.89778 ~ ~0.77646 0 1 0 1 0 normal @a
    particle crit ~-3 ~ ~0 0 1 0 1 0 normal @a
    particle crit ~-2.89778 ~ ~-0.77646 0 1 0 1 0 normal @a
    particle crit ~-2.59808 ~ ~-1.5 0 1 0 1 0 normal @a
    particle crit ~-2.12132 ~ ~-2.12132 0 1 0 1 0 normal @a
    particle crit ~-1.5 ~ ~-2.59808 0 1 0 1 0 normal @a
    particle crit ~-0.77646 ~ ~-2.89778 0 1 0 1 0 normal @a


text:
#> asset:mob/0287.burning_stomper/tick/event/jump
#
#
#
# @within function asset:mob/0287.burning_stomper/tick/2.tick

# 演出
    particle minecraft:poof ~ ~0.2 ~ 0.25 0 0.25 0 20
    playsound minecraft:entity.iron_golem.attack hostile @a ~ ~ ~ 0.7 1
    playsound minecraft:entity.goat.long_jump hostile @a ~ ~ ~ 0.7 1

# こっちを向く
    execute facing entity @p eyes run tp @s ~ ~ ~ ~ ~

# モデル変更
    item replace entity @s armor.head with stick{CustomModelData:20210}

# こっちに対してMotionで飛ぶ 近いやつを優先
    execute if entity @a[distance=14..30] run data modify storage lib: Argument.VectorMagnitude set value 2
    execute if entity @a[distance=7..14] run data modify storage lib: Argument.VectorMagnitude set value 1.5
    execute if entity @a[distance=..7] run data modify storage lib: Argument.VectorMagnitude set value 0.7
    execute facing entity @p feet run function lib:motion/
    data remove storage lib: Argument

# 最後に上方向に飛ぶ
    data modify entity @s Motion[1] set value 1.0d


text:
#> asset:mob/0287.burning_stomper/tick/event/stomp
#
# 踏みつけ攻撃
#
# @within function asset:mob/0287.burning_stomper/tick/2.tick

# 演出
    playsound minecraft:entity.iron_golem.hurt hostile @a ~ ~ ~ 1 1.5
    playsound minecraft:entity.zombie.break_wooden_door hostile @a ~ ~ ~ 0.5 2
    playsound minecraft:entity.blaze.shoot hostile @a ~ ~ ~ 1 1
    scoreboard players reset @s 7Z.MoveTime

# モデル変更
    item replace entity @s armor.head with stick{CustomModelData:20209}

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

# 補正実行
    function lib:damage/modifier

# ダメージを与える
    execute as @a[tag=!PlayerShouldInvulnerable,distance=..3] run function lib:damage/

# 吹き飛ばし
    execute at @a[gamemode=!spectator,distance=..3] run summon area_effect_cloud ~ ~ ~ {Radius:0.1f,Duration:6,Age:4,Effects:[{Id:25,Amplifier:20b,Duration:7,ShowParticles:0b}]}

# リセット
    function lib:damage/reset

# パーティクル
    particle smoke ~ ~0.1 ~ 1 0.1 1 0.02 100
    particle dust 1 0.6 0 1.5 ~ ~0.1 ~ 1.2 0.1 1.2 0.02 50
    particle dust 1 0.435 0 1.5 ~ ~0.1 ~ 1.2 0.1 1.2 0.02 50
    execute positioned ~ ~0.1 ~ run function asset:mob/0287.burning_stomper/tick/event/shape


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

#> 定義類はここに
# @within function asset:mob/1008.yellow_star/**
    scoreboard objectives add S0.Time dummy


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

# Scheduleloop
    execute if entity @a[scores={S0.Time=1..}] run schedule function asset:mob/1008.yellow_star/attack/3.scheduleloop 1t replace


text:
#> asset:mob/1008.yellow_star/_index.d
# @private

#> tag
# @within function asset:mob/1008.yellow_star/**
    #declare


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

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


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

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


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

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

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


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

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


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

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

# スコアをへらす
    scoreboard players remove @s S0.Time 1

# 途中で死んだ時
    execute if entity @s[tag=Death] run scoreboard players set @s S0.Time 0

# リセットへ
    execute if score @s S0.Time matches 0 run function asset:mob/1008.yellow_star/attack/5.reset


text:
#> asset:mob/1008.yellow_star/attack/5.reset
#
#
#
# @within function asset:mob/1008.yellow_star/attack/4.def_down

# 演出
    playsound entity.generic.extinguish_fire player @a ~ ~ ~ 1 1

# 消す
    attribute @s minecraft:generic.armor modifier remove 1-0-2-0-3f000000000

# リセット
    scoreboard players reset @s S0.Time


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

# 効果
    execute as @a[scores={S0.Time=1..}] at @s run function asset:mob/1008.yellow_star/attack/4.def_down

# Scheduleloop
    execute if entity @a[scores={S0.Time=1..}] run schedule function asset:mob/1008.yellow_star/attack/3.scheduleloop 1t replace


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

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


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

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

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

# スコア設定
    scoreboard players set @p[tag=Victim] S0.Time 100

# Scheduleする
    schedule function asset:mob/1008.yellow_star/attack/3.scheduleloop 1t replace


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

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


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

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


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

# 演出
    playsound minecraft:block.glass.break hostile @a ~ ~ ~ 1.2 1.3 0
    particle falling_dust diamond_block ~ ~1 ~ 0.5 0.5 0.5 1 12 normal @a
    particle falling_dust snow_block ~ ~1 ~ 0.5 0.5 0.5 1 12 normal @a


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

execute if data storage asset:context {id:49} run function asset:mob/0049.ice_obstructor/death/2.death


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

# 元となるMobを召喚する
    summon skeleton ~ ~ ~ {Silent:1b,Tags:["MobInit","AlwaysInvisible"],DeathLootTable:"asset:mob/death/0049.ice_obstructor"}
# ID (int)
    data modify storage asset:mob ID set value 49
# Type (string) Wikiを参照
    data modify storage asset:mob Type set value "Enemy"
# 干渉可能か否か (boolean)
    data modify storage asset:mob Interferable set value true
# 名前 (TextComponentString) (オプション)
    data modify storage asset:mob Name set value '{"text":"氷妨者","color":"aqua"}'
# 武器
    # メインハンド (Compound(Item)) (オプション)
    data modify storage asset:mob Weapon.Mainhand set value {id:"minecraft:bow",Count:1b,tag:{Enchantments:[{id:"minecraft:power",lvl:3s}]}}
    # オフハンド (Compound(Item)) (オプション)
    data modify storage asset:mob Weapon.Offhand set value {id:"minecraft:tipped_arrow",Count:1b,tag:{CustomPotionColor:9892351}}
# 武器ドロップ率 ([float, float]) (オプション)
    # data modify storage asset:mob WeaponDropChances set value
# 防具
    # 頭 (Compound(Item)) (オプション)
    data modify storage asset:mob Armor.Head set value {id:"ice",Count:1b}
    # 胴 (Compound(Item)) (オプション)
    data modify storage asset:mob Armor.Chest set value {id:"minecraft:leather_chestplate",Count:1b,tag:{display:{color:9892351}}}
    # 脚 (Compound(Item)) (オプション)
    data modify storage asset:mob Armor.Legs set value {id:"minecraft:leather_leggings",Count:1b,tag:{display:{color:9892351}}}
    # 足 (Compound(Item)) (オプション)
    data modify storage asset:mob Armor.Feet set value {id:"minecraft:leather_boots",Count:1b,tag:{display:{color:9892351},Enchantments:[{id:"minecraft:frost_walker",lvl:1s}]}}
# 防具ドロップ率 ([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 6
# 防御力 (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.25
# 索敵範囲 (double) (オプション)
    data modify storage asset:mob FollowRange set value 15
# ノックバック耐性 (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.75
    # 魔法倍率 (float) (オプション)
    data modify storage asset:mob Resist.Magic set value 1.0
    # 火倍率 (float) (オプション)
    data modify storage asset:mob Resist.Fire set value 1.0
    # 水倍率 (float) (オプション)
    data modify storage asset:mob Resist.Water set value 0.25
    # 雷倍率 (float) (オプション)
    data modify storage asset:mob Resist.Thunder set value 0.75

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


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

execute if data storage asset:context {id:49} run function asset:mob/0049.ice_obstructor/summon/2.summon


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

# 演出
    playsound minecraft:block.glass.break hostile @a ~ ~ ~ 1.2 1.3 0
    particle block ice ~ ~1 ~ 0.5 0.5 0.5 1 20 normal @a


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

execute if data storage asset:context {id:49} run function asset:mob/0049.ice_obstructor/hurt/2.hurt


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

execute if data storage asset:context {id:49} run function asset:mob/0049.ice_obstructor/attack/2.attack


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

# 演出
    execute at @p[tag=Victim,distance=..32] run particle minecraft:falling_dust diamond_block ~ ~1.75 ~ 0.4 0.4 0.4 1 15
    execute at @p[tag=Victim,distance=..32] run playsound minecraft:block.glass.break hostile @a ~ ~ ~ 0.8 1.3 0

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

# 引数の設定
    # 与えるダメージ
        data modify storage lib: Argument.Damage set value 3f
    # 第一属性
        data modify storage lib: Argument.AttackType set value "Physical"
    # 第二属性
        data modify storage lib: Argument.ElementType set value "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 at @p[tag=Victim,distance=..32] as @a[tag=!PlayerShouldInvulnerable,distance=..2.5] run function lib:damage/

# 粉雪を設置
    execute at @p[gamemode=survival,tag=Victim,distance=..32] run fill ~ ~ ~ ~ ~ ~ powder_snow replace #lib:air
# リセット
    function lib:damage/reset


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

# 下が氷なら加速
    execute if block ~ ~-1 ~ #ice run effect give @s speed 1 3 true


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

execute if data storage asset:context {id:49} run function asset:mob/0049.ice_obstructor/tick/2.tick


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

#> 定義類はここに
# @within function asset:mob/0073.clutch_spider/**
    scoreboard objectives add 21.Time dummy


text:
#> asset:mob/0073.clutch_spider/_index.d
# @private

#> tag
# @within function asset:mob/0073.clutch_spider/**/**
    #declare tag Landing


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

# 元となるMobを召喚する
    summon spider ~ ~ ~ {Tags:["MobInit"],DeathLootTable:"asset:mob/death/0073.clutch_spider"}
# ID (int)
    data modify storage asset:mob ID set value 73
# Type (string) Wikiを参照
    data modify storage asset:mob Type set value "Enemy"
# 干渉可能か否か (boolean)
    data modify storage asset:mob Interferable set value true
# 名前 (TextComponentString) (オプション)
    data modify storage asset:mob Name set value '{"text":"クラッチスパイダー","color":"black"}'
# 武器
    # メインハンド (Compound(Item)) (オプション)
        data modify storage asset:mob Weapon.Mainhand set value {id:"minecraft:stick",Count:1b,tag:{Enchantments:[{id:"minecraft:knockback",lvl:3s}]}}
    # オフハンド (Compound(Item)) (オプション)
        # data modify storage asset:mob Weapon.Offhand set value
# 武器ドロップ率 ([float, float]) (オプション)
    # data modify storage asset:mob WeaponDropChances set value
# 防具
    # 頭 (Compound(Item)) (オプション)
        # data modify storage asset:mob Armor.Head set value
    # 胴 (Compound(Item)) (オプション)
        # data modify storage asset:mob Armor.Chest set value
    # 脚 (Compound(Item)) (オプション)
        # data modify storage asset:mob Armor.Legs set value
    # 足 (Compound(Item)) (オプション)
        # data modify storage asset:mob Armor.Feet set value
# 防具ドロップ率 ([float, float]) (オプション)
    # data modify storage asset:mob ArmorDropChances set value
# 体力 (double) (オプション)
    data modify storage asset:mob Health set value 1000
# 攻撃力 (double) (オプション)
    data modify storage asset:mob AttackDamage set value 5
# 防御力 (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 0
# 移動速度 (double) (オプション)
    # data modify storage asset:mob Speed set value
# 索敵範囲 (double) (オプション)
    # data modify storage asset:mob FollowRange set value
# ノックバック耐性 (double) (オプション)
    # data modify storage asset:mob KnockBackResist set value
# 属性倍率 // 1.0fで100% 最低でも25%は軽減されずに入る
    # 物理倍率 (float) (オプション)
        data modify storage asset:mob Resist.Physical set value 1
    # 魔法倍率 (float) (オプション)
        data modify storage asset:mob Resist.Magic set value 1
    # 火倍率 (float) (オプション)
        data modify storage asset:mob Resist.Fire set value 1
    # 水倍率 (float) (オプション)
        data modify storage asset:mob Resist.Water set value 0.85
    # 雷倍率 (float) (オプション)
        data modify storage asset:mob Resist.Thunder set value 1

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


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

execute if data storage asset:context {id:73} run function asset:mob/0073.clutch_spider/summon/2.summon


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

execute if data storage asset:context {id:73} run function asset:mob/0073.clutch_spider/attack/2.attack


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

# 演出
    execute at @p[tag=Victim] run particle poof ~ ~ ~ 0 0 0 0.2 10 normal
# 効果
    effect give @p[tag=Victim] slowness 7 0
# ダメージ設定
    # 与えるダメージ
        data modify storage lib: Argument.Damage set value 7.0f
    # 第一属性
        data modify storage lib: Argument.AttackType set value "Physical"
    # 第二属性
        data modify storage lib: Argument.ElementType set value "Water"
    # ダメージ
        function lib:damage/modifier
        execute as @p[tag=Victim] run function lib:damage/
# リセット
    function lib:damage/reset


text:
#> asset:mob/0073.clutch_spider/tick/2.2.landing
#
# 着弾時
#
# @within function asset:mob/0073.clutch_spider/tick/2.3.shot

# 移動する
    tp @s ^ ^ ^-0.5 facing entity @p[gamemode=!spectator] eyes

# 演出
    playsound entity.enderman.teleport hostile @a ~ ~ ~


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

# スコアを増やす
    execute positioned ^ ^ ^10 if entity @p[distance=..10] run scoreboard players add @s 21.Time 1

# 発動
    execute if score @s 21.Time matches 80.. if entity @a[distance=..30] positioned ~ ~0.5 ~ run function asset:mob/0073.clutch_spider/tick/2.1.skill


text:
#> asset:mob/0073.clutch_spider/tick/2.1.skill
#
# 発動時
#
# @within function asset:mob/0073.clutch_spider/tick/2.tick

# 演出
    playsound minecraft:entity.arrow.shoot hostile @a ~ ~ ~ 1 1

# 発動する
    function asset:mob/0073.clutch_spider/tick/2.3.shot

# タグを消す
    tag @s remove Landing

# スコアを戻す
    scoreboard players reset @s 21.Time


text:
#> asset:mob/0073.clutch_spider/tick/2.3.shot
#
#
#
# @within function
#   asset:mob/0073.clutch_spider/tick/2.1.skill
#   asset:mob/0073.clutch_spider/tick/2.3.shot

# 着弾検知
    execute unless block ^ ^ ^2 #lib:no_collision run tag @s add Landing
    execute if entity @p[gamemode=!spectator,distance=..3] run tag @s add Landing
    execute if entity @p[gamemode=!spectator,distance=..3] at @p[gamemode=!spectator,distance=..3] run particle cloud ~ ~1.5 ~ 0.6 0.4 0.6 0 30 normal @a

# 演出
    particle dust 1 1 1 1 ~ ~ ~ 0 0 0 0 6

# 着弾
    execute if entity @s[tag=Landing] run function asset:mob/0073.clutch_spider/tick/2.2.landing

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


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

execute if data storage asset:context {id:73} run function asset:mob/0073.clutch_spider/tick/2.tick


text:
#> asset:mob/0273.hell_blade/attack
#
#
#
# @within function asset:mob/0273.hell_blade/tick/2.tick

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

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

# 補正実行
    function lib:damage/modifier

# 一番最寄りのプレイヤー（今回は接触したやつのハズ）のHurtTimeを取る
    execute as @p run function api:data_get/hurt_time

# HurTime取ってそれが0ならダメージを与える
    execute if data storage api: {HurtTime:0s} as @p run function lib:damage/

# リセット
    function lib:damage/reset


text:
#> asset:mob/0273.hell_blade/break
#
#
#
# @within function asset:mob/0273.hell_blade/tick/2.tick

# 松明即壊す
    execute at @s if block ~ ~ ~ #lib:torches run setblock ~ ~ ~ air destroy

# はしご即壊す
    execute at @s if block ~ ~ ~ ladder run setblock ~ ~ ~ air destroy

# 石なら丸石に
    execute if block ~ ~ ~ stone run setblock ~ ~ ~ cobblestone

# 石レンガならヒビ入りに
    execute if block ~ ~ ~ stone_bricks run setblock ~ ~ ~ cracked_stone_bricks

# 羊毛なら0275.destroyed_blockを召喚
    execute if block ~ ~ ~ #wool unless entity @e[scores={MobID=275},distance=..0.01] run function asset:mob/0273.hell_blade/summon_crack


text:
#> asset:mob/0273.hell_blade/fall
#
#
#
# @within function asset:mob/0273.hell_blade/tick/2.tick

# Motionを消す
    data modify entity @s Motion[0] set value 0.0d
    data modify entity @s Motion[2] set value 0.0d

# NoAIを外す
    data modify entity @s NoAI set value 0b

# 向きを召喚時に生成したものにする
    data modify entity @s Rotation set value [0.0f,0.0f]
    execute store result entity @s Rotation[0] float 1 run scoreboard players get @s 7L.FallingRotation

# ブロックに着地したら
    execute if data entity @s {OnGround:1b} run function asset:mob/0273.hell_blade/landing


text:
#> asset:mob/0273.hell_blade/landing
#
#
#
# @within function asset:mob/0273.hell_blade/fall

# フルブロック未満のと着地したらブロックのど真ん中に補正する
    execute unless block ~ ~ ~ #lib:no_collision align xyz positioned ~0.5 ~1 ~0.5 rotated ~ 0 run tp @s ^ ^ ^-0.125 ~ ~
    execute if block ~ ~ ~ #lib:no_collision align xyz positioned ~0.5 ~ ~0.5 rotated ~ 0 run tp @s ^ ^ ^-0.125 ~ ~

# NoAIをつける
    data modify entity @s NoAI set value 1b

# モデル適応
    data modify entity @s ArmorItems[3].tag.CustomModelData set value 20160

# 落下タグを消す
    tag @s remove 7L.Fall

# 曲がるタグを消す
    tag @s remove 7L.RotateLeft
    tag @s remove 7L.RotateRight

# 面のタグをつける
    tag @s remove 7L.FaceWallUp
    tag @s remove 7L.FaceWallDown
    tag @s remove 7L.FaceCeiling
    tag @s add 7L.FaceFloor

# スコアを初期化
    scoreboard players set @s 7L.Timer 1


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

#> 定義類はここに
# @within function asset:mob/0273.hell_blade/**
    scoreboard objectives add 7L.Timer dummy
    scoreboard objectives add 7L.RotateTimer dummy
    scoreboard objectives add 7L.FallingRotation dummy


text:
#> asset:mob/0273.hell_blade/summon_crack
#
# ひび割れを召喚
#
# @within function asset:mob/0273.hell_blade/break

data modify storage api: Argument.ID set value 275
function api:mob/summon


text:
#> asset:mob/0273.hell_blade/_index.d
# @private

#> tag
# @within function asset:mob/0273.hell_blade/**
    #declare tag 7L.Init
    #declare tag 7L.FaceCheck
    #declare tag 7L.FaceFloor
    #declare tag 7L.FaceWallUp
    #declare tag 7L.FaceWallDown
    #declare tag 7L.FaceCeiling
    #declare tag 7L.Fall
    #declare tag 7L.RotateLeft
    #declare tag 7L.RotateRight


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

# SFX
    playsound entity.generic.explode hostile @a ~ ~ ~ 1 1
    particle explosion ~ ~ ~ .5 .5 .5 1 4 normal @a


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

execute if data storage asset:context {id:273} run function asset:mob/0273.hell_blade/death/2.death


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

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

# MobInitタグ持ちを対象にしてinit処理を行う
    execute as @e[type=zombie,tag=MobInit,distance=..0.01] run function asset:mob/0273.hell_blade/summon/init

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


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

execute if data storage asset:context {id:273} run function asset:mob/0273.hell_blade/summon/2.summon


text:
#> asset:mob/0273.hell_blade/summon/init
#
# 召喚時のinit処理
#
# @within function asset:mob/0273.hell_blade/summon/2.summon

# 向きを90°刻みのランダムに
    # 疑似乱数取得
        execute store result score $Random Temporary run function lib:random/
    # ほしい範囲に剰余算
        scoreboard players operation $Random Temporary %= $4 Const
    # 角度を出す
        scoreboard players set @s 7L.FallingRotation 90
        scoreboard players operation @s 7L.FallingRotation *= $Random Temporary
    # リセット
        scoreboard players reset $Random Temporary

# 落下のタグを付ける
    tag @s add 7L.Fall

# スコアリセット
    scoreboard players set @s 7L.RotateTimer 0


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

# SFX
    playsound entity.iron_golem.damage hostile @a ~ ~ ~ 1 2
    particle dust 1 0.933 0 1 ~ ~ ~ .5 .5 .5 0 10 normal @a


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

execute if data storage asset:context {id:273} run function asset:mob/0273.hell_blade/hurt/2.hurt


text:
#> asset:mob/0273.hell_blade/move/face/floor
#
#
#
# @within function asset:mob/0273.hell_blade/move/face/

# 位置調整
    execute at @s[tag=7L.FaceWallUp] run tp @s ~ ~.125 ~
    execute at @s[tag=7L.FaceWallDown] run tp @s ^ ^-.125 ^-.25

# モデル適応
    data modify entity @s ArmorItems[3].tag.CustomModelData set value 20160

# タグ更新
    tag @s remove 7L.FaceCheck
    tag @s remove 7L.FaceWallUp
    tag @s remove 7L.FaceWallDown
    tag @s add 7L.FaceFloor


text:
#> asset:mob/0273.hell_blade/move/face/ceiling
#
#
#
# @within function asset:mob/0273.hell_blade/move/face/

# 位置調整
    execute at @s[tag=7L.FaceWallUp] run tp @s ^ ^-.875 ^.25
    execute at @s[tag=7L.FaceWallDown] run tp @s ~ ~-1.125 ~

# モデル適応
    data modify entity @s ArmorItems[3].tag.CustomModelData set value 20165

# タグ更新
    tag @s remove 7L.FaceCheck
    tag @s remove 7L.FaceWallUp
    tag @s remove 7L.FaceWallDown
    tag @s add 7L.FaceCeiling


text:
#> asset:mob/0273.hell_blade/move/face/wall/down
#
#
#
# @within function asset:mob/0273.hell_blade/move/face/

# 位置調整
    execute at @s[tag=7L.FaceFloor] run tp @s ^ ^.125 ^.25
    execute at @s[tag=7L.FaceCeiling] run tp @s ^ ^1.125 ^

# モデル適応
    data modify entity @s ArmorItems[3].tag.CustomModelData set value 20164

# タグ更新
    tag @s remove 7L.FaceCheck
    tag @s remove 7L.FaceFloor
    tag @s remove 7L.FaceCeiling
    tag @s add 7L.FaceWallDown


text:
#> asset:mob/0273.hell_blade/move/face/wall/up
#
#
#
# @within function asset:mob/0273.hell_blade/move/face/
#execute at @s run summon armor_stand ~ ~ ~ {NoGravity:1b}
# 位置調整
    execute at @s[tag=7L.FaceFloor] run tp @s ~ ~-.125 ~
    execute at @s[tag=7L.FaceCeiling] run tp @s ^ ^.875 ^-.25

# モデル適応
    data modify entity @s ArmorItems[3].tag.CustomModelData set value 20162

# タグ更新
    tag @s remove 7L.FaceCheck
    tag @s remove 7L.FaceFloor
    tag @s remove 7L.FaceCeiling
    tag @s add 7L.FaceWallUp


text:
#> asset:mob/0273.hell_blade/unstuck/floor
#
#
#
# @within function asset:mob/0273.hell_blade/unstuck/

# ブロックが無かったら落下タグをつけてOnGroundを0bに
    execute if block ~ ~-1 ~ #asset:mob/0273.hell_blade/throughable run tag @s add 7L.Fall
    execute if block ~ ~-1 ~ #asset:mob/0273.hell_blade/throughable run data modify entity @s OnGround set value 0b


text:
#> asset:mob/0273.hell_blade/unstuck/ceiling
#
#
#
# @within function asset:mob/0273.hell_blade/unstuck/

# ブロックが無かったら落下タグをつけてOnGroundを0bに
    execute if block ~ ~1 ~ #asset:mob/0273.hell_blade/throughable run tag @s add 7L.Fall
    execute if block ~ ~1 ~ #asset:mob/0273.hell_blade/throughable run data modify entity @s OnGround set value 0b

# 滑って落ちる
    execute if block ~ ~1 ~ #asset:mob/0273.hell_blade/slip run tag @s add 7L.Fall
    execute if block ~ ~1 ~ #asset:mob/0273.hell_blade/slip run data modify entity @s OnGround set value 0b

# 下にプレイヤーがいたら落下
    execute at @s align xyz positioned ~ ~-6 ~ if entity @a[dy=6] run function asset:mob/0273.hell_blade/unstuck/drop


text:
#> asset:mob/0273.hell_blade/unstuck/drop
#
#
#
# @within function asset:mob/0273.hell_blade/unstuck/ceiling

# 落下タグをつけてOnGroundを0bに
    tag @s add 7L.Fall
    data modify entity @s OnGround set value 0b

# SFX
    playsound block.note_block.bit hostile @a ~ ~ ~ 1 2


text:
#> asset:mob/0273.hell_blade/unstuck/wall/down
#
#
#
# @within function asset:mob/0273.hell_blade/unstuck/

# ブロックが無かったら落下タグをつけてOnGroundを0bに
    execute if block ^ ^ ^-1 #asset:mob/0273.hell_blade/throughable run tag @s add 7L.Fall
    execute if block ^ ^ ^-1 #asset:mob/0273.hell_blade/throughable run data modify entity @s OnGround set value 0b


text:
#> asset:mob/0273.hell_blade/unstuck/wall/up
#
#
#
# @within function asset:mob/0273.hell_blade/unstuck/

# ブロックが無かったら落下タグをつけてOnGroundを0bに
    execute if block ^ ^ ^1 #asset:mob/0273.hell_blade/throughable run tag @s add 7L.Fall
    execute if block ^ ^ ^1 #asset:mob/0273.hell_blade/throughable run data modify entity @s OnGround set value 0b

# 滑って落ちる
    execute if block ^ ^ ^1 #asset:mob/0273.hell_blade/slip at @s run tp @s ^ ^ ^-.125
    execute if block ^ ^ ^1 #asset:mob/0273.hell_blade/slip run tag @s add 7L.Fall
    execute if block ^ ^ ^1 #asset:mob/0273.hell_blade/slip run data modify entity @s OnGround set value 0b


text:
#> asset:mob/0273.hell_blade/chase/check
#
#
#
# @within function asset:mob/0273.hell_blade/move/

# south
    execute as @s[y_rotation=0] unless entity @p[dx=0,dy=4] positioned ~-16 ~ ~ if entity @a[dx=15,dy=4] run function asset:mob/0273.hell_blade/chase/right
    execute as @s[y_rotation=0] unless entity @p[dx=0,dy=4] positioned ~1 ~ ~ if entity @a[dx=15,dy=4] run function asset:mob/0273.hell_blade/chase/left

# west
    execute as @s[y_rotation=90] unless entity @p[dx=0,dy=4] positioned ~ ~ ~-16 if entity @a[dy=4,dz=15] run function asset:mob/0273.hell_blade/chase/right
    execute as @s[y_rotation=90] unless entity @p[dx=0,dy=4] positioned ~ ~ ~1 if entity @a[dy=4,dz=15] run function asset:mob/0273.hell_blade/chase/left

# north
    execute as @s[y_rotation=180] unless entity @p[dx=0,dy=4] positioned ~1 ~ ~ if entity @a[dx=15,dy=4] run function asset:mob/0273.hell_blade/chase/right
    execute as @s[y_rotation=180] unless entity @p[dx=0,dy=4] positioned ~-16 ~ ~ if entity @a[dx=15,dy=4] run function asset:mob/0273.hell_blade/chase/left

# east
    execute as @s[y_rotation=-90] unless entity @p[dx=0,dy=4] positioned ~ ~ ~1 if entity @a[dy=4,dz=15] run function asset:mob/0273.hell_blade/chase/right
    execute as @s[y_rotation=-90] unless entity @p[dx=0,dy=4] positioned ~ ~ ~-16 if entity @a[dy=4,dz=15] run function asset:mob/0273.hell_blade/chase/left


text:
#> asset:mob/0273.hell_blade/chase/left
#
#
#
# @within function asset:mob/0273.hell_blade/chase/check

# タイマー更新
    scoreboard players set @s 7L.Timer -10

# タグ付け
    tag @s add 7L.RotateLeft


text:
#> asset:mob/0273.hell_blade/chase/right
#
#
#
# @within function asset:mob/0273.hell_blade/chase/check

# タイマー更新
    scoreboard players set @s 7L.Timer -10

# タグ付け
    tag @s add 7L.RotateRight


text:
#> asset:mob/0273.hell_blade/chase/rotate/-9
#
#
#
# @within function asset:mob/0273.hell_blade/chase/rotate/

# SFX
    playsound block.note_block.bit hostile @a ~ ~ ~ 1 2
    playsound block.piston.extend hostile @a ~ ~ ~ 1 2

# モデル適応
    data modify entity @s ArmorItems[3].tag.CustomModelData set value 20161


text:
#> asset:mob/0273.hell_blade/chase/rotate/0
#
#
#
# @within function asset:mob/0273.hell_blade/chase/rotate/

# 回転
    execute align xyz positioned ~.5 ~ ~.5 run tp @s ^ ^ ^-.375 ~ ~
    tag @s remove 7L.RotateLeft
    tag @s remove 7L.RotateRight

# 向きのスコアを更新
    execute store result score @s 7L.FallingRotation run data get entity @s Rotation[0] 1

# クールタイム
    scoreboard players set @s 7L.RotateTimer 3

# SFX
    playsound block.piston.extend hostile @a ~ ~ ~ 1 2

# モデル適応
    data modify entity @s ArmorItems[3].tag.CustomModelData set value 20160


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

# 移動
    execute at @s[tag=!7L.Fall] if score @s 7L.Timer matches 0..3 run function asset:mob/0273.hell_blade/move/

# 攻撃
    execute at @s[tag=!7L.Fall] if entity @p[tag=!PlayerShouldInvulnerable,distance=..0.8] run function asset:mob/0273.hell_blade/attack

# 曲がる
    execute at @s[tag=!7L.Fall] if score @s 7L.Timer matches ..-1 run function asset:mob/0273.hell_blade/chase/rotate/

# 落ちるかどうかチェック
    execute at @s[tag=!7L.Fall] if score @s 7L.Timer matches 2 align xyz positioned ~0.5 ~0.5 ~0.5 run function asset:mob/0273.hell_blade/unstuck/

# ブロック破壊
    execute at @s[tag=7L.FaceFloor,tag=!7L.Fall] if score @s 7L.Timer matches 2 align xyz positioned ~0.5 ~0.5 ~0.5 positioned ~ ~-1 ~ run function asset:mob/0273.hell_blade/break
    execute at @s[tag=7L.FaceWallUp,tag=!7L.Fall] if score @s 7L.Timer matches 2 align xyz positioned ~0.5 ~0.5 ~0.5 positioned ^ ^ ^1 run function asset:mob/0273.hell_blade/break
    execute at @s[tag=7L.FaceWallDown,tag=!7L.Fall] if score @s 7L.Timer matches 2 align xyz positioned ~0.5 ~0.5 ~0.5 positioned ^ ^ ^-1 run function asset:mob/0273.hell_blade/break
    execute at @s[tag=7L.FaceCeiling,tag=!7L.Fall] if score @s 7L.Timer matches 2 align xyz positioned ~0.5 ~0.5 ~0.5 positioned ~ ~1 ~ run function asset:mob/0273.hell_blade/break

# 落下タグがついているなら
    execute at @s[tag=7L.Fall] run function asset:mob/0273.hell_blade/fall


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

execute if data storage asset:context {id:273} run function asset:mob/0273.hell_blade/tick/2.tick


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

#> 定義類はここに
# @within function asset:mob/0202.hunters_dream/**
    scoreboard objectives add 5M.Tick dummy


text:
#> asset:mob/0202.hunters_dream/_index.d
# @private

#> tag
# @within function asset:mob/0202.hunters_dream/**
    #declare tag 5M.SkillSword
    #declare tag 5M.SkillArrow


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

# 演出
    particle smoke ~ ~1.3 ~ 0.3 0.5 0.3 0.01 50 normal @a


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

execute if data storage asset:context {id:202} run function asset:mob/0202.hunters_dream/death/2.death


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

# 元となるMobを召喚する
    summon skeleton ~ ~ ~ {Tags:["MobInit"],DeathLootTable:"asset:mob/death/0202.hunters_dream"}
# ID (int)
    data modify storage asset:mob ID set value 202
# 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:"iron_sword",Count:1b}
    # オフハンド (Compound(Item)) (オプション)
        data modify storage asset:mob Weapon.Offhand set value {id:"crossbow",Count:1b}
# 武器ドロップ率 ([float, float]) (オプション)
    # data modify storage asset:mob WeaponDropChances set value
# 防具
    # 頭 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Head set value {id:"deepslate_tile_slab",Count:1b}
    # 胴 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Chest set value {id:"minecraft:leather_chestplate",Count:1b,tag:{display:{color:6029569}}}
    # 脚 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Legs set value {id:"minecraft:leather_leggings",Count:1b,tag:{display:{color:6029569}}}
    # 足 (Compound(Item)) (オプション)
        data modify storage asset:mob Armor.Feet set value {id:"minecraft:leather_boots",Count:1b,tag:{display:{color:6029569}}}
# 防具ドロップ率 ([float, float]) (オプション)
    # data modify storage asset:mob ArmorDropChances set value
# 体力 (double) (オプション)
    data modify storage asset:mob Health set value 80
# 攻撃力 (double) (オプション)
    data modify storage asset:mob AttackDamage set value -3
# 防御力 (double) (オプション) // 被ダメージがある程度大きい場合1ptにつき0.8%カット、小さい場合1ptにつき約4%カット 20pt以上は頭打ち
    data modify storage asset:mob Defense set value -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
# ノックバック耐性 (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.8
    # 火倍率 (float) (オプション)
        data modify storage asset:mob Resist.Fire set value 1
    # 水倍率 (float) (オプション)
        data modify storage asset:mob Resist.Water set value 1
    # 雷倍率 (float) (オプション)
        data modify storage asset:mob Resist.Thunder set value 1

# スコアを与える
    scoreboard players set @e[type=skeleton,tag=MobInit,distance=..0.01] 5M.Tick -60
# MobInitタグ持ちを対象にして召喚関数呼び出し
    execute as @e[type=skeleton,tag=MobInit,distance=..0.01] run function asset:mob/common/summon


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

execute if data storage asset:context {id:202} run function asset:mob/0202.hunters_dream/summon/2.summon


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

execute if data storage asset:context {id:202} run function asset:mob/0202.hunters_dream/attack/2.attack


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

# 腕振る
    item replace entity @s weapon.mainhand with iron_sword
# 演出
    playsound entity.blaze.shoot hostile @a ~ ~ ~ 1 0.6
# ダメージを与える
# 引数の設定
    # 与えるダメージ
        data modify storage lib: Argument.Damage set value 8
    # 第一属性
        data modify storage lib: Argument.AttackType set value "Physical"
    # 第二属性
        data modify storage lib: Argument.ElementType set value "Fire"
# 補正functionを実行
    function lib:damage/modifier
# 対象
    execute as @p[tag=Victim] run function lib:damage/
# リセット
    function lib:damage/reset


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

# スコアを増やす
    scoreboard players add @s 5M.Tick 1
# スコアが一定に達したら発動（プレイヤーが周囲にいないとき）
    execute if score @s 5M.Tick matches 0 positioned ^ ^ ^5 unless entity @p[gamemode=!spectator,distance=..5] run scoreboard players set @s 5M.Tick -60
# スコアが一定に達したら発動（プレイヤーが近くにいるとき）
    execute if score @s 5M.Tick matches 0 positioned ^ ^ ^5 if entity @p[gamemode=!spectator,distance=..5] at @s run function asset:mob/0202.hunters_dream/tick/3.skill_select
# スキル発動中
    execute if score @s 5M.Tick matches 0.. run function asset:mob/0202.hunters_dream/tick/4.skill_active


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

execute if data storage asset:context {id:202} run function asset:mob/0202.hunters_dream/tick/2.tick


text:
#> asset:mob/0202.hunters_dream/tick/4.skill_active
#
#
#
# @within function asset:mob/0202.hunters_dream/tick/2.tick

# 剣
    execute if entity @s[tag=5M.SkillSword] run function asset:mob/0202.hunters_dream/tick/1.skill_sword/1.skill_sword
# 弓
    execute if entity @s[tag=5M.SkillArrow] run function asset:mob/0202.hunters_dream/tick/2.skill_arrow/1.skill_arrow


text:
#> asset:mob/0202.hunters_dream/tick/3.skill_select
#
#
#
# @within function asset:mob/0202.hunters_dream/tick/2.tick

#> private
# @private
    #declare score_holder $Random

# 疑似乱数取得
    execute store result score $Random Temporary run function lib:random/
# ほしい範囲に剰余算
    scoreboard players operation $Random Temporary %= $2 Const
# デバッグのコマンド
    #scoreboard players set $Random Temporary 0
# スキル選択
    execute if score $Random Temporary matches 0 run tag @s add 5M.SkillSword
    execute if score $Random Temporary matches 1 run tag @s add 5M.SkillArrow
# リセット
    scoreboard players reset $Random Temporary


text:
#> asset:mob/0202.hunters_dream/tick/reset
#
#
#
# @within function asset:mob/0202.hunters_dream/tick/**

# タグを消す
    tag @s remove 5M.SkillSword
    tag @s remove 5M.SkillArrow
# スコアを戻す
    scoreboard players set @s 5M.Tick -60


text:
#> asset:mob/0202.hunters_dream/tick/1.skill_sword/3.step
#
#
#
# @within function asset:mob/0202.hunters_dream/tick/1.skill_sword/1.skill_sword

# 数値
    data modify storage lib: Argument.VectorMagnitude set value 1.6
# 飛ぶ方向
    execute facing entity @p[gamemode=!spectator] eyes rotated ~-10 ~ run function lib:motion/
# リセット
    data remove storage lib: Argument

# ステップ中に攻撃をしないように弱体化を付与
    effect give @s weakness 1 100 true


text:
#> asset:mob/0202.hunters_dream/tick/1.skill_sword/5.vfx
#
#
#
# @within function asset:mob/0202.hunters_dream/tick/1.skill_sword/4.slash

# 演出
    particle witch ~ ~1 ~ 0 1 0 0 20 normal
    playsound minecraft:entity.evoker.prepare_summon hostile @a ~ ~ ~ 1 2


text:
#> asset:mob/0202.hunters_dream/tick/1.skill_sword/2.backstep
#
#
#
# @within function asset:mob/0202.hunters_dream/tick/1.skill_sword/1.skill_sword

# 数値
    data modify storage lib: Argument.VectorMagnitude set value 1.2
# 飛ぶ方向
    execute facing entity @p[gamemode=!spectator] eyes rotated ~ ~180 run function lib:motion/
# リセット
    data remove storage lib: Argument


text:
#> asset:mob/0202.hunters_dream/tick/1.skill_sword/4.slash
#
#
#
# @within function asset:mob/0202.hunters_dream/tick/1.skill_sword/1.skill_sword

# 演出
    execute positioned ~ ~1 ~ run particle sweep_attack ^ ^ ^1 0 0 0 1 2 normal
    execute positioned ~ ~1 ~ run particle sweep_attack ^ ^ ^2 0 0 0 1 2 normal
    playsound minecraft:item.trident.return hostile @a ~ ~ ~ 1 2

# 引数の設定
    # 与えるダメージ
        data modify storage lib: Argument.Damage set value 12.0f
    # 第一属性
        data modify storage lib: Argument.AttackType set value "Physical"
    # 第二属性
        data modify storage lib: Argument.ElementType set value "None"
# 補正functionを実行
    function lib:damage/modifier
# 前方にいたプレイヤーにダメージ
    execute positioned ^ ^ ^1 as @p[distance=..2.5] run function lib:damage/
# リセット
    function lib:damage/reset

# 演出
    execute positioned ^ ^ ^1 as @p[distance=..2.5] at @s run function asset:mob/0202.hunters_dream/tick/1.skill_sword/5.vfx


text:
#> asset:mob/0202.hunters_dream/tick/1.skill_sword/1.skill_sword
#
#
#
# @within function asset:mob/0202.hunters_dream/tick/4.skill_active

# 一回後退
    execute if score @s 5M.Tick matches 0 run function asset:mob/0202.hunters_dream/tick/1.skill_sword/2.backstep
# その後突進
    execute if score @s 5M.Tick matches 10 run function asset:mob/0202.hunters_dream/tick/1.skill_sword/3.step
# 攻撃判定
    execute if score @s 5M.Tick matches 14 run function asset:mob/0202.hunters_dream/tick/1.skill_sword/4.slash
# リセット
    execute if score @s 5M.Tick matches 14 run function asset:mob/0202.hunters_dream/tick/reset


text:
#> asset:mob/0202.hunters_dream/tick/2.skill_arrow/3.arrow_summon
#
#
#
# @within function asset:mob/0202.hunters_dream/tick/2.skill_arrow/1.skill_arrow

#> private
# @private
    #declare tag 5M.ArrowThis

# 演出
    playsound entity.arrow.shoot hostile @a ~ ~ ~ 1 1
# 矢を召喚する
    summon arrow ~ ~1.5 ~ {damage:4d,Color:9115647,Tags:["5M.ArrowThis"]}

# 矢を飛ばす
# 数値
    data modify storage lib: Argument.VectorMagnitude set value 1.5
# 飛ぶ方向
    execute as @e[tag=5M.ArrowThis,distance=..2,sort=nearest,limit=1] rotated as @e[type=skeleton,tag=this,distance=..5,limit=1] rotated ~-10 ~ run function lib:motion/
# リセット
    data remove storage lib: Argument

# タグを消す
    tag @e[tag=5M.ArrowThis,distance=..2] remove 5M.ArrowThis


text:
#> asset:mob/0202.hunters_dream/tick/2.skill_arrow/1.skill_arrow
#
#
#
# @within function asset:mob/0202.hunters_dream/tick/4.skill_active

# 一回後退
    execute if score @s 5M.Tick matches 0 run function asset:mob/0202.hunters_dream/tick/2.skill_arrow/2.backstep

# 召喚する
    execute if score @s 5M.Tick matches 4 run function asset:mob/0202.hunters_dream/tick/2.skill_arrow/3.arrow_summon
    execute if score @s 5M.Tick matches 6 run function asset:mob/0202.hunters_dream/tick/2.skill_arrow/3.arrow_summon
    execute if score @s 5M.Tick matches 8 run function asset:mob/0202.hunters_dream/tick/2.skill_arrow/3.arrow_summon

# リセット
    execute if score @s 5M.Tick matches 8 run function asset:mob/0202.hunters_dream/tick/reset


text:
#> asset:mob/0202.hunters_dream/tick/2.skill_arrow/2.backstep
#
#
#
# @within function asset:mob/0202.hunters_dream/tick/2.skill_arrow/1.skill_arrow

# 数値
    data modify storage lib: Argument.VectorMagnitude set value 1
# 飛ぶ方向
    execute facing entity @p[gamemode=!spectator] eyes rotated ~ ~180 run function lib:motion/
# リセット
    data remove storage lib: Argument


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

#> 定義類はここに
# @within function asset:mob/0189.water_mage/**
    scoreboard objectives add 59.Tick dummy


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

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


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

execute if data storage asset:context {id:189} run function asset:mob/0189.water_mage/death/2.death


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

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

execute if data storage asset:context {id:189} run function asset:mob/0189.water_mage/summon/2.summon


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

# 演出
    playsound minecraft:entity.vex.hurt hostile @a ~ ~ ~ 1 0.5
    playsound minecraft:entity.vex.hurt hostile @a ~ ~ ~ 1 0.7


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

execute if data storage asset:context {id:189} run function asset:mob/0189.water_mage/hurt/2.hurt


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

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

# スコア
    execute positioned ^ ^ ^10 if entity @p[gamemode=!spectator,distance=..10] run scoreboard players add @s 59.Tick 1

# 120tickごとに水魔法を召喚
    execute if score @s 59.Tick matches 120.. run function asset:mob/0189.water_mage/tick/03.summon_water_magic


text:
#> asset:mob/0189.water_mage/tick/03.summon_water_magic
#
# ウォーターマジックを召喚
#
# @within function asset:mob/0189.water_mage/tick/2.tick

# ID設定
    data modify storage api: Argument.ID set value 214
# プレイヤーが4m以内にいる場合、足元に召喚
    execute if entity @p[gamemode=!spectator,distance=..4] at @p[gamemode=!spectator,distance=..4] run function api:mob/summon

# プレイヤーが4m以上離れている場合、そっちの方向に召喚
    execute if data storage api: Argument.ID if entity @p[gamemode=!spectator,distance=4..30] facing entity @p[gamemode=!spectator,distance=4..30] feet positioned ^ ^ ^7 run function api:mob/summon

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

# リセット
    scoreboard players reset $Random Temporary


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

execute if data storage asset:context {id:189} if entity @p[gamemode=!spectator,distance=..30] run function asset:mob/0189.water_mage/tick/2.tick