Advertisement
Guest User

Untitled

a guest
Jan 17th, 2015
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.54 KB | None | 0 0
  1. package SGM.events;
  2.  
  3. import java.util.Random;
  4.  
  5. import net.minecraft.entity.boss.EntityDragon;
  6. import net.minecraft.entity.boss.EntityWither;
  7. import net.minecraft.entity.monster.EntityBlaze;
  8. import net.minecraft.entity.monster.EntityCaveSpider;
  9. import net.minecraft.entity.monster.EntityCreeper;
  10. import net.minecraft.entity.monster.EntityEnderman;
  11. import net.minecraft.entity.monster.EntityGhast;
  12. import net.minecraft.entity.monster.EntityIronGolem;
  13. import net.minecraft.entity.monster.EntityMagmaCube;
  14. import net.minecraft.entity.monster.EntityPigZombie;
  15. import net.minecraft.entity.monster.EntitySilverfish;
  16. import net.minecraft.entity.monster.EntitySkeleton;
  17. import net.minecraft.entity.monster.EntitySlime;
  18. import net.minecraft.entity.monster.EntitySnowman;
  19. import net.minecraft.entity.monster.EntitySpider;
  20. import net.minecraft.entity.monster.EntityWitch;
  21. import net.minecraft.entity.monster.EntityZombie;
  22. import net.minecraft.entity.passive.EntityChicken;
  23. import net.minecraft.entity.passive.EntityCow;
  24. import net.minecraft.entity.passive.EntityHorse;
  25. import net.minecraft.entity.passive.EntityPig;
  26. import net.minecraft.entity.passive.EntitySheep;
  27. import net.minecraft.init.Items;
  28. import net.minecraftforge.event.entity.living.LivingDropsEvent;
  29. import cpw.mods.fml.common.Mod;
  30. import cpw.mods.fml.common.eventhandler.SubscribeEvent;
  31.  
  32. public class MobCustomDrops {
  33.    
  34.     @SubscribeEvent
  35.     public void onEntityDrop(LivingDropsEvent event) {
  36.        
  37.          Random r = new Random();
  38.          int lootingLevel = 0;
  39.          int addition = r.nextInt(3) + r.nextInt(1 + lootingLevel);
  40.          
  41.          
  42.        
  43.        
  44.         if (event.entityLiving instanceof EntityZombie & addition > 2) {
  45.            
  46.  
  47.             event.entityLiving.dropItem(SGM.SGMMain.creativebag, r.nextInt(1));
  48.            
  49.         }
  50.        
  51.         if (event.entityLiving instanceof EntityCreeper & addition > 2) {
  52.            
  53.  
  54.             event.entityLiving.dropItem(SGM.SGMMain.creativebag, r.nextInt(1));
  55.            
  56.         }       if (event.entityLiving instanceof EntitySkeleton & addition > 2) {
  57.            
  58.  
  59.             event.entityLiving.dropItem(SGM.SGMMain.creativebag, r.nextInt(1));
  60.            
  61.         }       if (event.entityLiving instanceof EntitySlime & addition > 2) {
  62.            
  63.  
  64.             event.entityLiving.dropItem(SGM.SGMMain.creativebag, r.nextInt(1));
  65.            
  66.         }       if (event.entityLiving instanceof EntitySpider & addition > 2) {
  67.            
  68.  
  69.             event.entityLiving.dropItem(SGM.SGMMain.creativebag, r.nextInt(1));
  70.            
  71.         }       if (event.entityLiving instanceof EntityWitch & addition > 2) {
  72.            
  73.  
  74.             event.entityLiving.dropItem(SGM.SGMMain.creativebag, r.nextInt(1));
  75.            
  76.         }
  77.     }
  78. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement