
# -> Randomize location
spreadplayers ~ ~ 30 30 false @s

# -> If prop is above an unwanted block then return and remove marker
execute at @s \
    if block ~ ~-1 ~ #overly_realistic:ground_prop_cant_gen_on run \
        return run \
            kill @s

# -> Randomize prop
execute store result score #or.prop_type OverlyRealistic.General.ArbitraryData run \
    random value 1..2

# -. Debug
#scoreboard players set #or.prop_type OverlyRealistic.General.ArbitraryData 1

# --> Place prop

# -> Stick
execute if score #or.prop_type OverlyRealistic.General.ArbitraryData matches 1 at @s \
    positioned over motion_blocking_no_leaves \
    align xyz \
    positioned ~0.5 ~0.1 ~0.5 run \
        function overly_realistic:general/props/placement/place_prop/place_stick

# -> Stone
execute if score #or.prop_type OverlyRealistic.General.ArbitraryData matches 2 at @s \
    positioned over motion_blocking_no_leaves \
    align xyz \
    positioned ~0.5 ~0.1 ~0.5 run \
        function overly_realistic:general/props/placement/place_prop/place_stone

# -> Place tier 2 prop
spreadplayers ~ ~ 64 64 false @s
execute at @s \
    positioned over motion_blocking_no_leaves run \
        function overly_realistic:general/props/placement/prop_place_tier_2

# -> Remove marker
kill @s
