Skip to content

Commit

Permalink
HealAPIにArgument.DisableLogを追加
Browse files Browse the repository at this point in the history
  • Loading branch information
Lapis-LJA committed Sep 27, 2024
1 parent 8fae752 commit b05ab8a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion TheSkyBlessing/data/api/functions/heal/.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
# as living entity
# storage api: Argument.Heal : float
# storage api: Argument.FixedHeal? : boolean(default: false)
# storage api: Argument.DisableLog? : boolean(default: false)
# @api

# 引数チェック
execute unless data storage api: Argument.Heal run tellraw @a [{"storage":"global","nbt":"Prefix.ERROR"},{"text":"引数が足りません","color":"white"},{"text":" Heal","color":"red"}]
# プレイヤー
execute if entity @s[type=player] run function api:heal/core/player
# non-プレイヤー
execute if entity @s[type=#lib:living,type=!player,tag=!Uninterferable] run function api:heal/core/non-player
execute if entity @s[type=#lib:living,type=!player,tag=!Uninterferable] run function api:heal/core/non-player
3 changes: 2 additions & 1 deletion TheSkyBlessing/data/api/functions/heal/reset.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
# @api

data remove storage api: Argument.Heal
data remove storage api: Argument.FixedHeal
data remove storage api: Argument.FixedHeal
data remove storage api: Argument.DisableLog
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
# storage api: Argument.Attacker?: int(MobUUID)
# storage api: Argument.AttackType?: Enum(AttackType)
# storage api: Argument.ElementType?: Enum(ElementType)
# storage api: Argument.DisableLog?: boolean(default: false)
# @within function
# lib:**
# api:**
Expand All @@ -23,6 +24,6 @@
# 攻撃情報を記録する
execute if score $Fluctuation Lib matches ..-1 run function lib:score_to_health_wrapper/core/store_attack_info
# ログ表示
execute at @s run function lib:status_log/show_health
execute unless data storage api: Argument{DisableLog:true} at @s run function lib:status_log/show_health
# リセット
scoreboard players reset $Fluctuation Lib
scoreboard players reset $Fluctuation Lib

0 comments on commit b05ab8a

Please sign in to comment.