
# -> If basket is inside a non-full block then try moving it up
execute if block ~ ~ ~ #overly_realistic:non_full_blocks_upward run \
    tp @s ~ ~1 ~

# -> Rotate perm marker
execute rotated as @p[tag=OverlyRealistic.Player.PlacedCustomBlock] run \
    rotate 00000001-0000-002a-0000-00010000002a ~ ~

# -> Get rotation
execute store result score #or.global OverlyRealistic.General.ArbitraryData run \
    data get entity 00000001-0000-002a-0000-00010000002a Rotation[0]

# -> Attempt placing the basket
execute at @s \
    align xyz \
    positioned ~0.5 ~0.5 ~0.5 run \
        function overly_realistic:general/custom_blocks/gravestone/gravestone_place_from_rotation

# -> Remove marker
kill @s
