Class HeldItemChangedEvent.Pre
java.lang.Object
net.minecraftforge.eventbus.api.Event
com.pixelmonmod.pixelmon.api.events.HeldItemChangedEvent
com.pixelmonmod.pixelmon.api.events.HeldItemChangedEvent.Pre
- Enclosing class:
- HeldItemChangedEvent
Cancelable event fired before a Pokémon's held item is changed.
Cancelling this event will prevent the held item from being changed and, if the change was triggered
via the inventory party GUI, prevents any associated changes from being performed on the player's
inventory.
player - The player the item is being changed for
pokemon - The pokemon the item is being changed on
newHeldItem - The item that is being held. Can be modified and will reflect the new item held.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.pixelmonmod.pixelmon.api.events.HeldItemChangedEvent
HeldItemChangedEvent.Post, HeldItemChangedEvent.Pre
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 inherited from class com.pixelmonmod.pixelmon.api.events.HeldItemChangedEvent
heldItem, player, pokemon
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
setHeldItem
(net.minecraft.world.item.ItemStack heldItem) Allows overriding the HeldItem that is usedMethods inherited from class com.pixelmonmod.pixelmon.api.events.HeldItemChangedEvent
getHeldItem, getPlayer, getPokemon, getSpecies
Methods inherited from class net.minecraftforge.eventbus.api.Event
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
-
Constructor Details
-
Pre
public Pre(@Nullable net.minecraft.server.level.ServerPlayer player, Pokemon pokemon, net.minecraft.world.item.ItemStack newHeldItem)
-
-
Method Details
-
setHeldItem
public void setHeldItem(net.minecraft.world.item.ItemStack heldItem) Allows overriding the HeldItem that is used- Parameters:
heldItem
- The new held item
-