Im making a boss system where when u kill the boss, it has some drops, here is my current code:
The problem is, it will give the entire team the same loot, and I wan't each player to get a different item, but they each have the same probability.
So when u kill a pufferfish named spike, every entity in a 15 block radius has a chance at each of the items in the code box.
Code:
on damage:
if victim is pufferfish named "Spike":
if the final damage is bigger than the health of victim:
loop all entities in radius 15 around victim:
chance of 12%:
give loop-entities prismarine shard named "&aSea Shard" with lore "&aRARE"
chance of 1%:
give loop-entities diamond sword named "&6Prismablade" with lore "&6LEGENDARY"
chance of 50%:
give loop-entities sponge named "&aSpike's Dolly" with lore "&aRARE"
chance of 5%:
give loop-entities music disc named "&6Spike's Music" with lore "&6LEGENDARY"
chance of 32%:
give loop-entities potion named "&aSpike's Baby Bottle" with lore "&aRARE"
So when u kill a pufferfish named spike, every entity in a 15 block radius has a chance at each of the items in the code box.