First, we determine the mob type from the mob killed. This is done via a predetermined pool of mobs, you can find that pool in the following link: MobGroupUtil.
After the mob type is determined, we check the "general drop chance" in chances.yml :
We then generate a random number between 0-100,000 and check if that number is below the chance. If it is, a card is dropped.
For example:
Cards Drops:
Player kills a zombie. Type determined is "hostile". Hostile chance is 20,000. Generated number is 12,456.
12456 < 20000 = drop
No Drop:
Player kills a zombie. Type determined is "hostile". Hostile chance is 20,000. Generated number is 40,000.
40000 > 20000 = no drop
How is the card chosen?
We choose the rarity to drop a card from through a "weight" system. The chances you define in chances.yml define the weight. The higher the weight is, the higher the chance that rarity will drop.
We use a CollectionSampler using the weights of all rarities as a sampler. For example, taking the "hostile" drop, we will pass the values to our sampler and then randomly return the rarity id.
If we ommit a type from the section above, it will not get dropped from that type.