text:
--- original/ScoreToHealth/data/score_to_health/functions/check.mcfunction
+++ modified/ScoreToHealth/data/score_to_health/functions/check.mcfunction
@@ -15,3 +15,3 @@
-execute store result score #_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
-execute store result score #__ ScoreToHealth run data get entity @s Health 100
-scoreboard players operation #__ ScoreToHealth -= #_ ScoreToHealth
+execute store result score $_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
+function api:data_get/health
+execute store result score $__ ScoreToHealth run data get storage api: Health 100
+scoreboard players operation $__ ScoreToHealth -= $_ ScoreToHealth
@@ -19 +19 @@
-execute if score #__ ScoreToHealth matches ..0 unless entity @s[tag=ScoreToHealth.AntiGlitch.UnsafeTick] run function score_to_health:modify
+execute if score $__ ScoreToHealth matches ..0 unless entity @s[tag=ScoreToHealth.AntiGlitch.UnsafeTick] run function score_to_health:modify
@@ -21 +21 @@
-execute if score #__ ScoreToHealth matches 1.. run function score_to_health:anti_glitch/protect
+execute if score $__ ScoreToHealth matches 1.. run function score_to_health:anti_glitch/protect
--- original/ScoreToHealth/data/score_to_health/functions/load.mcfunction
+++ modified/ScoreToHealth/data/score_to_health/functions/load.mcfunction
@@ -15 +15,15 @@
-scoreboard objectives add ScoreToHealth dummy {"text":"プレイヤーをこの体力にする(*0.01HP)"}
+#> ObjectDeclare
+# @within *
+#   score_to_health:**
+#   lib:score_to_health_wrapper/**
+#   lib:has_health_modify_score
+#   player_manager:bonus/**
+#   core:handler/first_join
+    scoreboard objectives add ScoreToHealth dummy {"text":"プレイヤーをこの体力にする(*0.01HP)"}
+    scoreboard objectives add ScoreToMaxHealth dummy {"text":"プレイヤーをこの最大体力にする(*0.0001HP)"}
+
+#> PrivateUse
+# @internal
+    #declare tag ScoreToHealth.AntiGlitch.UnsafeTick
+    #declare tag ScoreToHealth.AntiGlitch.Protected
+    #declare tag ScoreToHealth.Modified
+    #declare tag ScoreToHealth.Return
+    scoreboard objectives add STMHBackup dummy {"text":"ScoreToMaxHealthのBackup"}
+
+#> RespawnCheck
+# @within function core:handler/respawn
+#declare objective STMHBackup
\ No newline at end of file
--- original/ScoreToHealth/data/score_to_health/functions/modify.mcfunction
+++ modified/ScoreToHealth/data/score_to_health/functions/modify.mcfunction
@@ -17,2 +17,2 @@
-execute store result score #_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
-scoreboard players operation @s ScoreToHealth < #_ ScoreToHealth
+execute store result score $_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
+scoreboard players operation @s ScoreToHealth < $_ ScoreToHealth
@@ -21,3 +21,3 @@
-execute store result score #_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
-execute if score @s ScoreToHealth <= #_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-16 "ScoreToHealth" -419.4304 add
-execute if score @s ScoreToHealth > #_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-16 "ScoreToHealth" 419.4304 add
+execute store result score $_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
+execute if score @s ScoreToHealth <= $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-16 "ScoreToHealth" -419.4304 add
+execute if score @s ScoreToHealth > $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-16 "ScoreToHealth" 419.4304 add
@@ -25,3 +25,3 @@
-execute store result score #_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
-execute if score @s ScoreToHealth <= #_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-15 "ScoreToHealth" -209.7152 add
-execute if score @s ScoreToHealth > #_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-15 "ScoreToHealth" 209.7152 add
+execute store result score $_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
+execute if score @s ScoreToHealth <= $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-15 "ScoreToHealth" -209.7152 add
+execute if score @s ScoreToHealth > $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-15 "ScoreToHealth" 209.7152 add
@@ -29,3 +29,3 @@
-execute store result score #_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
-execute if score @s ScoreToHealth <= #_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-14 "ScoreToHealth" -104.8576 add
-execute if score @s ScoreToHealth > #_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-14 "ScoreToHealth" 104.8576 add
+execute store result score $_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
+execute if score @s ScoreToHealth <= $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-14 "ScoreToHealth" -104.8576 add
+execute if score @s ScoreToHealth > $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-14 "ScoreToHealth" 104.8576 add
@@ -33,3 +33,3 @@
-execute store result score #_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
-execute if score @s ScoreToHealth <= #_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-13 "ScoreToHealth" -52.4288 add
-execute if score @s ScoreToHealth > #_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-13 "ScoreToHealth" 52.4288 add
+execute store result score $_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
+execute if score @s ScoreToHealth <= $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-13 "ScoreToHealth" -52.4288 add
+execute if score @s ScoreToHealth > $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-13 "ScoreToHealth" 52.4288 add
@@ -37,3 +37,3 @@
-execute store result score #_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
-execute if score @s ScoreToHealth <= #_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-12 "ScoreToHealth" -26.2144 add
-execute if score @s ScoreToHealth > #_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-12 "ScoreToHealth" 26.2144 add
+execute store result score $_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
+execute if score @s ScoreToHealth <= $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-12 "ScoreToHealth" -26.2144 add
+execute if score @s ScoreToHealth > $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-12 "ScoreToHealth" 26.2144 add
@@ -41,3 +41,3 @@
-execute store result score #_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
-execute if score @s ScoreToHealth <= #_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-11 "ScoreToHealth" -13.1072 add
-execute if score @s ScoreToHealth > #_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-11 "ScoreToHealth" 13.1072 add
+execute store result score $_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
+execute if score @s ScoreToHealth <= $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-11 "ScoreToHealth" -13.1072 add
+execute if score @s ScoreToHealth > $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-11 "ScoreToHealth" 13.1072 add
@@ -45,3 +45,3 @@
-execute store result score #_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
-execute if score @s ScoreToHealth <= #_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-10 "ScoreToHealth" -6.5536 add
-execute if score @s ScoreToHealth > #_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-10 "ScoreToHealth" 6.5536 add
+execute store result score $_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
+execute if score @s ScoreToHealth <= $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-10 "ScoreToHealth" -6.5536 add
+execute if score @s ScoreToHealth > $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-10 "ScoreToHealth" 6.5536 add
@@ -49,3 +49,3 @@
-execute store result score #_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
-execute if score @s ScoreToHealth <= #_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-0F "ScoreToHealth" -3.2768 add
-execute if score @s ScoreToHealth > #_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-0F "ScoreToHealth" 3.2768 add
+execute store result score $_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
+execute if score @s ScoreToHealth <= $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-0F "ScoreToHealth" -3.2768 add
+execute if score @s ScoreToHealth > $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-0F "ScoreToHealth" 3.2768 add
@@ -53,3 +53,3 @@
-execute store result score #_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
-execute if score @s ScoreToHealth <= #_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-0E "ScoreToHealth" -1.6384 add
-execute if score @s ScoreToHealth > #_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-0E "ScoreToHealth" 1.6384 add
+execute store result score $_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
+execute if score @s ScoreToHealth <= $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-0E "ScoreToHealth" -1.6384 add
+execute if score @s ScoreToHealth > $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-0E "ScoreToHealth" 1.6384 add
@@ -57,3 +57,3 @@
-execute store result score #_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
-execute if score @s ScoreToHealth <= #_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-0D "ScoreToHealth" -0.8192 add
-execute if score @s ScoreToHealth > #_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-0D "ScoreToHealth" 0.8192 add
+execute store result score $_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
+execute if score @s ScoreToHealth <= $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-0D "ScoreToHealth" -0.8192 add
+execute if score @s ScoreToHealth > $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-0D "ScoreToHealth" 0.8192 add
@@ -61,3 +61,3 @@
-execute store result score #_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
-execute if score @s ScoreToHealth <= #_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-0C "ScoreToHealth" -0.4096 add
-execute if score @s ScoreToHealth > #_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-0C "ScoreToHealth" 0.4096 add
+execute store result score $_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
+execute if score @s ScoreToHealth <= $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-0C "ScoreToHealth" -0.4096 add
+execute if score @s ScoreToHealth > $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-0C "ScoreToHealth" 0.4096 add
@@ -65,3 +65,3 @@
-execute store result score #_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
-execute if score @s ScoreToHealth <= #_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-0B "ScoreToHealth" -0.2048 add
-execute if score @s ScoreToHealth > #_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-0B "ScoreToHealth" 0.2048 add
+execute store result score $_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
+execute if score @s ScoreToHealth <= $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-0B "ScoreToHealth" -0.2048 add
+execute if score @s ScoreToHealth > $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-0B "ScoreToHealth" 0.2048 add
@@ -69,3 +69,3 @@
-execute store result score #_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
-execute if score @s ScoreToHealth <= #_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-0A "ScoreToHealth" -0.1024 add
-execute if score @s ScoreToHealth > #_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-0A "ScoreToHealth" 0.1024 add
+execute store result score $_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
+execute if score @s ScoreToHealth <= $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-0A "ScoreToHealth" -0.1024 add
+execute if score @s ScoreToHealth > $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-0A "ScoreToHealth" 0.1024 add
@@ -73,3 +73,3 @@
-execute store result score #_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
-execute if score @s ScoreToHealth <= #_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-09 "ScoreToHealth" -0.0512 add
-execute if score @s ScoreToHealth > #_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-09 "ScoreToHealth" 0.0512 add
+execute store result score $_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
+execute if score @s ScoreToHealth <= $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-09 "ScoreToHealth" -0.0512 add
+execute if score @s ScoreToHealth > $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-09 "ScoreToHealth" 0.0512 add
@@ -77,3 +77,3 @@
-execute store result score #_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
-execute if score @s ScoreToHealth <= #_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-08 "ScoreToHealth" -0.0256 add
-execute if score @s ScoreToHealth > #_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-08 "ScoreToHealth" 0.0256 add
+execute store result score $_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
+execute if score @s ScoreToHealth <= $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-08 "ScoreToHealth" -0.0256 add
+execute if score @s ScoreToHealth > $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-08 "ScoreToHealth" 0.0256 add
@@ -81,3 +81,3 @@
-execute store result score #_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
-execute if score @s ScoreToHealth <= #_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-07 "ScoreToHealth" -0.0128 add
-execute if score @s ScoreToHealth > #_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-07 "ScoreToHealth" 0.0128 add
+execute store result score $_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
+execute if score @s ScoreToHealth <= $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-07 "ScoreToHealth" -0.0128 add
+execute if score @s ScoreToHealth > $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-07 "ScoreToHealth" 0.0128 add
@@ -85,3 +85,3 @@
-execute store result score #_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
-execute if score @s ScoreToHealth <= #_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-06 "ScoreToHealth" -0.0064 add
-execute if score @s ScoreToHealth > #_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-06 "ScoreToHealth" 0.0064 add
+execute store result score $_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
+execute if score @s ScoreToHealth <= $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-06 "ScoreToHealth" -0.0064 add
+execute if score @s ScoreToHealth > $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-06 "ScoreToHealth" 0.0064 add
@@ -89,3 +89,3 @@
-execute store result score #_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
-execute if score @s ScoreToHealth <= #_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-05 "ScoreToHealth" -0.0032 add
-execute if score @s ScoreToHealth > #_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-05 "ScoreToHealth" 0.0032 add
+execute store result score $_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
+execute if score @s ScoreToHealth <= $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-05 "ScoreToHealth" -0.0032 add
+execute if score @s ScoreToHealth > $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-05 "ScoreToHealth" 0.0032 add
@@ -93,3 +93,3 @@
-execute store result score #_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
-execute if score @s ScoreToHealth <= #_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-04 "ScoreToHealth" -0.0016 add
-execute if score @s ScoreToHealth > #_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-04 "ScoreToHealth" 0.0016 add
+execute store result score $_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
+execute if score @s ScoreToHealth <= $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-04 "ScoreToHealth" -0.0016 add
+execute if score @s ScoreToHealth > $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-04 "ScoreToHealth" 0.0016 add
@@ -97,3 +97,3 @@
-execute store result score #_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
-execute if score @s ScoreToHealth <= #_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-03 "ScoreToHealth" -0.0008 add
-execute if score @s ScoreToHealth > #_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-03 "ScoreToHealth" 0.0008 add
+execute store result score $_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
+execute if score @s ScoreToHealth <= $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-03 "ScoreToHealth" -0.0008 add
+execute if score @s ScoreToHealth > $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-03 "ScoreToHealth" 0.0008 add
@@ -101,3 +101,3 @@
-execute store result score #_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
-execute if score @s ScoreToHealth <= #_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-02 "ScoreToHealth" -0.0004 add
-execute if score @s ScoreToHealth > #_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-02 "ScoreToHealth" 0.0004 add
+execute store result score $_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
+execute if score @s ScoreToHealth <= $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-02 "ScoreToHealth" -0.0004 add
+execute if score @s ScoreToHealth > $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-02 "ScoreToHealth" 0.0004 add
@@ -105,3 +105,3 @@
-execute store result score #_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
-execute if score @s ScoreToHealth <= #_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-01 "ScoreToHealth" -0.0002 add
-execute if score @s ScoreToHealth > #_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-01 "ScoreToHealth" 0.0002 add
+execute store result score $_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
+execute if score @s ScoreToHealth <= $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-01 "ScoreToHealth" -0.0002 add
+execute if score @s ScoreToHealth > $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-01 "ScoreToHealth" 0.0002 add
@@ -109,3 +109,3 @@
-execute store result score #_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
-execute if score @s ScoreToHealth <= #_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-00 "ScoreToHealth" -0.0001 add
-execute if score @s ScoreToHealth > #_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-00 "ScoreToHealth" 0.0001 add
+execute store result score $_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
+execute if score @s ScoreToHealth <= $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-00 "ScoreToHealth" -0.0001 add
+execute if score @s ScoreToHealth > $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-00 "ScoreToHealth" 0.0001 add
--- /dev/null
+++ modified/ScoreToHealth/data/score_to_health/functions/modify_max_health.mcfunction
@@ -0,0 +1,189 @@
+#   Copyright © 2020 赤石愛
+
+#   Licensed under the Apache License, Version 2.0 (the "License");
+#   you may not use this file except in compliance with the License.
+#   You may obtain a copy of the License at
+
+#       http://www.apache.org/licenses/LICENSE-2.0
+
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#   See the License for the specific language governing permissions and
+#   limitations under the License.
+
+attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0002-17
+attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0002-16
+attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0002-15
+attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0002-14
+attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0002-13
+attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0002-12
+attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0002-11
+attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0002-10
+attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0002-0F
+attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0002-0E
+attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0002-0D
+attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0002-0C
+attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0002-0B
+attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0002-0A
+attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0002-09
+attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0002-08
+attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0002-07
+attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0002-06
+attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0002-05
+attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0002-04
+attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0002-03
+attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0002-02
+attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0002-01
+attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0002-00
+
+execute store result score $_ ScoreToMaxHealth run attribute @s generic.max_health base get 10000
+
+scoreboard players operation $__ ScoreToMaxHealth = $_ ScoreToMaxHealth
+
+execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-17 "ScoreToMaxHealth" -838.8607 add
+execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run scoreboard players remove $__ ScoreToMaxHealth 8388607
+execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-17 "ScoreToMaxHealth" 838.8607 add
+execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run scoreboard players add $__ ScoreToMaxHealth 8388607
+scoreboard players operation $_ ScoreToMaxHealth = $__ ScoreToMaxHealth
+
+execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-16 "ScoreToMaxHealth" -419.4304 add
+execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run scoreboard players remove $__ ScoreToMaxHealth 4194304
+execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-16 "ScoreToMaxHealth" 419.4304 add
+execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run scoreboard players add $__ ScoreToMaxHealth 4194304
+scoreboard players operation $_ ScoreToMaxHealth = $__ ScoreToMaxHealth
+
+execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-15 "ScoreToMaxHealth" -209.7152 add
+execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run scoreboard players remove $__ ScoreToMaxHealth 2097152
+execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-15 "ScoreToMaxHealth" 209.7152 add
+execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run scoreboard players add $__ ScoreToMaxHealth 2097152
+scoreboard players operation $_ ScoreToMaxHealth = $__ ScoreToMaxHealth
+
+execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-14 "ScoreToMaxHealth" -104.8576 add
+execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run scoreboard players remove $__ ScoreToMaxHealth 1048576
+execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-14 "ScoreToMaxHealth" 104.8576 add
+execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run scoreboard players add $__ ScoreToMaxHealth 1048576
+scoreboard players operation $_ ScoreToMaxHealth = $__ ScoreToMaxHealth
+
+execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-13 "ScoreToMaxHealth" -52.4288 add
+execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run scoreboard players remove $__ ScoreToMaxHealth 524288
+execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-13 "ScoreToMaxHealth" 52.4288 add
+execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run scoreboard players add $__ ScoreToMaxHealth 524288
+scoreboard players operation $_ ScoreToMaxHealth = $__ ScoreToMaxHealth
+
+execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-12 "ScoreToMaxHealth" -26.2144 add
+execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run scoreboard players remove $__ ScoreToMaxHealth 262144
+execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-12 "ScoreToMaxHealth" 26.2144 add
+execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run scoreboard players add $__ ScoreToMaxHealth 262144
+scoreboard players operation $_ ScoreToMaxHealth = $__ ScoreToMaxHealth
+
+execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-11 "ScoreToMaxHealth" -13.1072 add
+execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run scoreboard players remove $__ ScoreToMaxHealth 131072
+execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-11 "ScoreToMaxHealth" 13.1072 add
+execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run scoreboard players add $__ ScoreToMaxHealth 131072
+scoreboard players operation $_ ScoreToMaxHealth = $__ ScoreToMaxHealth
+
+execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-10 "ScoreToMaxHealth" -6.5536 add
+execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run scoreboard players remove $__ ScoreToMaxHealth 65536
+execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-10 "ScoreToMaxHealth" 6.5536 add
+execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run scoreboard players add $__ ScoreToMaxHealth 65536
+scoreboard players operation $_ ScoreToMaxHealth = $__ ScoreToMaxHealth
+
+execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-0F "ScoreToMaxHealth" -3.2768 add
+execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run scoreboard players remove $__ ScoreToMaxHealth 32768
+execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-0F "ScoreToMaxHealth" 3.2768 add
+execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run scoreboard players add $__ ScoreToMaxHealth 32768
+scoreboard players operation $_ ScoreToMaxHealth = $__ ScoreToMaxHealth
+
+execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-0E "ScoreToMaxHealth" -1.6384 add
+execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run scoreboard players remove $__ ScoreToMaxHealth 16384
+execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-0E "ScoreToMaxHealth" 1.6384 add
+execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run scoreboard players add $__ ScoreToMaxHealth 16384
+scoreboard players operation $_ ScoreToMaxHealth = $__ ScoreToMaxHealth
+
+execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-0D "ScoreToMaxHealth" -0.8192 add
+execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run scoreboard players remove $__ ScoreToMaxHealth 8192
+execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-0D "ScoreToMaxHealth" 0.8192 add
+execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run scoreboard players add $__ ScoreToMaxHealth 8192
+scoreboard players operation $_ ScoreToMaxHealth = $__ ScoreToMaxHealth
+
+execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-0C "ScoreToMaxHealth" -0.4096 add
+execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run scoreboard players remove $__ ScoreToMaxHealth 4096
+execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-0C "ScoreToMaxHealth" 0.4096 add
+execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run scoreboard players add $__ ScoreToMaxHealth 4096
+scoreboard players operation $_ ScoreToMaxHealth = $__ ScoreToMaxHealth
+
+execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-0B "ScoreToMaxHealth" -0.2048 add
+execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run scoreboard players remove $__ ScoreToMaxHealth 2048
+execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-0B "ScoreToMaxHealth" 0.2048 add
+execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run scoreboard players add $__ ScoreToMaxHealth 2048
+scoreboard players operation $_ ScoreToMaxHealth = $__ ScoreToMaxHealth
+
+execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-0A "ScoreToMaxHealth" -0.1024 add
+execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run scoreboard players remove $__ ScoreToMaxHealth 1024
+execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-0A "ScoreToMaxHealth" 0.1024 add
+execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run scoreboard players add $__ ScoreToMaxHealth 1024
+scoreboard players operation $_ ScoreToMaxHealth = $__ ScoreToMaxHealth
+
+execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-09 "ScoreToMaxHealth" -0.0512 add
+execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run scoreboard players remove $__ ScoreToMaxHealth 0512
+execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-09 "ScoreToMaxHealth" 0.0512 add
+execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run scoreboard players add $__ ScoreToMaxHealth 0512
+scoreboard players operation $_ ScoreToMaxHealth = $__ ScoreToMaxHealth
+
+execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-08 "ScoreToMaxHealth" -0.0256 add
+execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run scoreboard players remove $__ ScoreToMaxHealth 0256
+execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-08 "ScoreToMaxHealth" 0.0256 add
+execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run scoreboard players add $__ ScoreToMaxHealth 0256
+scoreboard players operation $_ ScoreToMaxHealth = $__ ScoreToMaxHealth
+
+execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-07 "ScoreToMaxHealth" -0.0128 add
+execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run scoreboard players remove $__ ScoreToMaxHealth 0128
+execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-07 "ScoreToMaxHealth" 0.0128 add
+execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run scoreboard players add $__ ScoreToMaxHealth 0128
+scoreboard players operation $_ ScoreToMaxHealth = $__ ScoreToMaxHealth
+
+execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-06 "ScoreToMaxHealth" -0.0064 add
+execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run scoreboard players remove $__ ScoreToMaxHealth 0064
+execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-06 "ScoreToMaxHealth" 0.0064 add
+execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run scoreboard players add $__ ScoreToMaxHealth 0064
+scoreboard players operation $_ ScoreToMaxHealth = $__ ScoreToMaxHealth
+
+execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-05 "ScoreToMaxHealth" -0.0032 add
+execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run scoreboard players remove $__ ScoreToMaxHealth 0032
+execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-05 "ScoreToMaxHealth" 0.0032 add
+execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run scoreboard players add $__ ScoreToMaxHealth 0032
+scoreboard players operation $_ ScoreToMaxHealth = $__ ScoreToMaxHealth
+
+execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-04 "ScoreToMaxHealth" -0.0016 add
+execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run scoreboard players remove $__ ScoreToMaxHealth 0016
+execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-04 "ScoreToMaxHealth" 0.0016 add
+execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run scoreboard players add $__ ScoreToMaxHealth 0016
+scoreboard players operation $_ ScoreToMaxHealth = $__ ScoreToMaxHealth
+
+execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-03 "ScoreToMaxHealth" -0.0008 add
+execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run scoreboard players remove $__ ScoreToMaxHealth 0008
+execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-03 "ScoreToMaxHealth" 0.0008 add
+execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run scoreboard players add $__ ScoreToMaxHealth 0008
+scoreboard players operation $_ ScoreToMaxHealth = $__ ScoreToMaxHealth
+
+execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-02 "ScoreToMaxHealth" -0.0004 add
+execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run scoreboard players remove $__ ScoreToMaxHealth 0004
+execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-02 "ScoreToMaxHealth" 0.0004 add
+execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run scoreboard players add $__ ScoreToMaxHealth 0004
+scoreboard players operation $_ ScoreToMaxHealth = $__ ScoreToMaxHealth
+
+execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-01 "ScoreToMaxHealth" -0.0002 add
+execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run scoreboard players remove $__ ScoreToMaxHealth 0002
+execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-01 "ScoreToMaxHealth" 0.0002 add
+execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run scoreboard players add $__ ScoreToMaxHealth 0002
+scoreboard players operation $_ ScoreToMaxHealth = $__ ScoreToMaxHealth
+
+execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-00 "ScoreToMaxHealth" -0.0001 add
+execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run scoreboard players remove $__ ScoreToMaxHealth 0001
+execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-00 "ScoreToMaxHealth" 0.0001 add
+execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run scoreboard players add $__ ScoreToMaxHealth 0001
+
+effect give @s minecraft:instant_health 1 252 true
+scoreboard players operation @s STMHBackup = @s ScoreToMaxHealth
+tag @s add ScoreToHealth.Return
\ No newline at end of file
--- original/ScoreToHealth/data/score_to_health/functions/player_tick.mcfunction
+++ modified/ScoreToHealth/data/score_to_health/functions/player_tick.mcfunction
@@ -15,0 +16,3 @@
+execute unless score @s STMHBackup matches -2147483648.. run scoreboard players set @s ScoreToMaxHealth 200000
+execute unless score @s STMHBackup matches -2147483648.. run scoreboard players set @s STMHBackup 200000
+execute if entity @s[tag=!ScoreToHealth.Return,tag=!ScoreToHealth.AntiGlitch.UnsafeTick] unless score @s ScoreToMaxHealth = @s STMHBackup run function score_to_health:modify_max_health


