so im trying to make a code so whenever i jump, i spawn a random mob
so i have it so that every mob have a certain amount of chance of spawning, but sometimes when i jump, i spawn 2 mobs not 1. I want it to spawn 1 mob only.
Here is my code if you need (its long):on player jump:
loop all players:
chance of 4%:
spawn bat
chance of 4%:
spawn cat
chance of 4%:
spawn chicken
chance of 4%:
spawn cod
chance of 4%:
spawn cow
chance of 4%:
spawn donkey
chance of 4%:
spawn fox
chance of 4%:
spawn horse
chance of 4%:
spawn mooshroom
chance of 4%:
spawn mule
chance of 4%:
spawn ocelot
chance of 4%:
spawn parrot
chance of 4%:
spawn pig
chance of 4%:
spawn puffer fish
chance of 4%:
spawn rabbit
chance of 4%:
spawn salmon
chance of 4%:
spawn sheep
chance of 4%:
spawn skeleton horse
chance of 4%:
spawn snow golem
chance of 4%:
spawn squid
chance of 4%:
spawn strider
chance of 4%:
spawn tropical fish
chance of 4%:
spawn turtle
chance of 4%:
spawn villager
chance of 4%:
spawn wandering trader
chance of 4%:
spawn bee
chance of 4%:
spawn cave spider
chance of 4%:
spawn dolphin
chance of 4%:
spawn enderman
chance of 4%:
spawn iron golem
chance of 4%:
spawn llama
chance of 4%:
spawn piglin
chance of 4%:
spawn panda
chance of 4%:
spawn polar bear
chance of 4%:
spawn spider
chance of 4%:
spawn wolf
chance of 4%:
spawn zombified piglin
chance of 4%:
spawn blaze
chance of 4%:
spawn creeper
chance of 4%:
spawn drowned
chance of 4%:
spawn elder guardian
chance of 4%:
spawn endermite
chance of 4%:
spawn evoker
chance of 4%:
spawn ghast
chance of 4%:
spawn guardian
chance of 4%:
spawn hoglin
chance of 4%:
spawn husk
chance of 4%:
spawn magma cube
chance of 4%:
spawn phantom
chance of 4%:
spawn piglin brute
chance of 4%:
spawn ravager
chance of 4%:
spawn shulker
chance of 4%:
spawn silverfish
chance of 4%:
spawn skeleton
chance of 4%:
spawn slime
chance of 4%:
spawn stray
chance of 4%:
spawn vex
chance of 4%:
spawn vindicator
chance of 4%:
spawn witch
chance of 4%:
spawn wither skeleton
chance of 4%:
spawn zoglin
chance of 4%:
spawn zombie
chance of 4%:
spawn zombie villager
chance of 4%:
spawn enderdragon
chance of 4%:
spawn wither
chance of 4%:
spawn giant
chance of 4%:
spawn zombie horse
chance of 4%:
spawn illusioner