
#take UUID part 1, divide by 121 and take the remainder to get a random number between 0 and 120. Subtract 60 to shift the number range from -60 to +60. Then get the current X coord and subtract the random number from it.
execute at @s run execute store result score @s KyuDummy run data get entity @s UUID[0] .1
scoreboard players set @s KyuDummy2 121
scoreboard players operation @s KyuDummy %= @s KyuDummy2
scoreboard players remove @s KyuDummy 60
execute at @s run execute store result score @s PosX run data get entity @s Pos[0] 1
execute as @s run scoreboard players operation @s PosX -= @s KyuDummy
execute as @s run execute store result entity @s Pos[0] double 1 run scoreboard players get @s PosX



#same as before, but with the Z coord this time
execute at @s run execute store result score @s KyuDummy run data get entity @s UUID[2] .1
scoreboard players set @s KyuDummy2 121
scoreboard players operation @s KyuDummy %= @s KyuDummy2
scoreboard players remove @s KyuDummy 60
execute at @s run execute store result score @s PosZ run data get entity @s Pos[2] 1
execute as @s run scoreboard players operation @s PosZ -= @s KyuDummy
execute as @s run execute store result entity @s Pos[2] double 1 run scoreboard players get @s PosZ

#center the entity on its current block
execute at @s run tp @s ~.5 ~ ~.5

#tag the entity as 'GotTagged', which allows it to start falling from the sky
#execute at @s run summon wither_skeleton ~ 175 ~ {Tags:["ParatroopersEventSpawnMob"],FallFlying:1b,ArmorItems:[{},{},{id:"minecraft:elytra",Count:1b},{}]}
execute if predicate suhc:25percent run tag @s add BowSkelly
execute at @s[tag=!BowSkelly] run summon pig ~ 175 ~ {PersistenceRequired:1,Tags:["ParatroopersEventSpawnPig","RemovePersist"],FallFlying:1b,Passengers:[{id:"minecraft:wither_skeleton",PersistenceRequired:1,Tags:["GKNameTag","RemovePersist"],HandItems:[{id:"minecraft:stone_sword",Count:1b,tag:{Enchantments:[{id:"minecraft:sharpness",lvl:5s}]}},{}],ArmorItems:[{id:"minecraft:leather_boots",Count:1b,tag:{display:{color:16711918},Enchantments:[{id:"minecraft:protection",lvl:3s}]}},{id:"minecraft:leather_leggings",Count:1b,tag:{display:{color:16711918},Enchantments:[{id:"minecraft:protection",lvl:3s}]}},{id:"minecraft:elytra",Count:1b,tag:{RepairCost:99999,Damage:99999}},{id:"minecraft:leather_helmet",Count:1b,tag:{display:{color:16711918},Enchantments:[{id:"minecraft:protection",lvl:3s}]}}],ArmorDropChances:[0.085F,0.085F,-327.000F,0.085F],Attributes:[{Name:generic.armor,Base:5},{Name:generic.armor_toughness,Base:5}]}],ArmorItems:[{},{},{id:'minecraft:elytra',Count:1b,tag:{RepairCost:99999,Damage:0}},{}],ArmorDropChances:[0.085F,0.085F,-327.000F,0.085F],ArmorDropChances:[0.085F,0.085F,-327.000F,0.085F]}
execute at @s[tag=BowSkelly] run summon pig ~ 175 ~ {PersistenceRequired:1,Tags:["ParatroopersEventSpawnPig","RemovePersist"],FallFlying:1b,Passengers:[{id:"minecraft:wither_skeleton",PersistenceRequired:1,Tags:["GKNameTag","RemovePersist"],HandItems:[{id:"minecraft:bow",Count:1b,tag:{Enchantments:[{id:"minecraft:power",lvl:3s}]}},{}],ArmorItems:[{id:"minecraft:leather_boots",Count:1b,tag:{display:{color:16711918},Enchantments:[{id:"minecraft:protection",lvl:3s}]}},{id:"minecraft:leather_leggings",Count:1b,tag:{display:{color:16711918},Enchantments:[{id:"minecraft:protection",lvl:3s}]}},{id:"minecraft:elytra",Count:1b,tag:{RepairCost:99999,Damage:99999}},{id:"minecraft:leather_helmet",Count:1b,tag:{display:{color:16711918},Enchantments:[{id:"minecraft:protection",lvl:3s}]}}],ArmorDropChances:[0.085F,0.085F,-327.000F,0.085F],Attributes:[{Name:generic.armor,Base:5},{Name:generic.armor_toughness,Base:5}]}],ArmorItems:[{},{},{id:'minecraft:elytra',Count:1b,tag:{RepairCost:99999,Damage:0}},{}],ArmorDropChances:[0.085F,0.085F,-327.000F,0.085F],ArmorDropChances:[0.085F,0.085F,-327.000F,0.085F]}

kill @s