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
Modifier 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
ConstructorDescriptionDropEvent
(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émonboolean
Whether the entity dropping these items is a Trainervoid
removeDrop
(DroppedItem drop) Removes the given DroppedItem from the list of planned dropsMethods inherited from class net.minecraftforge.eventbus.api.Event
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
-
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 -
isTrainer
public boolean isTrainer()Whether the entity dropping these items is a Trainer
-