Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ###########LivingDropHandler############
- public static double rand;
- @SubscribeEvent
- public void onPassiveDrop(LivingDropsEvent event)
- {
- // you can also check the random chance here, rather than every time,
- // since you use the exact same probability for all your cases
- if (event.source.getDamageType().equals("player") && event.entity.worldObj.rand.nextFloat() < 0.2F)
- {
- if (event.entity instanceof EntityCow)
- {
- event.entityLiving.dropItem(Items.bone, 6);
- event.entityLiving.dropItem(MobDrops.cowHorn, 2);
- event.entityLiving.dropItem(MobDrops.ribCage, 1);
- }
- }
- }
- ##########LivingDropEvent#############
- public static double rand;
- @SubscribeEvent
- public void onPassiveDrop(LivingDropsEvent event)
- {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement