
# -> Tag player
tag @s add OverlyRealistic.Player.RestoredModifiersPostDeath

# -> Re-apply death attributes
attribute @s movement_speed modifier add overly_realistic:downed_player_movement_speed -100.0 add_value
attribute @s jump_strength modifier add overly_realistic:downed_player_jump_strength -100.0 add_value
attribute @s gravity base set 0

# -> Reset attribute data
data modify storage overly_realistic:player_attributes local_pre_death_attributes set value []

# -> Save last attributes to storage
item replace entity 00000001-0000-002b-0000-00010000002b contents from entity @s armor.body
data modify storage overly_realistic:player_attributes local_pre_death_attributes set from entity 00000001-0000-002b-0000-00010000002b item.components.minecraft:custom_data.attribute_modifiers_on_death

# -> Start loop
function overly_realistic:general/downing/attribute_restoration/restoration_loop