Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package net.net46.thesuperhb.MobDrops;
- import net.minecraft.entity.passive.*;
- import net.minecraft.entity.monster.*;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.init.Items;
- import net.minecraft.item.Item;
- import net.minecraftforge.event.entity.living.LivingDeathEvent;
- import net.minecraftforge.event.entity.living.LivingDropsEvent;
- import net.minecraftforge.event.entity.living.LivingSpawnEvent;
- public class LivingDropEvent
- {
- public static double rand;
- public void onEntityDropCow(LivingDropsEvent event)
- {
- if (event.source.getDamageType().equals("player"))
- {
- rand = Math.random();
- if (event.entityLiving instanceof EntityCow)
- {
- //The 0.25d bit is the drop rate. at 0.25 it has a 25% chance of dropping. 1.00d is 100%
- if (rand < 0.17d)
- {
- event.entityLiving.dropItem(Items.bone, 12);
- event.entityLiving.dropItem(MobDrops.cowHorn, 2);
- event.entityLiving.dropItem(MobDrops.ribCage, 1);
- }
- }
- }
- }
- public void onEntityDropMooshroom(LivingDropsEvent event)
- {
- if (event.source.getDamageType().equals("player"))
- {
- rand = Math.random();
- if (event.entityLiving instanceof EntityMooshroom)
- {
- //The 0.25d bit is the drop rate. at 0.25 it has a 25% chance of dropping. 1.00d is 100%
- if (rand < 0.17d)
- {
- event.entityLiving.dropItem(Items.bone, 12);
- event.entityLiving.dropItem(MobDrops.cowHorn, 2);
- event.entityLiving.dropItem(MobDrops.ribCage, 1);
- event.entityLiving.dropItem(MobDrops.redLeather, 3);
- }
- }
- }
- }
- public void onEntityDropSquid(LivingDropsEvent event)
- {
- if (event.source.getDamageType().equals("player"))
- {
- rand = Math.random();
- if (event.entityLiving instanceof EntitySquid)
- {
- //The 0.25d bit is the drop rate. at 0.25 it has a 25% chance of dropping. 1.00d is 100%
- if (rand < 0.17d)
- {
- event.entityLiving.dropItem(MobDrops.squid, 2);
- event.entityLiving.dropItem(MobDrops.squidEye, 2);
- event.entityLiving.dropItem(MobDrops.squidTentacle, 8);
- }
- }
- }
- }
- public void onEntityDropSheep(LivingDropsEvent event)
- {
- if (event.source.getDamageType().equals("player"))
- {
- rand = Math.random();
- if (event.entityLiving instanceof EntitySheep)
- {
- //The 0.25d bit is the drop rate. at 0.25 it has a 25% chance of dropping. 1.00d is 100%
- if (rand < 0.17d)
- {
- event.entityLiving.dropItem(MobDrops.rawLambchop, 4);
- event.entityLiving.dropItem(Items.bone, 5);
- event.entityLiving.dropItem(MobDrops.ribCage, 1);
- }
- }
- }
- }
- public void onEntityDropBat(LivingDropsEvent event)
- {
- if (event.source.getDamageType().equals("player"))
- {
- rand = Math.random();
- if (event.entityLiving instanceof EntityBat)
- {
- //The 0.25d bit is the drop rate. at 0.25 it has a 25% chance of dropping. 1.00d is 100%
- if (rand < 0.17d)
- {
- event.entityLiving.dropItem(MobDrops.batEyes, 2);
- event.entityLiving.dropItem(MobDrops.batWings, 2);
- event.entityLiving.dropItem(MobDrops.batEars, 2);
- event.entityLiving.dropItem(Items.bone, 1);
- }
- }
- }
- }
- public void onEntityDropChicken(LivingDropsEvent event)
- {
- if (event.source.getDamageType().equals("player"))
- {
- rand = Math.random();
- if (event.entityLiving instanceof EntityChicken)
- {
- //The 0.25d bit is the drop rate. at 0.25 it has a 25% chance of dropping. 1.00d is 100%
- if (rand < 0.17d)
- {
- event.entityLiving.dropItem(MobDrops.chickenLegs, 2);
- event.entityLiving.dropItem(Items.bone, 3);
- }
- }
- }
- }
- public void onEntityDropHorse(LivingDropsEvent event)
- {
- if (event.source.getDamageType().equals("player"))
- {
- rand = Math.random();
- if (event.entityLiving instanceof EntityHorse)
- {
- //The 0.25d bit is the drop rate. at 0.25 it has a 25% chance of dropping. 1.00d is 100%
- if (rand < 0.17d)
- {
- //event.entityLiving.dropItem(MobDrops.headHorse, 1);
- event.entityLiving.dropItem(MobDrops.skinHorse, 2);
- event.entityLiving.dropItem(MobDrops.hoofHorse, 2);
- event.entityLiving.dropItem(Items.bone, 10);
- event.entityLiving.dropItem(MobDrops.ribCage, 1);
- }
- }
- }
- }
- public void onEntityDropPig(LivingDropsEvent event)
- {
- if (event.source.getDamageType().equals("player"))
- {
- rand = Math.random();
- if (event.entityLiving instanceof EntityPig)
- {
- //The 0.25d bit is the drop rate. at 0.25 it has a 25% chance of dropping. 1.00d is 100%
- if (rand < 0.17d)
- {
- event.entityLiving.dropItem(MobDrops.ribCage, 1);
- event.entityLiving.dropItem(Items.bone, 5);
- event.entityLiving.dropItem(MobDrops.rawRibs, 6);
- event.entityLiving.dropItem(MobDrops.ham, 6);
- }
- }
- }
- }
- public void onEntityDropWolf(LivingDropsEvent event)
- {
- if (event.source.getDamageType().equals("player"))
- {
- rand = Math.random();
- if (event.entityLiving instanceof EntityWolf)
- {
- //The 0.25d bit is the drop rate. at 0.25 it has a 25% chance of dropping. 1.00d is 100%
- if (rand < 0.17d)
- {
- event.entityLiving.dropItem(MobDrops.wolfSkin, 4);
- event.entityLiving.dropItem(Items.bone, 5);
- event.entityLiving.dropItem(MobDrops.ribCage, 1);
- }
- }
- }
- }
- public void onEntityDropSpider(LivingDropsEvent event)
- {
- if (event.source.getDamageType().equals("player"))
- {
- rand = Math.random();
- if (event.entityLiving instanceof EntitySpider)
- {
- //The 0.25d bit is the drop rate. at 0.25 it has a 25% chance of dropping. 1.00d is 100%
- if (rand < 0.10d)
- {
- event.entityLiving.dropItem(MobDrops.spiderLeg, 6);
- }
- }
- }
- }
- public void onEntityDropCreeper(LivingDropsEvent event)
- {
- if (event.source.getDamageType().equals("player"))
- {
- rand = Math.random();
- if (event.entityLiving instanceof EntityCreeper)
- {
- //The 0.25d bit is the drop rate. at 0.25 it has a 25% chance of dropping. 1.00d is 100%
- if (rand < 0.10d)
- {
- event.entityLiving.dropItem(MobDrops.creeperSkin, 4);
- event.entityLiving.dropItem(MobDrops.creeperEye, 2);
- }
- }
- }
- }
- public void onEntityDropEnderman(LivingDropsEvent event)
- {
- if (event.source.getDamageType().equals("player"))
- {
- rand = Math.random();
- if (event.entityLiving instanceof EntityEnderman)
- {
- //The 0.25d bit is the drop rate. at 0.25 it has a 25% chance of dropping. 1.00d is 100%
- if (rand < 0.10d)
- {
- event.entityLiving.dropItem(MobDrops.enderTear, 2);
- }
- }
- }
- }
- public void onEntityDropGhast(LivingDropsEvent event)
- {
- if (event.source.getDamageType().equals("player"))
- {
- rand = Math.random();
- if (event.entityLiving instanceof EntityGhast)
- {
- //The 0.25d bit is the drop rate. at 0.25 it has a 25% chance of dropping. 1.00d is 100%
- if (rand < 0.10d)
- {
- event.entityLiving.dropItem(Items.flint, 10);
- }
- }
- }
- }
- public void onEntityDropMagmaCube(LivingDropsEvent event)
- {
- if (event.source.getDamageType().equals("player"))
- {
- rand = Math.random();
- if (event.entityLiving instanceof EntityMagmaCube)
- {
- //The 0.25d bit is the drop rate. at 0.25 it has a 25% chance of dropping. 1.00d is 100%
- if (rand < 0.10d)
- {
- event.entityLiving.dropItem(MobDrops.magmaGoo, 2);
- }
- }
- }
- }
- public void onEntityDropSlime(LivingDropsEvent event)
- {
- if (event.source.getDamageType().equals("player"))
- {
- rand = Math.random();
- if (event.entityLiving instanceof EntitySlime)
- {
- //The 0.25d bit is the drop rate. at 0.25 it has a 25% chance of dropping. 1.00d is 100%
- if (rand < 0.10d)
- {
- event.entityLiving.dropItem(MobDrops.goo, 2);
- }
- }
- }
- }
- public void onEntityDropWitch(LivingDropsEvent event)
- {
- if (event.source.getDamageType().equals("player"))
- {
- rand = Math.random();
- if (event.entityLiving instanceof EntityWitch)
- {
- //The 0.25d bit is the drop rate. at 0.25 it has a 25% chance of dropping. 1.00d is 100%
- if (rand < 0.10d)
- {
- event.entityLiving.dropItem(MobDrops.witchRobe, 1);
- event.entityLiving.dropItem(MobDrops.wort, 1);
- }
- }
- }
- }
- public void onEntityDropZombie(LivingDropsEvent event)
- {
- if (event.source.getDamageType().equals("player"))
- {
- rand = Math.random();
- if (event.entityLiving instanceof EntityZombie)
- {
- //The 0.25d bit is the drop rate. at 0.25 it has a 25% chance of dropping. 1.00d is 100%
- if (rand < 0.10d)
- {
- event.entityLiving.dropItem(MobDrops.zombieArm, 2);
- event.entityLiving.dropItem(MobDrops.zombieBrain, 1);
- }
- }
- }
- }
- public void onEntityDropPigZombie(LivingDropsEvent event)
- {
- if (event.source.getDamageType().equals("player"))
- {
- rand = Math.random();
- if (event.entityLiving instanceof EntityPigZombie)
- {
- //The 0.25d bit is the drop rate. at 0.25 it has a 25% chance of dropping. 1.00d is 100%
- if (rand < 0.10d)
- {
- event.entityLiving.dropItem(MobDrops.pigmanMeat, 2);
- event.entityLiving.dropItem(Items.golden_sword, 1);
- }
- }
- }
- }
- public void onEntityDropSkeleton(LivingDropsEvent event)
- {
- if (event.source.getDamageType().equals("player"))
- {
- rand = Math.random();
- if (event.entityLiving instanceof EntitySkeleton)
- {
- //The 0.25d bit is the drop rate. at 0.25 it has a 25% chance of dropping. 1.00d is 100%
- if (rand < 0.10d)
- {
- event.entityLiving.dropItem(Items.skull, 1);
- event.entityLiving.dropItem(Items.bow, 1);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement