Class CompostItemEvent

java.lang.Object
org.bukkit.event.Event
org.bukkit.event.block.BlockEvent
io.papermc.paper.event.block.CompostItemEvent
Direct Known Subclasses:
EntityCompostItemEvent

public class CompostItemEvent extends BlockEvent
Called when an item is about to be composted by a hopper. To prevent hoppers from moving items into composters, cancel the InventoryMoveItemEvent.
  • Constructor Details

  • Method Details

    • getItem

      @NotNull public @NotNull ItemStack getItem()
      Gets the item that was used on the composter.
      Returns:
      the item
    • willRaiseLevel

      public boolean willRaiseLevel()
      Gets whether the composter will rise a level.
      Returns:
      true if successful
    • setWillRaiseLevel

      public void setWillRaiseLevel(boolean willRaiseLevel)
      Sets whether the composter will rise a level.
      Parameters:
      willRaiseLevel - true if the composter should rise a level
    • getHandlers

      @NotNull public @NotNull HandlerList getHandlers()
      Specified by:
      getHandlers in class Event
    • getHandlerList

      @NotNull public static @NotNull HandlerList getHandlerList()