How to make any mob that's killed drop items based on randomness

Started by ninja on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jan 2026
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make any mob that's killed drop items based on randomness

Im trying to make a mod where if you kill any mob it drops items, and each items has its own chance to drop. For example:
Fangs, 50% chance
Skull, 10% chance
I want it to work so when the mob dies it fires a function (or whatever it is) to make it so it has to drop one of these, the chance for any mob to drop an item should be 1/25