Skip to content

Instantly share code, notes, and snippets.

Created August 1, 2015 22:51
Show Gist options
  • Save anonymous/5bebd96b61c95ad71106 to your computer and use it in GitHub Desktop.
Save anonymous/5bebd96b61c95ad71106 to your computer and use it in GitHub Desktop.
package com.drunksmanknife.harshnature.init;
import java.util.Random;
import net.minecraft.entity.passive.EntitySquid;
import net.minecraftforge.event.entity.living.LivingDropsEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
public class ModLivingDropsEvent {
public static double rand;
public Random r = new Random();
@SubscribeEvent
public void onEntityDrop(LivingDropsEvent event) {
if(event.entityLiving instanceof EntitySquid) {
if(r.nextInt(10/6) == 0){
event.entityLiving.dropItem(HarshNatureItems.Kalamari, r.nextInt(1) + 2);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment