How do I make a spigot plugin so that a pig has a 24% chance of dropping a certain item? (E.g. Pig's head)
@EventHandler void onEntityDeath (EntityDeathEvent e) {
if (! (e.getEntity () instanceof Pig)) return;
int r = new Random (). NextInt (100);
if (r <24) e.getWorld (). DropItem (e.getEntity (). GetLocation (), PIG HEAD);