Class CompostItemEvent

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

@NullMarked 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

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

      @Deprecated(since="26.3", forRemoval=true) public boolean willRaiseLevel()
      Deprecated, for removal: This API element is subject to removal in a future version.
      items can now control how many layers they add on click. Use getLevelsToRaise().
      Gets whether the composter will rise a level.
      Returns:
      true if successful
    • setWillRaiseLevel

      @Deprecated(since="26.3", forRemoval=true) public void setWillRaiseLevel(boolean willRaiseLevel)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets whether the composter will rise a level.
      Parameters:
      willRaiseLevel - true if the composter should rise a level. Use setLevelsToRaise(int).
    • getLevelsToRaise

      public int getLevelsToRaise()
      Returns the levels the composter will be raised by.
      Returns:
      the levels the composter will be raised by
    • setLevelsToRaise

      public void setLevelsToRaise(int raisedLevels)
      Configures the levels the composter will be raised by.
      Parameters:
      raisedLevels - the levels to raise the composter by.
    • getHandlers

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

      public static HandlerList getHandlerList()