Posted December 7, 201311 yr I want to Loot in existing Mobs(Zombies, Creeper etc.) but i don't know how it works I have try it: package mib.item; import mib.MIB; import net.minecraft.entity.monster.EntityZombie; import net.minecraft.item.Item; import net.minecraft.world.World; public class EntityBloodDropLoot extends EntityZombie{ public EntityBloodDropLoot(World par1World) { super(par1World); } protected int getDropItemId() { return MIB.bloodDrop.itemID; } } It didn't work Can you help me?
December 7, 201311 yr This is not the best way to do this but! (Sorry im new to forge) @ForgeSubscribe public void Drops(LivingDropsEvent event) { if(event.entityLiving instanceof EntityZombie) { event.entityLiving.dropItem(Item.bone.itemId 1); } } Note: will drop Every time just add Random to fix this EE3 Uses: @ForgeSubscribe public void onEntityLivingDeath(LivingDeathEvent event) { if (event.source.getDamageType().equals("player")) { ItemHelper.dropMiniumShard((EntityPlayer) event.source.getSourceOfDamage(), event.entityLiving); } if (event.source.getSourceOfDamage() instanceof EntityArrow) { if (((EntityArrow) event.source.getSourceOfDamage()).shootingEntity != null) { if (((EntityArrow) event.source.getSourceOfDamage()).shootingEntity instanceof EntityPlayer) { ItemHelper.dropMiniumShard((EntityPlayer) ((EntityArrow) event.source.getSourceOfDamage()).shootingEntity, event.entityLiving); } - Wurmatron
December 8, 201311 yr Use the LivingDropsEvent and remember to register it MinecraftForge.EVENT_BUS.register(new EventHandler()); Kain
December 8, 201311 yr Make A new class. It should look something like this: package dudesmods.lozmod2.entity; import java.util.Random; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.monster.*; import net.minecraft.entity.passive.*; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.event.ForgeSubscribe; import net.minecraftforge.event.entity.living.LivingDropsEvent; import net.minecraft.entity.EntityLiving; public class ModLivingDropsEvent { public static double rand; public Random r = new Random(); @ForgeSubscribe public void onEntityDrop(LivingDropsEvent event) { if(event.entityLiving instanceof EntityCow) { event.entityLiving.dropItem(LOZmod.green_tanned_leather.itemID, r.nextInt(3)); } } } change "EntityCow" to the desired Entity. "r.nextInt(3)" indicates that it drops anywhere from 1-3 of the item "LOZmod.green_tanned_leather.itemID" is the item In your main class in the PreInt method: MinecraftForge.EVENT_BUS.register(new ModLivingDropsEvent()); "ModLivingDropsEvent" being the class you made. Legend of Zelda Mod[updated September 20th to 3.1.1] Extra Achievements(Minecraft 1.8!)[updated April 3rd to 2.3.0] Fancy Cheeses[updated May 8th to 0.5.0]
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.