类 LivingExperienceDropEvent

java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.event.entity.EntityEvent
net.minecraftforge.event.entity.living.LivingEvent
net.minecraftforge.event.entity.living.LivingExperienceDropEvent

public class LivingExperienceDropEvent extends LivingEvent
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.
  • 字段详细资料

    • attackingPlayer

      @Nullable private final @Nullable Player attackingPlayer
    • originalExperiencePoints

      private final int originalExperiencePoints
    • droppedExperiencePoints

      private int droppedExperiencePoints
  • 构造器详细资料

    • LivingExperienceDropEvent

      public LivingExperienceDropEvent(LivingEntity entity, @Nullable @Nullable Player attackingPlayer, int originalExperience)
  • 方法详细资料

    • getDroppedExperience

      public int getDroppedExperience()
    • setDroppedExperience

      public void setDroppedExperience(int droppedExperience)
    • getAttackingPlayer

      @Nullable public @Nullable Player getAttackingPlayer()
      返回:
      The player that last attacked the entity and thus caused the experience. This can be null, in case the player has since logged out.
    • getOriginalExperience

      public int getOriginalExperience()