001 package net.minecraftforge.event.entity.player;
002
003 import net.minecraft.entity.Entity;
004 import net.minecraft.entity.item.EntityItem;
005 import net.minecraft.entity.player.EntityPlayer;
006 import net.minecraftforge.event.Cancelable;
007 import net.minecraftforge.event.Event;
008
009 @Cancelable
010 @Event.HasResult
011 public class EntityItemPickupEvent extends PlayerEvent
012 {
013 /**
014 * This event is called when a player collides with a EntityItem on the ground.
015 * The event can be canceled, and no further processing will be done.
016 *
017 * You can set the result of this event to ALLOW which will trigger the
018 * processing of achievements, FML's event, play the sound, and kill the
019 * entity if all the items are picked up.
020 *
021 * setResult(ALLOW) is the same as the old setHandled()
022 */
023
024 public final EntityItem item;
025 private boolean handled = false;
026
027 public EntityItemPickupEvent(EntityPlayer player, EntityItem item)
028 {
029 super(player);
030 this.item = item;
031 }
032 }