Class DropEvent

java.lang.Object
net.minecraftforge.eventbus.api.Event
com.pixelmonmod.pixelmon.api.events.DropEvent

public class DropEvent extends net.minecraftforge.eventbus.api.Event
Event fired when a Pokémon drops its items after a battle.

Canceling this event will prevent any items from being dropped

  • Nested Class Summary

    Nested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Event

    net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    The drop mode for these drops.
    final net.minecraft.world.entity.Mob
    The entity dropping the items.
    final net.minecraft.server.level.ServerPlayer
    The player who will be given the drops
  • Constructor Summary

    Constructors
    Constructor
    Description
    DropEvent(net.minecraft.server.level.ServerPlayer player, net.minecraft.world.entity.Mob entity, ItemDropMode dropMode, ArrayList<DroppedItem> items)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addDrop(net.minecraft.world.item.ItemStack drop)
    Adds an ItemStack to the drop list.
    com.google.common.collect.ImmutableList<DroppedItem>
    All of the planned drops
    boolean
    Whether the entity dropping these items is a Pokémon
    boolean
    Whether the entity dropping these items is a Trainer
    void
    Removes the given DroppedItem from the list of planned drops

    Methods inherited from class net.minecraftforge.eventbus.api.Event

    getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • player

      public final net.minecraft.server.level.ServerPlayer player
      The player who will be given the drops
    • entity

      public final net.minecraft.world.entity.Mob entity
      The entity dropping the items. This could be a Pokémon or a trainer
    • dropMode

      public final ItemDropMode dropMode
      The drop mode for these drops. Note that ItemDropMode.NormalPokemon is not used
  • Constructor Details

    • DropEvent

      public DropEvent(net.minecraft.server.level.ServerPlayer player, net.minecraft.world.entity.Mob entity, ItemDropMode dropMode, ArrayList<DroppedItem> items)
  • Method Details

    • getDrops

      public com.google.common.collect.ImmutableList<DroppedItem> getDrops()
      All of the planned drops
    • addDrop

      public void addDrop(net.minecraft.world.item.ItemStack drop)
      Adds an ItemStack to the drop list. Nulls are rejected
    • removeDrop

      public void removeDrop(DroppedItem drop)
      Removes the given DroppedItem from the list of planned drops
    • isPokemon

      public boolean isPokemon()
      Whether the entity dropping these items is a Pokémon
    • isTrainer

      public boolean isTrainer()
      Whether the entity dropping these items is a Trainer