
# -> If prop is above an unwanted block then return
execute if block ~ ~-1 ~ #overly_realistic:ground_prop_cant_gen_on run \
    return fail
execute unless block ~ ~-1 ~ #overly_realistic:ground_prop_tier_2_can_gen_on run \
    return fail

# -> If prop is unable to be placed then return
execute unless block ~ ~ ~ #overly_realistic:spear_can_passthrough run \
    return fail

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

# --> Place prop

# -> Place rooted dirt underneath
fill ~ ~-1 ~ ~ ~-2 ~ rooted_dirt replace dirt strict

# -> Carrots
execute if score #or.prop_type OverlyRealistic.General.ArbitraryData matches 1 run \
    return run \
        setblock ~ ~ ~ carrots[age=7] strict

# -> Potatoes
execute if score #or.prop_type OverlyRealistic.General.ArbitraryData matches 2 run \
    return run \
        setblock ~ ~ ~ potatoes[age=7] strict

# -> Beetroot
execute if score #or.prop_type OverlyRealistic.General.ArbitraryData matches 3 run \
    return run \
        setblock ~ ~ ~ beetroots[age=3] strict