text:
# ScoreToHealth
(Minecraft 1.16+) Very Easy Way to Sync Player's Health with Score
プレイヤーの体力をスコアで設定できます！

# 動作確認済みバージョン / Verified minecraft versions

- 1.17
- 1.18

以下のバージョンは右のReleasesからどうぞ。
For the following versions, please check Releases on the right.

1.16.x

# 使い方/How To Use

プレイヤーのScoreToHealthに、目的のHealthの100倍をセットするだけ！
Simply set the player's ScoreToHealth to 100 times the desired Health.

例)12.34にしたい場合
/scoreboard players set @s ScoreToHealth 1234

# 連絡はこちら/Contact

https://twitter.com/AiAkaishi

# やさしいライセンス

1. 著作権表示してね
このデータパックのファイルから著作権表示消したりしたらダメなだけで
このデータパックを使った動画、放送、配布マップとかに特別何か書かないといけないわけじゃないよ。
2. 再配布ok
3. 改変ok
ただし、改変したものを配布する場合は、どのファイルを変えた、とか書いてね。
4. 無料です
個人でも商用でも！

# LICENSE

This datapack is released under the Apache License, Version 2.0, see LICENSE.

repo_name: ProjectTSB/TheSkyBlessing

repo_language: mcfunction

mime_type: text/plain


