Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @EventHandler
- public void onDeathPigman(EntityDeathEvent e) {
- Random random = new Random();
- int chance = random.nextInt(99);
- EntityDamageEvent.DamageCause cause = e.getEntity().getLastDamageCause().getCause();
- if (e.getEntityType() == EntityType.PIG_ZOMBIE) {
- if ((cause == EntityDamageEvent.DamageCause.ENTITY_ATTACK
- || cause == EntityDamageEvent.DamageCause.PROJECTILE || cause == EntityDamageEvent.DamageCause.FALL
- || cause == EntityDamageEvent.DamageCause.FIRE || cause == EntityDamageEvent.DamageCause.FIRE_TICK
- || cause == EntityDamageEvent.DamageCause.LAVA)) {
- if (chance <= this.getConfig().getInt("Mobs.ZombiePigman.Chance")) {
- List<String> drops = this.getConfig().getStringList("Mobs.ZombiePigman.Drop");
- for (String drop : drops) {
- drop.toUpperCase();
- e.getDrops().add(new ItemStack(Material.valueOf(drop.toUpperCase()), 1));
- }
- }
- }
- }
- }
- I HAVE ONE FOR EACH MOB ^^
- CONFIG.YML
- Mobs:
- Zombie:
- Drop:
- - Air
- - Emerald
- - Golden_Apple
- - Diamond
- Chance: 99
- Skeleton:
- Drop:
- - Air
- - Diamond
- Chance: 45
- Blaze:
- Drop:
- - Air
- - Diamond
- Chance: 45
- Creeper:
- Drop:
- - Air
- - Diamond
- Chance: 45
- IronGolem:
- Drop:
- - Air
- - Diamond
- Chance: 45
- Spider:
- Drop:
- - Air
- - Diamond
- Chance: 45
- ZombiePigman:
- Drop:
- - Air
- - Diamond
- Chance: 45
- Cow:
- Drop:
- - Air
- - Diamond
- Chance: 45
- Chicken:
- Drop:
- - Air
- - Diamond
- Chance: 45
- Pig:
- Drop:
- - Air
- - Diamond
- Chance: 45
- Villager:
- Drop:
- - Air
- - Diamond
- Chance: 45
- Wolf:
- Drop:
- - Air
- - Diamond
- Chance: 45
- Enderman:
- Drop:
- - Air
- - Diamond
- Chance: 45
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement