Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.mint.quantumcoins.core;
- import java.util.Random;
- import com.mint.quantumcoins.items.ItemHelper;
- import com.mint.quantumcoins.lib.QuantumSettings;
- import cpw.mods.fml.common.eventhandler.SubscribeEvent;
- import net.minecraft.entity.item.EntityItem;
- import net.minecraft.entity.monster.EntityZombie;
- import net.minecraft.item.ItemStack;
- import net.minecraftforge.event.entity.living.LivingDropsEvent;
- public class QuantumEvents
- {
- @SubscribeEvent
- public void mobDrop(LivingDropsEvent event)
- {
- ItemStack droppedCoin = new ItemStack(ItemHelper.coin, 1, 0);
- if(event.recentlyHit == false) return;
- if(event.entityLiving instanceof EntityZombie)
- {
- if(QuantumSettings.settings.zombieDrop == true)
- {
- if(dropChance(QuantumSettings.settings.zombieChance) == true)
- {
- event.drops.add(new EntityItem(event.entity.worldObj, event.entity.posX, event.entity.posY, event.entity.posZ));
- }
- }
- }
- }
- public boolean dropChance(int percent)
- {
- Random chance = new Random();
- if(percent <= chance.nextInt(101)) return true;
- else return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement