Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package SGM.events;
- import java.util.Random;
- import net.minecraft.entity.boss.EntityDragon;
- import net.minecraft.entity.boss.EntityWither;
- import net.minecraft.entity.monster.EntityBlaze;
- import net.minecraft.entity.monster.EntityCaveSpider;
- import net.minecraft.entity.monster.EntityCreeper;
- import net.minecraft.entity.monster.EntityEnderman;
- import net.minecraft.entity.monster.EntityGhast;
- import net.minecraft.entity.monster.EntityIronGolem;
- import net.minecraft.entity.monster.EntityMagmaCube;
- import net.minecraft.entity.monster.EntityPigZombie;
- import net.minecraft.entity.monster.EntitySilverfish;
- import net.minecraft.entity.monster.EntitySkeleton;
- import net.minecraft.entity.monster.EntitySlime;
- import net.minecraft.entity.monster.EntitySnowman;
- import net.minecraft.entity.monster.EntitySpider;
- import net.minecraft.entity.monster.EntityWitch;
- import net.minecraft.entity.monster.EntityZombie;
- import net.minecraft.entity.passive.EntityChicken;
- import net.minecraft.entity.passive.EntityCow;
- import net.minecraft.entity.passive.EntityHorse;
- import net.minecraft.entity.passive.EntityPig;
- import net.minecraft.entity.passive.EntitySheep;
- import net.minecraft.init.Items;
- import net.minecraftforge.event.entity.living.LivingDropsEvent;
- import cpw.mods.fml.common.Mod;
- import cpw.mods.fml.common.eventhandler.SubscribeEvent;
- public class MobCustomDrops {
- @SubscribeEvent
- public void onEntityDrop(LivingDropsEvent event) {
- Random r = new Random();
- int lootingLevel = 0;
- int addition = r.nextInt(3) + r.nextInt(1 + lootingLevel);
- if (event.entityLiving instanceof EntityZombie & addition > 2) {
- event.entityLiving.dropItem(SGM.SGMMain.creativebag, r.nextInt(1));
- }
- if (event.entityLiving instanceof EntityCreeper & addition > 2) {
- event.entityLiving.dropItem(SGM.SGMMain.creativebag, r.nextInt(1));
- } if (event.entityLiving instanceof EntitySkeleton & addition > 2) {
- event.entityLiving.dropItem(SGM.SGMMain.creativebag, r.nextInt(1));
- } if (event.entityLiving instanceof EntitySlime & addition > 2) {
- event.entityLiving.dropItem(SGM.SGMMain.creativebag, r.nextInt(1));
- } if (event.entityLiving instanceof EntitySpider & addition > 2) {
- event.entityLiving.dropItem(SGM.SGMMain.creativebag, r.nextInt(1));
- } if (event.entityLiving instanceof EntityWitch & addition > 2) {
- event.entityLiving.dropItem(SGM.SGMMain.creativebag, r.nextInt(1));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement