Jump to content

Recommended Posts

Posted

OK, so I've been trying to add custom drops to vanilla mobs, and my slightly edited code of someone Else's works fine, except that it drops a phantom item along with the real item (one can be picked up and other cannot). This class is inside my main package, (not inside the one with the .client suffix), I'm at a complete loss of why this is happening, the code compiles without a single error and Minecraft doesn't warn/error/info anything. :/

 

EntityDropEvent class:

import net.minecraft.entity.passive.EntitySheep;
import net.minecraftforge.event.*;
import net.minecraftforge.event.entity.living.LivingDeathEvent;
import net.minecraftforge.event.ForgeSubscribe;


public class LivingDropsEvent{

@ForgeSubscribe
    public void onEntityDrop(LivingDeathEvent event) {

        if (event.entityLiving instanceof EntitySheep) {
        	EntitySheep entity = (EntitySheep)event.entityLiving;
           //The integer at the end relates to how many potato will be dropped.
            entity.dropItem(MoarFoods.rawLamb.itemID, 1);
        }
}
}

 

Main Forge Class:

        	
// Custom Events
        	MinecraftForge.EVENT_BUS.register(new LivingDropsEvent());

Posted

Add to the list in the event, don't spawn the item -.-

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Posted

Add to the list in the event, don't spawn the item -.-

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.