diff --git a/TheSkyBlessing/data/core/functions/load_once.mcfunction b/TheSkyBlessing/data/core/functions/load_once.mcfunction index 1f2d146a5e..dbb47edb9e 100644 --- a/TheSkyBlessing/data/core/functions/load_once.mcfunction +++ b/TheSkyBlessing/data/core/functions/load_once.mcfunction @@ -264,6 +264,12 @@ team modify NoCollision collisionRule never scoreboard objectives add LogRemoveTime dummy scoreboard objectives add ScoreToHPFluc dummy + #> 神器の使用失敗メッセージのクールダウン + # @within function lib:message/artifact/** + scoreboard objectives add CannotUseHereLatestLogTick dummy + scoreboard objectives add ConditionNotMetLatestLogTick dummy + scoreboard objectives add DontHaveRequiredItemsLatestLogTick dummy + #> PlayerManager - Motionチェック用スコアボード # @within # function diff --git a/TheSkyBlessing/data/lib/functions/message/artifact/can_not_use_here.mcfunction b/TheSkyBlessing/data/lib/functions/message/artifact/can_not_use_here.mcfunction index 01ce4b6fdb..d61916de6e 100644 --- a/TheSkyBlessing/data/lib/functions/message/artifact/can_not_use_here.mcfunction +++ b/TheSkyBlessing/data/lib/functions/message/artifact/can_not_use_here.mcfunction @@ -4,4 +4,13 @@ # # @api -tellraw @s [{"text":"ここでは使用できません。","color":"red"}] \ No newline at end of file +#> Private +# @private + #declare score_holder $CurrentTick + +# クールダウン + execute store result score $CurrentTick Temporary run data get storage global Time + scoreboard players operation $CurrentTick Temporary -= @s CannotUseHereLatestLogTick + execute if score $CurrentTick Temporary matches 20.. run tellraw @s [{"text":"ここでは使用できません。","color":"red"}] + execute if score $CurrentTick Temporary matches 20.. store result score @s CannotUseHereLatestLogTick run time query gametime + scoreboard players reset $CurrentTick Temporary diff --git a/TheSkyBlessing/data/lib/functions/message/artifact/condition_not_met.mcfunction b/TheSkyBlessing/data/lib/functions/message/artifact/condition_not_met.mcfunction index 258b4282f3..bbd62985bb 100644 --- a/TheSkyBlessing/data/lib/functions/message/artifact/condition_not_met.mcfunction +++ b/TheSkyBlessing/data/lib/functions/message/artifact/condition_not_met.mcfunction @@ -4,4 +4,13 @@ # # @api -tellraw @s [{"text":"発動条件を満たしていません。","color":"red"}] +#> Private +# @private + #declare score_holder $CurrentTick + +# クールダウン + execute store result score $CurrentTick Temporary run data get storage global Time + scoreboard players operation $CurrentTick Temporary -= @s ConditionNotMetLatestLogTick + execute if score $CurrentTick Temporary matches 20.. run tellraw @s [{"text":"発動条件を満たしていません。","color":"red"}] + execute if score $CurrentTick Temporary matches 20.. store result score @s ConditionNotMetLatestLogTick run time query gametime + scoreboard players reset $CurrentTick Temporary diff --git a/TheSkyBlessing/data/lib/functions/message/artifact/dont_have_require_items.mcfunction b/TheSkyBlessing/data/lib/functions/message/artifact/dont_have_require_items.mcfunction index 2f0b86c5f9..b51ee31f1f 100644 --- a/TheSkyBlessing/data/lib/functions/message/artifact/dont_have_require_items.mcfunction +++ b/TheSkyBlessing/data/lib/functions/message/artifact/dont_have_require_items.mcfunction @@ -4,4 +4,13 @@ # # @api -tellraw @s [{"text":"発動に必要なアイテムを所持していません。","color":"red"}] \ No newline at end of file +#> Private +# @private + #declare score_holder $CurrentTick + +# クールダウン + execute store result score $CurrentTick Temporary run data get storage global Time + scoreboard players operation $CurrentTick Temporary -= @s DontHaveRequiredItemsLatestLogTick + execute if score $CurrentTick Temporary matches 20.. run tellraw @s [{"text":"発動に必要なアイテムを所持していません。","color":"red"}] + execute if score $CurrentTick Temporary matches 20.. store result score @s DontHaveRequiredItemsLatestLogTick run time query gametime + scoreboard players reset $CurrentTick Temporary