Skip to content

Instantly share code, notes, and snippets.

Created August 2, 2015 00:06
Show Gist options
  • Save anonymous/74662918de176465e39a to your computer and use it in GitHub Desktop.
Save anonymous/74662918de176465e39a 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.minecraft.item.Item;
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) {
Item item = HarshNatureItems.Kalamari;
int random = (int) Math.random() * 3;
if(event.entityLiving instanceof EntitySquid)
{
event.entityLiving.dropItem(HarshNatureItems.Kalamari, random);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment