AssassinHero Posted April 13, 2013 Posted April 13, 2013 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); } } } Quote STOP CRUCIFYING NEW MODDERS!!!!
ashtonr12 Posted April 13, 2013 Posted April 13, 2013 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); } }}} Quote Use examples, i have aspergers. Examples make sense to me.
LexManos Posted April 13, 2013 Posted April 13, 2013 On 4/13/2013 at 6:14 PM, AssassinHero said: 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) { } Quote I do Forge for free, however the servers to run it arn't free, so anything is appreciated. Consider supporting the team on Patreon
ashtonr12 Posted April 14, 2013 Posted April 14, 2013 thats hilarious Quote Use examples, i have aspergers. Examples make sense to me.
Recommended Posts
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.