Class MysteryBoxEvent.Feed

java.lang.Object
net.minecraftforge.eventbus.api.Event
com.pixelmonmod.pixelmon.api.events.blocks.MysteryBoxEvent
com.pixelmonmod.pixelmon.api.events.blocks.MysteryBoxEvent.Feed
Enclosing class:
MysteryBoxEvent

public static class MysteryBoxEvent.Feed extends MysteryBoxEvent
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.pixelmonmod.pixelmon.api.events.blocks.MysteryBoxEvent

    MysteryBoxEvent.Activate, MysteryBoxEvent.ComparatorPower, MysteryBoxEvent.Feed, MysteryBoxEvent.Open, MysteryBoxEvent.Tick

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

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

    Constructors
    Constructor
    Description
    Feed(MysteryBoxTileEntity box, net.minecraft.world.entity.player.Player player, net.minecraft.world.level.block.state.BlockState blockState, net.minecraft.world.item.ItemStack itemStack, int scrapsLeft)
    Fired when a Mystery Box is about to be fed a scrap.
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.world.item.ItemStack
    Gets the item stack used in this interaction.
    net.minecraft.world.entity.player.Player
    Gets the player who instigated this event.
    int
    The current value of the counter for Netherite Scraps required to open this Mystery Box.
    void
    setScrapsLeft(int scrapsLeft)
    Sets the current value of the counter for Netherite Scraps required to open this Mystery Box.

    Methods inherited from class com.pixelmonmod.pixelmon.api.events.blocks.MysteryBoxEvent

    getBlockState, getBox

    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
  • Constructor Details

    • Feed

      public Feed(MysteryBoxTileEntity box, net.minecraft.world.entity.player.Player player, net.minecraft.world.level.block.state.BlockState blockState, net.minecraft.world.item.ItemStack itemStack, int scrapsLeft)
      Fired when a Mystery Box is about to be fed a scrap. Cancelable.
      Parameters:
      box - The Mystery Box tile entity.
      player - The player instigating this event.
      blockState - The block state of this Mystery Box.
      itemStack - The item stack being used in this interaction.
      scrapsLeft - The current value of the counter for Netherite Scraps required to open this Mystery Box.
  • Method Details

    • getPlayer

      public net.minecraft.world.entity.player.Player getPlayer()
      Gets the player who instigated this event.
      Returns:
      The player entity.
    • getItemStack

      public net.minecraft.world.item.ItemStack getItemStack()
      Gets the item stack used in this interaction.
      Returns:
      The item stack used.
    • getScrapsLeft

      public int getScrapsLeft()
      The current value of the counter for Netherite Scraps required to open this Mystery Box.
      Returns:
      The value of the scrap counter.
    • setScrapsLeft

      public void setScrapsLeft(int scrapsLeft)
      Sets the current value of the counter for Netherite Scraps required to open this Mystery Box.
      Parameters:
      scrapsLeft - The value of the scrap counter.