text:
#   Copyright © 2020 赤石愛

#   Licensed under the Apache License, Version 2.0 (the "License");
#   you may not use this file except in compliance with the License.
#   You may obtain a copy of the License at

#       http://www.apache.org/licenses/LICENSE-2.0

#   Unless required by applicable law or agreed to in writing, software
#   distributed under the License is distributed on an "AS IS" BASIS,
#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#   See the License for the specific language governing permissions and
#   limitations under the License.

execute if entity @s[tag=ScoreToHealth.AntiGlitch.Protected] run function score_to_health:anti_glitch/modify

execute store result score $_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
scoreboard players operation @s ScoreToHealth < $_ ScoreToHealth
attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-17 "ScoreToHealth" -838.8607 add

execute store result score $_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
execute if score @s ScoreToHealth <= $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-16 "ScoreToHealth" -419.4304 add
execute if score @s ScoreToHealth > $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-16 "ScoreToHealth" 419.4304 add

execute store result score $_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
execute if score @s ScoreToHealth <= $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-15 "ScoreToHealth" -209.7152 add
execute if score @s ScoreToHealth > $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-15 "ScoreToHealth" 209.7152 add

execute store result score $_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
execute if score @s ScoreToHealth <= $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-14 "ScoreToHealth" -104.8576 add
execute if score @s ScoreToHealth > $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-14 "ScoreToHealth" 104.8576 add

