我的世界 │ 百分比血量 │ 教程

血量積分版
/scoreboard objectives add hp dummy
scoreboard objectives add hpmax dummy
scoreboard objectives add hpjs dummy
scoreboard objectives add hpa dummy
scoreboard objectives add hpb dummy
護(hù)甲積分版
scoreboard objectives add hj dummy
scoreboard objectives add hjmax dummy
scoreboard objectives add hja dummy
scoreboard objectives add hjjs dummy
scoreboard objectives add hjb dummy
前置指令
scoreboard objectives add g dummy
scoreboard players set ten g 10
護(hù)甲
execute @e[tag=sx] ~ ~ ~ scoreboard players operation @s hjmax = max hj
execute @e ~ ~ ~ scoreboard players operation @s hjjs = @s hjmax
execute @e ~ ~ ~ scoreboard players operation @s hjjs -= @s hj
execute @e[scores={hjjs=..-1}] ~ ~ ~ scoreboard players operation @s hj = @s hjmax
execute @e ~ ~ ~ scoreboard players operation @s hjb = @s hjmax
execute @e ~ ~ ~ scoreboard players operation @s hjb /= @s ten g
execute @e ~ ~ ~ scoreboard players operation @s hja = @s hj
execute @e ~ ~ ~ scoreboard players operation @s hja /= @s hjb
血量
execute @e[tag=sx] ~ ~ ~ scoreboard players operation @s hpmax = max hp
execute @e ~ ~ ~ scoreboard players operation @s hpjs = @s hpmax
execute @e ~ ~ ~ scoreboard players operation @s hpjs -= @s hp
execute @e[scores={hpjs=..-1}] ~ ~ ~ scoreboard players operation @s hp = @s hpmax
execute @e ~ ~ ~ scoreboard players operation @s hpb = @s hpmax
execute @e ~ ~ ~ scoreboard players operation @s hpb /= @s ten g
execute @e ~ ~ ~ scoreboard players operation @s hpa = @s hp
execute @e ~ ~ ~ scoreboard players operation @s hpa /= @s hpb
scoreboard players set @e[scores={hpa=0}] hp 99999
kill @e[scores={hpa=..0},tag=sx]
最后求個(gè)三連
(求求了)