setblock ~ ~-1 ~ sand
# Inner Ring (Close to the seed)
execute if predicate kiwi2:chance_random_80 run setblock ~1 ~-1 ~0 sand
execute if predicate kiwi2:chance_random_80 run setblock ~-1 ~-1 ~0 sand
execute if predicate kiwi2:chance_random_80 run setblock ~0 ~-1 ~1 sand
execute if predicate kiwi2:chance_random_80 run setblock ~0 ~-1 ~-1 sand

# Middle Ring (The "Jitter" layer)
execute if predicate kiwi2:chance_random_80 run setblock ~2 ~-1 ~1 sand
execute if predicate kiwi2:chance_random_80 run setblock ~-2 ~-1 ~-1 sand
execute if predicate kiwi2:chance_random_80 run setblock ~1 ~-1 ~2 sand
execute if predicate kiwi2:chance_random_80 run setblock ~-1 ~-1 ~-2 sand
execute if predicate kiwi2:chance_random_80 run setblock ~2 ~-1 ~-2 sand
execute if predicate kiwi2:chance_random_80 run setblock ~-2 ~-1 ~2 sand

# Outer "Stragglers" (Sparse grass at the edges)
execute if predicate kiwi2:chance_random_80 run setblock ~3 ~-1 ~0 sand
execute if predicate kiwi2:chance_random_80 run setblock ~-3 ~-1 ~1 sand
execute if predicate kiwi2:chance_random_80 run setblock ~0 ~-1 ~3 sand
execute if predicate kiwi2:chance_random_80 run setblock ~1 ~-1 ~-3 sand
execute if predicate kiwi2:chance_random_80 run setblock ~2 ~-1 ~3 sand
execute if predicate kiwi2:chance_random_80 run setblock ~-2 ~-1 ~-3 sand

# Diagonal Corners
execute if predicate kiwi2:chance_random_80 run setblock ~2 ~-1 ~2 sand
execute if predicate kiwi2:chance_random_80 run setblock ~-2 ~-1 ~-2 sand
execute if predicate kiwi2:chance_random_80 run setblock ~3 ~-1 ~3 sand
execute if predicate kiwi2:chance_random_80 run setblock ~-3 ~-1 ~-3 sand

# Lush Moss Core
execute if predicate kiwi2:chance_random_50 run setblock ~1 ~-1 ~1 sand
execute if predicate kiwi2:chance_random_50 run setblock ~-1 ~-1 ~-1 sand
execute if predicate kiwi2:chance_random_50 run setblock ~2 ~-1 ~0 sand
execute if predicate kiwi2:chance_random_50 run setblock ~0 ~-1 ~-2 sand
execute if predicate kiwi2:chance_random_50 run setblock ~-1 ~-1 ~1 sand
execute if predicate kiwi2:chance_random_50 run setblock ~1 ~-1 ~-1 sand
execute if predicate kiwi2:chance_random_50 run setblock ~2 ~-1 ~1 sand
execute if predicate kiwi2:chance_random_50 run setblock ~1 ~-1 ~-2 sand

# Mossy Carpets (Vertical detail)
execute if predicate kiwi2:chance_random_30 run setblock ~1 ~ ~1 red_sand
execute if predicate kiwi2:chance_random_30 run setblock ~-1 ~ ~-1 red_sand

# Under-tree "Debris"
execute if predicate kiwi2:chance_random_50 run setblock ~0 ~-1 ~0 red_sand
execute if predicate kiwi2:chance_random_50 run setblock ~1 ~-1 ~-1 red_sand
execute if predicate kiwi2:chance_random_30 run setblock ~-1 ~-1 ~2 red_sand

# Rough Soil (Coarse Dirt)
execute if predicate kiwi2:chance_random_30 run setblock ~2 ~-1 ~2 red_sand
execute if predicate kiwi2:chance_random_30 run setblock ~-2 ~-1 ~-2 red_sand

execute store result score world StructureRoll run random value 1..18
execute if score world StructureRoll matches 1 run place template kiwi2:platforms/desert/small_dune ~ ~-1 ~ none none
execute if score world StructureRoll matches 2 run place template kiwi2:platforms/desert/small_dune ~ ~-1 ~ clockwise_90 none
execute if score world StructureRoll matches 3 run place template kiwi2:platforms/desert/small_dune ~ ~-1 ~ counterclockwise_90 none
execute if score world StructureRoll matches 4 run place template kiwi2:platforms/desert/small_dune ~ ~-1 ~ none none 0.95
execute if score world StructureRoll matches 5 run place template kiwi2:platforms/desert/small_dune ~ ~-1 ~ clockwise_90 none 0.95
execute if score world StructureRoll matches 6 run place template kiwi2:platforms/desert/small_dune ~ ~-1 ~ counterclockwise_90 none 0.95
execute if score world StructureRoll matches 7 run place template kiwi2:platforms/desert/small_dune ~ ~-1 ~ none front_back
execute if score world StructureRoll matches 8 run place template kiwi2:platforms/desert/small_dune ~ ~-1 ~ clockwise_90 front_back
execute if score world StructureRoll matches 9 run place template kiwi2:platforms/desert/small_dune ~ ~-1 ~ counterclockwise_90 front_back
execute if score world StructureRoll matches 10 run place template kiwi2:platforms/desert/small_dune ~ ~-1 ~ none front_back 0.95
execute if score world StructureRoll matches 11 run place template kiwi2:platforms/desert/small_dune ~ ~-1 ~ clockwise_90 front_back 0.95
execute if score world StructureRoll matches 12 run place template kiwi2:platforms/desert/small_dune ~ ~-1 ~ counterclockwise_90 front_back 0.95
execute if score world StructureRoll matches 13 run place template kiwi2:platforms/desert/small_dune ~ ~-1 ~ none left_right
execute if score world StructureRoll matches 14 run place template kiwi2:platforms/desert/small_dune ~ ~-1 ~ clockwise_90 left_right
execute if score world StructureRoll matches 15 run place template kiwi2:platforms/desert/small_dune ~ ~-1 ~ counterclockwise_90 left_right
execute if score world StructureRoll matches 16 run place template kiwi2:platforms/desert/small_dune ~ ~-1 ~ none left_right 0.95
execute if score world StructureRoll matches 17 run place template kiwi2:platforms/desert/small_dune ~ ~-1 ~ clockwise_90 left_right 0.95
execute if score world StructureRoll matches 18 run place template kiwi2:platforms/desert/small_dune ~ ~-1 ~ counterclockwise_90 left_right 0.95

execute if predicate kiwi2:chance_random_5 run function kiwi2:run_dimension/platforms/desert_platform/natural_mobs/dustwraiths

tag @s add desert_platform_marker_placed