Class DropEvent
java.lang.Object
net.neoforged.bus.api.Event
com.pixelmonmod.pixelmon.api.events.DropEvent
- All Implemented Interfaces:
net.neoforged.bus.api.ICancellableEvent
public class DropEvent
extends net.neoforged.bus.api.Event
implements net.neoforged.bus.api.ICancellableEvent
Event fired when a Pokémon drops its items after a battle.
Canceling this event will prevent any items from being dropped
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal ItemDropMode
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
ConstructorsConstructorDescriptionDropEvent
(net.minecraft.server.level.ServerPlayer player, net.minecraft.world.entity.Mob entity, ItemDropMode dropMode, ArrayList<DroppedItem> items) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addDrop
(net.minecraft.world.item.ItemStack drop) Adds an ItemStack to the drop list.com.google.common.collect.ImmutableList
<DroppedItem> getDrops()
All of the planned dropsboolean
Whether the entity dropping these items is a Pokémonvoid
removeDrop
(DroppedItem drop) Removes the given DroppedItem from the list of planned dropsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.neoforged.bus.api.ICancellableEvent
isCanceled, setCanceled
-
Field Details
-
player
public final net.minecraft.server.level.ServerPlayer playerThe player who will be given the drops -
entity
public final net.minecraft.world.entity.Mob entityThe entity dropping the items. This could be a Pokémon or a trainer -
dropMode
The drop mode for these drops. Note thatItemDropMode.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
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
Removes the given DroppedItem from the list of planned drops -
isPokemon
public boolean isPokemon()Whether the entity dropping these items is a Pokémon
-