Advertisement
Guest User

Vanilla Mobs for Custom Drops

a guest
Nov 1st, 2014
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.83 KB | None | 0 0
  1. ###########LivingDropHandler############
  2. public static double rand;
  3.    
  4.     @SubscribeEvent
  5.     public void onPassiveDrop(LivingDropsEvent event)
  6.     {
  7.     // you can also check the random chance here, rather than every time,
  8.     // since you use the exact same probability for all your cases
  9.         if (event.source.getDamageType().equals("player") && event.entity.worldObj.rand.nextFloat() < 0.2F)
  10.         {
  11.             if (event.entity instanceof EntityCow)
  12.             {
  13.                 event.entityLiving.dropItem(Items.bone, 6);
  14.                 event.entityLiving.dropItem(MobDrops.cowHorn, 2);
  15.                 event.entityLiving.dropItem(MobDrops.ribCage, 1);
  16.             }
  17.     }
  18.     }
  19.  
  20. ##########LivingDropEvent#############
  21. public static double rand;
  22.    
  23.     @SubscribeEvent
  24.     public void onPassiveDrop(LivingDropsEvent event)
  25.     {
  26.        
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement