Posted April 13, 201312 yr I have made a living drops event for my food item so sheep drop lambchops but every single mob is dropping the item?!?!? This is the code package assassinhero.parallelworlds; import net.minecraft.entity.monster.EntityEnderman; import net.minecraft.entity.passive.EntityCow; import net.minecraft.entity.passive.EntitySheep; import net.minecraftforge.event.ForgeSubscribe; import net.minecraftforge.event.entity.living.LivingDropsEvent; public class ParallelWorldsSheepDropsEvent { public static double rand; @ForgeSubscribe public void onEntityDrop(LivingDropsEvent event){ rand = Math.random(); if(event.entityLiving instanceof EntitySheep); if(rand < 1.00){ event.entityLiving.dropItem(ParallelWorlds.RawLambChop.itemID, 3); } } } STOP CRUCIFYING NEW MODDERS!!!!
April 13, 201312 yr dunno whats wrong with yours but if i were to do what you wanted it to i would write package ashtonsmod.common; import net.minecraft.block.Block; import net.minecraft.block.BlockBreakable; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.monster.EntitySheep; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraftforge.event.ForgeSubscribe; import net.minecraftforge.event.entity.living.LivingDropsEvent; import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; public class BatDrops { public static double rand; @ForgeSubscribe public void onEntityDrop(LivingDropsEvent event) { if (event.source.getDamageType().equals("player")) { rand = Math.random(); if (event.entityLiving instanceof EntitySheep) { if (rand < 1.00d){ event.entityLiving.dropItem(ParallelWorlds.RawLambChop.itemID, 3); } }}} Use examples, i have aspergers. Examples make sense to me.
April 13, 201312 yr if(event.entityLiving instanceof EntitySheep); You do realise that if does absolutely fucking nothing? Then ; at the end says that you're done with the block essentally you wrote: if(event.entityLiving instanceof EntitySheep) { } I do Forge for free, however the servers to run it arn't free, so anything is appreciated. Consider supporting the team on Patreon
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.