execute store result score $_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
execute if score @s ScoreToHealth <= $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-13 "ScoreToHealth" -52.4288 add
execute if score @s ScoreToHealth > $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-13 "ScoreToHealth" 52.4288 add

execute store result score $_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
execute if score @s ScoreToHealth <= $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-12 "ScoreToHealth" -26.2144 add
execute if score @s ScoreToHealth > $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-12 "ScoreToHealth" 26.2144 add

execute store result score $_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
execute if score @s ScoreToHealth <= $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-11 "ScoreToHealth" -13.1072 add
execute if score @s ScoreToHealth > $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-11 "ScoreToHealth" 13.1072 add

execute store result score $_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
execute if score @s ScoreToHealth <= $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-10 "ScoreToHealth" -6.5536 add
execute if score @s ScoreToHealth > $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-10 "ScoreToHealth" 6.5536 add

execute store result score $_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
execute if score @s ScoreToHealth <= $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-0F "ScoreToHealth" -3.2768 add
execute if score @s ScoreToHealth > $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-0F "ScoreToHealth" 3.2768 add

execute store result score $_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
execute if score @s ScoreToHealth <= $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-0E "ScoreToHealth" -1.6384 add
execute if score @s ScoreToHealth > $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-0E "ScoreToHealth" 1.6384 add

execute store result score $_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
execute if score @s ScoreToHealth <= $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-0D "ScoreToHealth" -0.8192 add
execute if score @s ScoreToHealth > $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-0D "ScoreToHealth" 0.8192 add

execute store result score $_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
execute if score @s ScoreToHealth <= $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-0C "ScoreToHealth" -0.4096 add
execute if score @s ScoreToHealth > $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-0C "ScoreToHealth" 0.4096 add

execute store result score $_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
execute if score @s ScoreToHealth <= $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-0B "ScoreToHealth" -0.2048 add
execute if score @s ScoreToHealth > $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-0B "ScoreToHealth" 0.2048 add

execute store result score $_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
execute if score @s ScoreToHealth <= $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-0A "ScoreToHealth" -0.1024 add
execute if score @s ScoreToHealth > $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-0A "ScoreToHealth" 0.1024 add

execute store result score $_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
execute if score @s ScoreToHealth <= $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-09 "ScoreToHealth" -0.0512 add
execute if score @s ScoreToHealth > $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-09 "ScoreToHealth" 0.0512 add

execute store result score $_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
execute if score @s ScoreToHealth <= $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-08 "ScoreToHealth" -0.0256 add
execute if score @s ScoreToHealth > $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-08 "ScoreToHealth" 0.0256 add

execute store result score $_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
execute if score @s ScoreToHealth <= $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-07 "ScoreToHealth" -0.0128 add
execute if score @s ScoreToHealth > $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-07 "ScoreToHealth" 0.0128 add

execute store result score $_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
execute if score @s ScoreToHealth <= $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-06 "ScoreToHealth" -0.0064 add
execute if score @s ScoreToHealth > $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-06 "ScoreToHealth" 0.0064 add

execute store result score $_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
execute if score @s ScoreToHealth <= $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-05 "ScoreToHealth" -0.0032 add
execute if score @s ScoreToHealth > $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-05 "ScoreToHealth" 0.0032 add

execute store result score $_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
execute if score @s ScoreToHealth <= $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-04 "ScoreToHealth" -0.0016 add
execute if score @s ScoreToHealth > $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-04 "ScoreToHealth" 0.0016 add

execute store result score $_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
execute if score @s ScoreToHealth <= $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-03 "ScoreToHealth" -0.0008 add
execute if score @s ScoreToHealth > $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-03 "ScoreToHealth" 0.0008 add

execute store result score $_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
execute if score @s ScoreToHealth <= $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-02 "ScoreToHealth" -0.0004 add
execute if score @s ScoreToHealth > $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-02 "ScoreToHealth" 0.0004 add

execute store result score $_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
execute if score @s ScoreToHealth <= $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-01 "ScoreToHealth" -0.0002 add
execute if score @s ScoreToHealth > $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-01 "ScoreToHealth" 0.0002 add

execute store result score $_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
execute if score @s ScoreToHealth <= $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-00 "ScoreToHealth" -0.0001 add
execute if score @s ScoreToHealth > $_ ScoreToHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-00 "ScoreToHealth" 0.0001 add

effect give @s minecraft:instant_health 1 252 true
tag @s add ScoreToHealth.Modified
scoreboard players reset @s ScoreToHealth


text:
#   Copyright © 2020 赤石愛

#   Licensed under the Apache License, Version 2.0 (the "License");
#   you may not use this file except in compliance with the License.
#   You may obtain a copy of the License at

#       http://www.apache.org/licenses/LICENSE-2.0

#   Unless required by applicable law or agreed to in writing, software
#   distributed under the License is distributed on an "AS IS" BASIS,
#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#   See the License for the specific language governing permissions and
#   limitations under the License.

#> ObjectDeclare
# @within *
#   score_to_health:**
#   lib:score_to_health_wrapper/**
#   lib:has_health_modify_score
#   player_manager:bonus/**
#   core:handler/first_join
    scoreboard objectives add ScoreToHealth dummy {"text":"プレイヤーをこの体力にする(*0.01HP)"}
    scoreboard objectives add ScoreToMaxHealth dummy {"text":"プレイヤーをこの最大体力にする(*0.0001HP)"}

#> PrivateUse
# @internal
    #declare tag ScoreToHealth.AntiGlitch.UnsafeTick
    #declare tag ScoreToHealth.AntiGlitch.Protected
    #declare tag ScoreToHealth.Modified
    #declare tag ScoreToHealth.Return
    scoreboard objectives add STMHBackup dummy {"text":"ScoreToMaxHealthのBackup"}

#> RespawnCheck
# @within function core:handler/respawn
#declare objective STMHBackup


text:
#   Copyright © 2020 赤石愛

#   Licensed under the Apache License, Version 2.0 (the "License");
#   you may not use this file except in compliance with the License.
#   You may obtain a copy of the License at

#       http://www.apache.org/licenses/LICENSE-2.0

#   Unless required by applicable law or agreed to in writing, software
#   distributed under the License is distributed on an "AS IS" BASIS,
#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#   See the License for the specific language governing permissions and
#   limitations under the License.

execute store result score $_ ScoreToHealth run attribute @s minecraft:generic.max_health get 100
function api:data_get/health
execute store result score $__ ScoreToHealth run data get storage api: Health 100
scoreboard players operation $__ ScoreToHealth -= $_ ScoreToHealth

execute if score $__ ScoreToHealth matches ..0 unless entity @s[tag=ScoreToHealth.AntiGlitch.UnsafeTick] run function score_to_health:modify
tag @s remove ScoreToHealth.AntiGlitch.UnsafeTick
execute if score $__ ScoreToHealth matches 1.. run function score_to_health:anti_glitch/protect


text:
#   Copyright © 2020 赤石愛

#   Licensed under the Apache License, Version 2.0 (the "License");
#   you may not use this file except in compliance with the License.
#   You may obtain a copy of the License at

#       http://www.apache.org/licenses/LICENSE-2.0

#   Unless required by applicable law or agreed to in writing, software
#   distributed under the License is distributed on an "AS IS" BASIS,
#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#   See the License for the specific language governing permissions and
#   limitations under the License.

attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0002-17
attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0002-16
attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0002-15
attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0002-14
attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0002-13
attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0002-12
attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0002-11
attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0002-10
attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0002-0F
attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0002-0E
attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0002-0D
attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0002-0C
attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0002-0B
attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0002-0A
attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0002-09
attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0002-08
attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0002-07
attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0002-06
attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0002-05
attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0002-04
attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0002-03
attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0002-02
attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0002-01
attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0002-00

execute store result score $_ ScoreToMaxHealth run attribute @s generic.max_health base get 10000

scoreboard players operation $__ ScoreToMaxHealth = $_ ScoreToMaxHealth

execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-17 "ScoreToMaxHealth" -838.8607 add
execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run scoreboard players remove $__ ScoreToMaxHealth 8388607
execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-17 "ScoreToMaxHealth" 838.8607 add
execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run scoreboard players add $__ ScoreToMaxHealth 8388607
scoreboard players operation $_ ScoreToMaxHealth = $__ ScoreToMaxHealth

execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-16 "ScoreToMaxHealth" -419.4304 add
execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run scoreboard players remove $__ ScoreToMaxHealth 4194304
execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-16 "ScoreToMaxHealth" 419.4304 add
execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run scoreboard players add $__ ScoreToMaxHealth 4194304
scoreboard players operation $_ ScoreToMaxHealth = $__ ScoreToMaxHealth

execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-15 "ScoreToMaxHealth" -209.7152 add
execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run scoreboard players remove $__ ScoreToMaxHealth 2097152
execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-15 "ScoreToMaxHealth" 209.7152 add
execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run scoreboard players add $__ ScoreToMaxHealth 2097152
scoreboard players operation $_ ScoreToMaxHealth = $__ ScoreToMaxHealth

execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-14 "ScoreToMaxHealth" -104.8576 add
execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run scoreboard players remove $__ ScoreToMaxHealth 1048576
execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-14 "ScoreToMaxHealth" 104.8576 add
execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run scoreboard players add $__ ScoreToMaxHealth 1048576
scoreboard players operation $_ ScoreToMaxHealth = $__ ScoreToMaxHealth

execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-13 "ScoreToMaxHealth" -52.4288 add
execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run scoreboard players remove $__ ScoreToMaxHealth 524288
execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-13 "ScoreToMaxHealth" 52.4288 add
execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run scoreboard players add $__ ScoreToMaxHealth 524288
scoreboard players operation $_ ScoreToMaxHealth = $__ ScoreToMaxHealth

execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-12 "ScoreToMaxHealth" -26.2144 add
execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run scoreboard players remove $__ ScoreToMaxHealth 262144
execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-12 "ScoreToMaxHealth" 26.2144 add
execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run scoreboard players add $__ ScoreToMaxHealth 262144
scoreboard players operation $_ ScoreToMaxHealth = $__ ScoreToMaxHealth

execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-11 "ScoreToMaxHealth" -13.1072 add
execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run scoreboard players remove $__ ScoreToMaxHealth 131072
execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-11 "ScoreToMaxHealth" 13.1072 add
execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run scoreboard players add $__ ScoreToMaxHealth 131072
scoreboard players operation $_ ScoreToMaxHealth = $__ ScoreToMaxHealth

execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-10 "ScoreToMaxHealth" -6.5536 add
execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run scoreboard players remove $__ ScoreToMaxHealth 65536
execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-10 "ScoreToMaxHealth" 6.5536 add
execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run scoreboard players add $__ ScoreToMaxHealth 65536
scoreboard players operation $_ ScoreToMaxHealth = $__ ScoreToMaxHealth

execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-0F "ScoreToMaxHealth" -3.2768 add
execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run scoreboard players remove $__ ScoreToMaxHealth 32768
execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-0F "ScoreToMaxHealth" 3.2768 add
execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run scoreboard players add $__ ScoreToMaxHealth 32768
scoreboard players operation $_ ScoreToMaxHealth = $__ ScoreToMaxHealth

execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-0E "ScoreToMaxHealth" -1.6384 add
execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run scoreboard players remove $__ ScoreToMaxHealth 16384
execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-0E "ScoreToMaxHealth" 1.6384 add
execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run scoreboard players add $__ ScoreToMaxHealth 16384
scoreboard players operation $_ ScoreToMaxHealth = $__ ScoreToMaxHealth

execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-0D "ScoreToMaxHealth" -0.8192 add
execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run scoreboard players remove $__ ScoreToMaxHealth 8192
execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-0D "ScoreToMaxHealth" 0.8192 add
execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run scoreboard players add $__ ScoreToMaxHealth 8192
scoreboard players operation $_ ScoreToMaxHealth = $__ ScoreToMaxHealth

execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-0C "ScoreToMaxHealth" -0.4096 add
execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run scoreboard players remove $__ ScoreToMaxHealth 4096
execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-0C "ScoreToMaxHealth" 0.4096 add
execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run scoreboard players add $__ ScoreToMaxHealth 4096
scoreboard players operation $_ ScoreToMaxHealth = $__ ScoreToMaxHealth

execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-0B "ScoreToMaxHealth" -0.2048 add
execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run scoreboard players remove $__ ScoreToMaxHealth 2048
execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-0B "ScoreToMaxHealth" 0.2048 add
execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run scoreboard players add $__ ScoreToMaxHealth 2048
scoreboard players operation $_ ScoreToMaxHealth = $__ ScoreToMaxHealth

execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-0A "ScoreToMaxHealth" -0.1024 add
execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run scoreboard players remove $__ ScoreToMaxHealth 1024
execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-0A "ScoreToMaxHealth" 0.1024 add
execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run scoreboard players add $__ ScoreToMaxHealth 1024
scoreboard players operation $_ ScoreToMaxHealth = $__ ScoreToMaxHealth

execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-09 "ScoreToMaxHealth" -0.0512 add
execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run scoreboard players remove $__ ScoreToMaxHealth 0512
execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-09 "ScoreToMaxHealth" 0.0512 add
execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run scoreboard players add $__ ScoreToMaxHealth 0512
scoreboard players operation $_ ScoreToMaxHealth = $__ ScoreToMaxHealth

execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-08 "ScoreToMaxHealth" -0.0256 add
execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run scoreboard players remove $__ ScoreToMaxHealth 0256
execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-08 "ScoreToMaxHealth" 0.0256 add
execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run scoreboard players add $__ ScoreToMaxHealth 0256
scoreboard players operation $_ ScoreToMaxHealth = $__ ScoreToMaxHealth

execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-07 "ScoreToMaxHealth" -0.0128 add
execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run scoreboard players remove $__ ScoreToMaxHealth 0128
execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-07 "ScoreToMaxHealth" 0.0128 add
execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run scoreboard players add $__ ScoreToMaxHealth 0128
scoreboard players operation $_ ScoreToMaxHealth = $__ ScoreToMaxHealth

execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-06 "ScoreToMaxHealth" -0.0064 add
execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run scoreboard players remove $__ ScoreToMaxHealth 0064
execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-06 "ScoreToMaxHealth" 0.0064 add
execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run scoreboard players add $__ ScoreToMaxHealth 0064
scoreboard players operation $_ ScoreToMaxHealth = $__ ScoreToMaxHealth

execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-05 "ScoreToMaxHealth" -0.0032 add
execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run scoreboard players remove $__ ScoreToMaxHealth 0032
execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-05 "ScoreToMaxHealth" 0.0032 add
execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run scoreboard players add $__ ScoreToMaxHealth 0032
scoreboard players operation $_ ScoreToMaxHealth = $__ ScoreToMaxHealth

execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-04 "ScoreToMaxHealth" -0.0016 add
execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run scoreboard players remove $__ ScoreToMaxHealth 0016
execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-04 "ScoreToMaxHealth" 0.0016 add
execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run scoreboard players add $__ ScoreToMaxHealth 0016
scoreboard players operation $_ ScoreToMaxHealth = $__ ScoreToMaxHealth

execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-03 "ScoreToMaxHealth" -0.0008 add
execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run scoreboard players remove $__ ScoreToMaxHealth 0008
execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-03 "ScoreToMaxHealth" 0.0008 add
execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run scoreboard players add $__ ScoreToMaxHealth 0008
scoreboard players operation $_ ScoreToMaxHealth = $__ ScoreToMaxHealth

execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-02 "ScoreToMaxHealth" -0.0004 add
execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run scoreboard players remove $__ ScoreToMaxHealth 0004
execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-02 "ScoreToMaxHealth" 0.0004 add
execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run scoreboard players add $__ ScoreToMaxHealth 0004
scoreboard players operation $_ ScoreToMaxHealth = $__ ScoreToMaxHealth

execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-01 "ScoreToMaxHealth" -0.0002 add
execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run scoreboard players remove $__ ScoreToMaxHealth 0002
execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-01 "ScoreToMaxHealth" 0.0002 add
execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run scoreboard players add $__ ScoreToMaxHealth 0002
scoreboard players operation $_ ScoreToMaxHealth = $__ ScoreToMaxHealth

execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-00 "ScoreToMaxHealth" -0.0001 add
execute if score @s ScoreToMaxHealth <= $_ ScoreToMaxHealth run scoreboard players remove $__ ScoreToMaxHealth 0001
execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0002-00 "ScoreToMaxHealth" 0.0001 add
execute if score @s ScoreToMaxHealth > $_ ScoreToMaxHealth run scoreboard players add $__ ScoreToMaxHealth 0001

effect give @s minecraft:instant_health 1 252 true
scoreboard players operation @s STMHBackup = @s ScoreToMaxHealth
tag @s add ScoreToHealth.Return


text:
#   Copyright © 2020 赤石愛

#   Licensed under the Apache License, Version 2.0 (the "License");
#   you may not use this file except in compliance with the License.
#   You may obtain a copy of the License at

#       http://www.apache.org/licenses/LICENSE-2.0

#   Unless required by applicable law or agreed to in writing, software
#   distributed under the License is distributed on an "AS IS" BASIS,
#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#   See the License for the specific language governing permissions and
#   limitations under the License.

execute if entity @s[tag=ScoreToHealth.Modified] run function score_to_health:restore
execute unless score @s STMHBackup matches -2147483648.. run scoreboard players set @s ScoreToMaxHealth 200000
execute unless score @s STMHBackup matches -2147483648.. run scoreboard players set @s STMHBackup 200000
execute if entity @s[tag=!ScoreToHealth.Return,tag=!ScoreToHealth.AntiGlitch.UnsafeTick] unless score @s ScoreToMaxHealth = @s STMHBackup run function score_to_health:modify_max_health
execute unless entity @s[tag=ScoreToHealth.Return] if score @s ScoreToHealth matches -2147483648.. run function score_to_health:check
tag @s[tag=ScoreToHealth.Return] remove ScoreToHealth.Return
advancement revoke @s only score_to_health:player_tick


text:
#   Copyright © 2020 赤石愛

#   Licensed under the Apache License, Version 2.0 (the "License");
#   you may not use this file except in compliance with the License.
#   You may obtain a copy of the License at

#       http://www.apache.org/licenses/LICENSE-2.0

#   Unless required by applicable law or agreed to in writing, software
#   distributed under the License is distributed on an "AS IS" BASIS,
#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#   See the License for the specific language governing permissions and
#   limitations under the License.

function score_to_health:anti_glitch/restore

attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0001-17
attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0001-16
attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0001-15
attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0001-14
attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0001-13
attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0001-12
attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0001-11
attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0001-10
attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0001-0F
attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0001-0E
attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0001-0D
attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0001-0C
attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0001-0B
attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0001-0A
attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0001-09
attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0001-08
attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0001-07
attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0001-06
attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0001-05
attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0001-04
attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0001-03
attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0001-02
attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0001-01
attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0001-00

function score_to_health:anti_glitch/unprotect

tag @s remove ScoreToHealth.Modified
tag @s add ScoreToHealth.Return


text:
#   Copyright © 2020 赤石愛

#   Licensed under the Apache License, Version 2.0 (the "License");
#   you may not use this file except in compliance with the License.
#   You may obtain a copy of the License at

#       http://www.apache.org/licenses/LICENSE-2.0

#   Unless required by applicable law or agreed to in writing, software
#   distributed under the License is distributed on an "AS IS" BASIS,
#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#   See the License for the specific language governing permissions and
#   limitations under the License.

attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-1F "ScoreToHealth" -100000 add


text:
#   Copyright © 2020 赤石愛

#   Licensed under the Apache License, Version 2.0 (the "License");
#   you may not use this file except in compliance with the License.
#   You may obtain a copy of the License at

#       http://www.apache.org/licenses/LICENSE-2.0

#   Unless required by applicable law or agreed to in writing, software
#   distributed under the License is distributed on an "AS IS" BASIS,
#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#   See the License for the specific language governing permissions and
#   limitations under the License.

attribute @s minecraft:generic.max_health modifier add bab7cdc2-fb6a-47f6-0001-FF "ScoreToHealth" 100000 add
tag @s add ScoreToHealth.AntiGlitch.Protected
tag @s add ScoreToHealth.AntiGlitch.UnsafeTick


text:
#   Copyright © 2020 赤石愛

#   Licensed under the Apache License, Version 2.0 (the "License");
#   you may not use this file except in compliance with the License.
#   You may obtain a copy of the License at

#       http://www.apache.org/licenses/LICENSE-2.0

#   Unless required by applicable law or agreed to in writing, software
#   distributed under the License is distributed on an "AS IS" BASIS,
#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#   See the License for the specific language governing permissions and
#   limitations under the License.

attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0001-1F


text:
#   Copyright © 2020 赤石愛

#   Licensed under the Apache License, Version 2.0 (the "License");
#   you may not use this file except in compliance with the License.
#   You may obtain a copy of the License at

#       http://www.apache.org/licenses/LICENSE-2.0

#   Unless required by applicable law or agreed to in writing, software
#   distributed under the License is distributed on an "AS IS" BASIS,
#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#   See the License for the specific language governing permissions and
#   limitations under the License.

attribute @s minecraft:generic.max_health modifier remove bab7cdc2-fb6a-47f6-0001-FF
tag @s remove ScoreToHealth.AntiGlitch.Protected


text:
# Oh! My Dat!
Minecraft Private Storage Datapack
個別ストレージデータパック

# 使い方/How To Use

## 基本 / Basics

```
個別ストレージを使いたいエンティティで次を実行するだけ！ / Run the following command as the entity you want to use private storage for.
function oh_my_dat:please

アクセス / Access
data get storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].DataName

書き換え / Modify
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].DataName set value DataValue

消去 / Delete
data remove storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].DataName
```

## 既知のストレージにIDでアクセスしたい場合 / If you want to use known storage by storage ID

```
scoreboard players set $ OhMyDatID <ID>
function oh_its_dat:please
```

## 明示的にストレージを解放する / Explicitly free storage

他のデータパックのデータが入っている可能性があるため、データパックから呼び出さないでください。
Do not call from a datapack because it may contain data of another datapack.
```
ストレージを解放したいエンティティで次を実行 / Run the following command as the entity you want to free private storage for.
function oh_my_dat:release
```

# 連絡はこちら/Contact

https://twitter.com/AiAkaishi

# ライセンス/LICENSE

These codes are released under the MIT License, see LICENSE.


text:
### Copyright © 2020 赤石愛
### This software is released under the MIT License, see LICENSE.

### 指定されたエンティティ(@s)の個別ストレージを提供(特定のオフセットで呼び出せるように)する

# IDを持っていなければ、IDを割り当て
execute unless score @s OhMyDatID matches 1.. run function oh_my_dat:sys/allocate
# IDを一時変数にコピー
execute unless score @s OhMyDatID = $LatestProvidedID OhMyDatID run scoreboard players operation $ OhMyDatID = @s OhMyDatID
# ストレージ提供
execute unless score @s OhMyDatID = $LatestProvidedID OhMyDatID run function oh_my_dat:sys/provide


text:
### Copyright © 2020 赤石愛
### This software is released under the MIT License, see LICENSE.

### 個別ストレージを放棄

