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

public static class HeldItemChangedEvent.Pre extends 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.
  • 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