Every now and then my code randomly doesn't give the loop-player a random item from any of the tiers. The chances add to 100 so idk whats wrong.
Im testing out different forms of this code, I was using random integers before, but I wanted to see if just using chances would work.
set {tier1::*} to dirt, stick
set {tier2::*} to grass block, cobblestone
set {tier3::*} to stone, netherrack
options:
timer: 1
every {@timer} seconds:
# sets a random number for quantity every {@timer} second(s)
set {_q} to random integer from 1 to 3
loop all players:
if loop-player has permission "tiers.tier1":
if chance of 80%:
# 80% chance with random 1-3 item quantity
give loop-player {_q} of random items out of {tier1::*}
else if chance of 15%:
# 15% chance
give loop-player 1 of random items out of {tier2::*}
else if chance of 5%:
# 5% chance
give loop-player 1 of random items out of {tier3::*}```