# データを削除
execute if score @s OhMyDatID matches 1.. run function oh_my_dat:please
execute if score @s OhMyDatID matches 1.. run data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4] set value {}
# IDを削除
scoreboard players reset @s OhMyDatID


text:
### Copyright © 2020 赤石愛
### This software is released under the MIT License, see LICENSE.

# 最後に呼び出したIDを記録する
scoreboard players operation $LatestProvidedID OhMyDatID = $ OhMyDatID

### 指定されたエンティティのデータを、特定のオフセットで呼び出せるようにする

# シフト  (reset->1->     2->     3->     4->     5->     6->     7->     8)
# チェック(           2->     3->     4->     5->     6->     7->     8->  )

# reset
data remove storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][6]
data remove storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][5]
data remove storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][4]
data remove storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][6]
data remove storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][5]
data remove storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][4]
data remove storage oh_my_dat: _[-4][-4][-4][-4][-4][6]
data remove storage oh_my_dat: _[-4][-4][-4][-4][-4][5]
data remove storage oh_my_dat: _[-4][-4][-4][-4][-4][4]
data remove storage oh_my_dat: _[-4][-4][-4][-4][6]
data remove storage oh_my_dat: _[-4][-4][-4][-4][5]
data remove storage oh_my_dat: _[-4][-4][-4][-4][4]
data remove storage oh_my_dat: _[-4][-4][-4][6]
data remove storage oh_my_dat: _[-4][-4][-4][5]
data remove storage oh_my_dat: _[-4][-4][-4][4]
data remove storage oh_my_dat: _[-4][-4][6]
data remove storage oh_my_dat: _[-4][-4][5]
data remove storage oh_my_dat: _[-4][-4][4]
data remove storage oh_my_dat: _[-4][6]
data remove storage oh_my_dat: _[-4][5]
data remove storage oh_my_dat: _[-4][4]
data remove storage oh_my_dat: _[6]
data remove storage oh_my_dat: _[5]
data remove storage oh_my_dat: _[4]

# ストレージシフト１
scoreboard players set $ OhMyDat 65536
scoreboard players operation $ OhMyDatID *= $ OhMyDat
# 01....
execute if score $ OhMyDatID matches 1073741824.. run data modify storage oh_my_dat: _ append value []
# 10....
execute if score $ OhMyDatID matches ..-1073741825 run data modify storage oh_my_dat: _ append from storage oh_my_dat: two_empty_lists[]
# 11....
execute if score $ OhMyDatID matches -1073741824..-1 run data modify storage oh_my_dat: _ append from storage oh_my_dat: three_empty_lists[]

# ストレージチェック２
execute unless data storage oh_my_dat: _[-4][0] run data modify storage oh_my_dat: _[-4] set from storage oh_my_dat: initial[0]
# ストレージシフト２
scoreboard players operation $ OhMyDatID += $ OhMyDatID
scoreboard players operation $ OhMyDatID += $ OhMyDatID
# 01....
execute if score $ OhMyDatID matches 1073741824.. run data modify storage oh_my_dat: _[-4] append value []
# 10....
execute if score $ OhMyDatID matches ..-1073741825 run data modify storage oh_my_dat: _[-4] append from storage oh_my_dat: two_empty_lists[]
# 11....
execute if score $ OhMyDatID matches -1073741824..-1 run data modify storage oh_my_dat: _[-4] append from storage oh_my_dat: three_empty_lists[]

# ストレージチェック３
execute unless data storage oh_my_dat: _[-4][-4][0] run data modify storage oh_my_dat: _[-4][-4] set from storage oh_my_dat: initial[0][0]
# ストレージシフト３
scoreboard players operation $ OhMyDatID += $ OhMyDatID
scoreboard players operation $ OhMyDatID += $ OhMyDatID
# 01....
execute if score $ OhMyDatID matches 1073741824.. run data modify storage oh_my_dat: _[-4][-4] append value []
# 10....
execute if score $ OhMyDatID matches ..-1073741825 run data modify storage oh_my_dat: _[-4][-4] append from storage oh_my_dat: two_empty_lists[]
# 11....
execute if score $ OhMyDatID matches -1073741824..-1 run data modify storage oh_my_dat: _[-4][-4] append from storage oh_my_dat: three_empty_lists[]

# ストレージチェック４
execute unless data storage oh_my_dat: _[-4][-4][-4][0] run data modify storage oh_my_dat: _[-4][-4][-4] set from storage oh_my_dat: initial[0][0][0]
# ストレージシフト４
scoreboard players operation $ OhMyDatID += $ OhMyDatID
scoreboard players operation $ OhMyDatID += $ OhMyDatID
# 01....
execute if score $ OhMyDatID matches 1073741824.. run data modify storage oh_my_dat: _[-4][-4][-4] append value []
# 10....
execute if score $ OhMyDatID matches ..-1073741825 run data modify storage oh_my_dat: _[-4][-4][-4] append from storage oh_my_dat: two_empty_lists[]
# 11....
execute if score $ OhMyDatID matches -1073741824..-1 run data modify storage oh_my_dat: _[-4][-4][-4] append from storage oh_my_dat: three_empty_lists[]

# ストレージチェック５
execute unless data storage oh_my_dat: _[-4][-4][-4][-4][0] run data modify storage oh_my_dat: _[-4][-4][-4][-4] set from storage oh_my_dat: initial[0][0][0][0]
# ストレージシフト５
scoreboard players operation $ OhMyDatID += $ OhMyDatID
scoreboard players operation $ OhMyDatID += $ OhMyDatID
# 01....
execute if score $ OhMyDatID matches 1073741824.. run data modify storage oh_my_dat: _[-4][-4][-4][-4] append value []
# 10....
execute if score $ OhMyDatID matches ..-1073741825 run data modify storage oh_my_dat: _[-4][-4][-4][-4] append from storage oh_my_dat: two_empty_lists[]
# 11....
execute if score $ OhMyDatID matches -1073741824..-1 run data modify storage oh_my_dat: _[-4][-4][-4][-4] append from storage oh_my_dat: three_empty_lists[]

# ストレージチェック６
execute unless data storage oh_my_dat: _[-4][-4][-4][-4][-4][0] run data modify storage oh_my_dat: _[-4][-4][-4][-4][-4] set from storage oh_my_dat: initial[0][0][0][0][0]
# ストレージシフト６
scoreboard players operation $ OhMyDatID += $ OhMyDatID
scoreboard players operation $ OhMyDatID += $ OhMyDatID
# 01....
execute if score $ OhMyDatID matches 1073741824.. run data modify storage oh_my_dat: _[-4][-4][-4][-4][-4] append value []
# 10....
execute if score $ OhMyDatID matches ..-1073741825 run data modify storage oh_my_dat: _[-4][-4][-4][-4][-4] append from storage oh_my_dat: two_empty_lists[]
# 11....
execute if score $ OhMyDatID matches -1073741824..-1 run data modify storage oh_my_dat: _[-4][-4][-4][-4][-4] append from storage oh_my_dat: three_empty_lists[]

# ストレージチェック７
execute unless data storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][0] run data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4] set from storage oh_my_dat: initial[0][0][0][0][0][0]
# ストレージシフト７
scoreboard players operation $ OhMyDatID += $ OhMyDatID
scoreboard players operation $ OhMyDatID += $ OhMyDatID
# 01....
execute if score $ OhMyDatID matches 1073741824.. run data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4] append value []
# 10....
execute if score $ OhMyDatID matches ..-1073741825 run data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4] append from storage oh_my_dat: two_empty_lists[]
# 11....
execute if score $ OhMyDatID matches -1073741824..-1 run data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4] append from storage oh_my_dat: three_empty_lists[]

# ストレージチェック８
execute unless data storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][0] run data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4] set from storage oh_my_dat: initial[0][0][0][0][0][0][0]
# ストレージシフト８
scoreboard players operation $ OhMyDatID += $ OhMyDatID
scoreboard players operation $ OhMyDatID += $ OhMyDatID
# 01....
execute if score $ OhMyDatID matches 1073741824.. run data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4] append value {}
# 10....
execute if score $ OhMyDatID matches ..-1073741825 run data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4] append from storage oh_my_dat: two_empty_maps[]
# 11....
execute if score $ OhMyDatID matches -1073741824..-1 run data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4] append from storage oh_my_dat: three_empty_maps[]


text:
### Copyright © 2020 赤石愛
### This software is released under the MIT License, see LICENSE.

### データパックが初期化されていなければ、初期化する
execute unless data storage oh_my_dat: _ run function oh_my_dat:sys/init


text:
### Copyright © 2020 赤石愛
### This software is released under the MIT License, see LICENSE.
### Copyright © 2020 赤石愛
### This software is released under the MIT License, see LICENSE.

