Class LivingExperienceDropEvent
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.entity.EntityEvent
net.neoforged.neoforge.event.entity.living.LivingEvent
net.neoforged.neoforge.event.entity.living.LivingExperienceDropEvent
- All Implemented Interfaces:
net.neoforged.bus.api.ICancellableEvent
public class LivingExperienceDropEvent
extends LivingEvent
implements net.neoforged.bus.api.ICancellableEvent
Event for when an entity drops experience on its death, can be used to change
the amount of experience points dropped or completely prevent dropping of experience
by canceling the event.
-
Nested Class Summary
Nested classes/interfaces inherited from class LivingEvent
LivingEvent.LivingJumpEvent, LivingEvent.LivingVisibilityEventNested classes/interfaces inherited from class EntityEvent
EntityEvent.EnteringSection, EntityEvent.EntityConstructing, EntityEvent.Size -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate final int -
Constructor Summary
ConstructorsConstructorDescriptionLivingExperienceDropEvent(LivingEntity entity, @Nullable Player attackingPlayer, int originalExperience) -
Method Summary
Methods inherited from class LivingEvent
getEntityMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.neoforged.bus.api.ICancellableEvent
isCanceled, setCanceled
-
Field Details
-
attackingPlayer
-
originalExperiencePoints
private final int originalExperiencePoints -
droppedExperiencePoints
private int droppedExperiencePoints
-
-
Constructor Details
-
LivingExperienceDropEvent
public LivingExperienceDropEvent(LivingEntity entity, @Nullable Player attackingPlayer, int originalExperience)
-
-
Method Details
-
getDroppedExperience
public int getDroppedExperience() -
setDroppedExperience
public void setDroppedExperience(int droppedExperience) -
getAttackingPlayer
-
getOriginalExperience
public int getOriginalExperience()
-