
# -> Get Pseudo-randomized values
$data modify storage overly_realistic:player_attributes current_attributes.entity_block_interaction_range set from storage overly_realistic:player_attributes spawn_modifiers.entity_block_interaction_range[$(generic_value_0)]
$data modify storage overly_realistic:player_attributes current_attributes.movement_speed set from storage overly_realistic:player_attributes spawn_modifiers.movement_speed[$(generic_value_1)]
$data modify storage overly_realistic:player_attributes current_attributes.attack_damage set from storage overly_realistic:player_attributes spawn_modifiers.attack_damage[$(generic_value_2)]
$data modify storage overly_realistic:player_attributes current_attributes.attack_speed set from storage overly_realistic:player_attributes spawn_modifiers.attack_speed[$(generic_value_3)]
$data modify storage overly_realistic:player_attributes current_attributes.block_break_speed set from storage overly_realistic:player_attributes spawn_modifiers.block_break_speed[$(generic_value_4)]
$data modify storage overly_realistic:player_attributes current_attributes.sneaking_speed set from storage overly_realistic:player_attributes spawn_modifiers.sneaking_speed[$(generic_value_5)]
$data modify storage overly_realistic:player_attributes current_attributes.scale set from storage overly_realistic:player_attributes spawn_modifiers.scale[$(generic_value_6)]
$data modify storage overly_realistic:player_attributes current_attributes.max_health set from storage overly_realistic:player_attributes spawn_modifiers.max_health[$(generic_value_7)]

# -> Normalization
execute if predicate overly_realistic:player/misc/genetics_normalize_rng run \
    data modify storage overly_realistic:player_attributes current_attributes.entity_block_interaction_range set from storage overly_realistic:player_attributes spawn_modifiers.entity_block_interaction_range[4]
execute if predicate overly_realistic:player/misc/genetics_normalize_rng run \
    data modify storage overly_realistic:player_attributes current_attributes.movement_speed set from storage overly_realistic:player_attributes spawn_modifiers.movement_speed[4]
execute if predicate overly_realistic:player/misc/genetics_normalize_rng run \
    data modify storage overly_realistic:player_attributes current_attributes.attack_damage set from storage overly_realistic:player_attributes spawn_modifiers.attack_damage[4]
execute if predicate overly_realistic:player/misc/genetics_normalize_rng run \
    data modify storage overly_realistic:player_attributes current_attributes.attack_speed set from storage overly_realistic:player_attributes spawn_modifiers.attack_speed[4]
execute if predicate overly_realistic:player/misc/genetics_normalize_rng run \
    data modify storage overly_realistic:player_attributes current_attributes.block_break_speed set from storage overly_realistic:player_attributes spawn_modifiers.block_break_speed[4]
execute if predicate overly_realistic:player/misc/genetics_normalize_rng run \
    data modify storage overly_realistic:player_attributes current_attributes.sneaking_speed set from storage overly_realistic:player_attributes spawn_modifiers.sneaking_speed[4]
execute if predicate overly_realistic:player/misc/genetics_normalize_rng run \
    data modify storage overly_realistic:player_attributes current_attributes.scale set from storage overly_realistic:player_attributes spawn_modifiers.scale[4]
execute if predicate overly_realistic:player/misc/genetics_normalize_rng run \
    data modify storage overly_realistic:player_attributes current_attributes.max_health set from storage overly_realistic:player_attributes spawn_modifiers.max_health[4]

# -> Apply attributes
function overly_realistic:players/custom_data/apply_random_data with storage overly_realistic:player_attributes current_attributes