### ガベージコレクタ

# 前回存在を確認したIDを移動させる
data modify storage oh_my_dat: id append from storage oh_my_dat: id[0]
data remove storage oh_my_dat: id[0]

# 割り当て済みID[0]以下の最大値を取得(_ IDに入る)
execute store result score $ OhMyDat run data get storage oh_my_dat: id[0]
scoreboard players remove $ OhMyDat 2147483647
scoreboard players set $ OhMyDatID 0
scoreboard players operation * OhMyDatID -= $ OhMyDat
scoreboard players operation $ OhMyDatID > * OhMyDatID
scoreboard players operation * OhMyDatID += $ OhMyDat

# 不要なデータを解放(先頭から続く基準より大きいIDは全部要らない)
scoreboard players operation $ OhMyDat >< $ OhMyDatID
execute store result score $ OhMyDatID run data get storage oh_my_dat: id[0]
execute if score $ OhMyDatID > $ OhMyDat run function oh_my_dat:sys/gc_loop
scoreboard players operation $ OhMyDat >< $ OhMyDatID

# loop while x - next >= 2(prev - x) - 1 (⇔ 3x - 2prev - next + 1 >= 0)
# 2prev
execute store result score $ OhMyDat run data get storage oh_my_dat: id[-1]
execute if score $ OhMyDat matches 0 run scoreboard players add $ OhMyDat 65536
execute if score $ OhMyDatID matches 0 run scoreboard players add $ OhMyDat 65536
execute if score $ OhMyDatID matches 0 run scoreboard players add $ OhMyDatID 65536
scoreboard players operation $ OhMyDat += $ OhMyDat
# 2prev - 2x
scoreboard players operation $ OhMyDat -= $ OhMyDatID
scoreboard players operation $ OhMyDat -= $ OhMyDatID
# 3x - 2prev
scoreboard players operation $ OhMyDatID -= $ OhMyDat
# 3x - 2prev - next
execute store result score $ OhMyDat run data get storage oh_my_dat: id[1]
scoreboard players operation $ OhMyDatID -= $ OhMyDat
execute if score $ OhMyDatID matches -1.. run function oh_my_dat:sys/gc


text:
### Copyright © 2020 赤石愛
### This software is released under the MIT License, see LICENSE.

### IDを新規割り当て

# ごみ掃除(抜けるとid[0]とid[-1]が丁度良いスペースになる)
function oh_my_dat:sys/gc

# id[0] + id[-1] / 2 を割り当てIDに取る
execute store result score $ OhMyDatID run data get storage oh_my_dat: id[-1]
execute store result score $ OhMyDat run data get storage oh_my_dat: id[0]
execute if score $ OhMyDatID matches 0 run scoreboard players set $ OhMyDatID 65536
scoreboard players operation $ OhMyDatID += $ OhMyDat
scoreboard players set $ OhMyDat 2
scoreboard players operation $ OhMyDatID /= $ OhMyDat

# 割り当てIDに追加
data modify storage oh_my_dat: id append value -1
execute store result storage oh_my_dat: id[-1] int 1 run scoreboard players get $ OhMyDatID
# 割り当てる
scoreboard players operation @s OhMyDatID = $ OhMyDatID


text:
### Copyright © 2020 赤石愛
### This software is released under the MIT License, see LICENSE.

### 割り当て解放

# データを削除
function oh_my_dat:sys/provide
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4] set value {}
# 割り当て済みIDを削除
data remove storage oh_my_dat: id[0]
# 不要なデータを解放(先頭から続く基準より大きいIDは全部要らない)
execute store result score $ OhMyDatID run data get storage oh_my_dat: id[0]
execute if score $ OhMyDatID > $ OhMyDat run function oh_my_dat:sys/gc_loop


text:
### Copyright © 2020 赤石愛
### This software is released under the MIT License, see LICENSE.

### このデータパックに必要なものを初期化する

# ストレージシフトに使うデータ
data modify storage oh_my_dat: two_empty_lists set value [[],[]]
data modify storage oh_my_dat: three_empty_lists set value [[],[],[]]
data modify storage oh_my_dat: two_empty_maps set value [{},{}]
data modify storage oh_my_dat: three_empty_maps set value [{},{},{}]
data modify storage oh_my_dat: initial set value [[[[[[[[{},{},{},{}],[],[],[]],[],[],[]],[],[],[]],[],[],[]],[],[],[]],[],[],[]],[],[],[]]
# メインになるストレージ
data modify storage oh_my_dat: _ set from storage oh_my_dat: initial
# 割り当て済みID保存ストレージ
data modify storage oh_my_dat: id set value [0]
# 使用中のIDのSet
data modify storage oh_my_dat: IDSet set value [I;]
#> IDを振るためのスコアボード
# @within function
#   oh_*:**
#   lib:**
#   api:**
#   debug:**
#   core:**
#   asset_manager:**
#   player_manager:**
#   world_manager:**
    #declare storage oh_my_dat:
    scoreboard objectives add OhMyDatID dummy
#> 計算に使うスコアボード
# @within function oh_*:**
    #declare score_holder $LatestProvidedID
    scoreboard objectives add OhMyDat dummy


text:
### Copyright © 2020 赤石愛
### This software is released under the MIT License, see LICENSE.

### 指定された値($ OhMyDatID)の個別ストレージを提供(特定のオフセットで呼び出せるように)する

# ストレージ提供
execute unless score $ OhMyDatID = $LatestProvidedID OhMyDatID run function oh_my_dat:sys/provide


text:
#> asset:island/example/register/register
#
#
#
# @within function asset:island/example/register/

# ID (int)
    data modify storage asset:island ID set value 2147483647
# Rotation (float)
    data modify storage asset:island Rotation set value 0.0f
# BOSS ID (int) (Optional)
    data modify storage asset:island BossID set value 2147483647

function asset:island/common/register


text:
#> asset:island/common/register
#
# 実際の登録処理
#
# @within function asset:island/*/register/register

# パラメータチェック
    execute unless data storage asset:island ID run tellraw @a [{"storage":"global","nbt":"Prefix.ERROR"},{"text":"引数が足りません"},{"text":" ID","color":"red"}]
    execute unless data storage asset:island Rotation run tellraw @a [{"storage":"global","nbt":"Prefix.ERROR"},{"text":"引数が足りません"},{"text":" Rotation","color":"red"}]
# 登録
    function asset_manager:island/register/
# リセット
    data remove storage asset:island ID
    data remove storage asset:island Rotation
    data remove storage asset:island BossID


text:
#> asset:teleporter/example2147483643/register
#
#
#
# @within function asset:teleporter/example2147483643/

# 重複防止レジストリに登録
    data modify storage asset:teleporter DPR append value {D:overworld,X:3389,Y:41,Z:-661}

# ID (int)
    data modify storage asset:teleporter ID set value 2147483643
# GroupID (string)
    data modify storage asset:teleporter GroupID set value "example"
# デフォルトの起動状態 ("InvisibleDeactivate" | "VisibleDeactivate" | "Activate")
    data modify storage asset:teleporter ActivationState set value "Activate"
# 色 ("white" | "aqua")
    data modify storage asset:teleporter Color set value "white"

# 登録
    function asset:teleporter/common/register


text:
#> asset:teleporter/example2147483644/register
#
#
#
# @within function asset:teleporter/example2147483644/

# 重複防止レジストリに登録
    data modify storage asset:teleporter DPR append value {D:overworld,X:8,Y:27,Z:20}

# ID (int)
    data modify storage asset:teleporter ID set value 2147483644
# GroupID (string)
    data modify storage asset:teleporter GroupID set value "example"
# デフォルトの起動状態 ("InvisibleDeactivate" | "VisibleDeactivate" | "Activate")
    data modify storage asset:teleporter ActivationState set value "Activate"
# 色 ("white" | "aqua")
    data modify storage asset:teleporter Color set value "white"

# 登録
    function asset:teleporter/common/register


text:
#> asset:teleporter/example2147483645/register
#
#
#
# @within function asset:teleporter/example2147483645/

# 重複防止レジストリに登録
    data modify storage asset:teleporter DPR append value {D:overworld,X:-13,Y:16,Z:34}

# ID (int)
    data modify storage asset:teleporter ID set value 2147483645
# GroupID (string)
    data modify storage asset:teleporter GroupID set value "example"
# デフォルトの起動状態 ("InvisibleDeactivate" | "VisibleDeactivate" | "Activate")
    data modify storage asset:teleporter ActivationState set value "Activate"
# 色 ("white" | "aqua")
    data modify storage asset:teleporter Color set value "white"

# 登録
    function asset:teleporter/common/register