Files
data
pack.mcmeta
Code
13 77
data/staminabar/functions/player/tick.mcfunction
scoreboard players set @s jump_delta 0
execute if score @s jump_stat matches 0.. run scoreboard players operation @s jump_delta = @s jump_stat
execute if score @s jump_stat matches 0.. if score @s jump_last matches 0.. run scoreboard players operation @s jump_delta -= @s jump_last
execute if score @s jump_stat matches 0.. run scoreboard players operation @s jump_last = @s jump_stat
execute if score @s exhausted matches 0 if score @s jump_delta matches 1.. run function staminabar:player/jump
execute if score @s exhausted matches 1.. run function staminabar:player/recover_locked
execute if score @s exhausted matches 0 run function staminabar:player/active
title @s actionbar {"text":"Stamina: ","color":"gold","extra":[{"score":{"name":"*","objective":"stamina"},"color":"yellow"},{"text":" / 800","color":"yellow"}]}