Class CompostItemEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.block.BlockEvent
io.papermc.paper.event.block.CompostItemEvent
- Direct Known Subclasses:
EntityCompostItemEvent
Called when an item is about to be composted by a hopper.
To prevent hoppers from moving items into composters, cancel the
InventoryMoveItemEvent.-
Nested Class Summary
Nested classes/interfaces inherited from class Event
Event.Result -
Field Summary
Fields inherited from class BlockEvent
block -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic HandlerListgetItem()Gets the item that was used on the composter.intReturns the levels the composter will be raised by.voidsetLevelsToRaise(int raisedLevels) Configures the levels the composter will be raised by.voidsetWillRaiseLevel(boolean willRaiseLevel) Deprecated, for removal: This API element is subject to removal in a future version.booleanDeprecated, for removal: This API element is subject to removal in a future version.items can now control how many layers they add on click.Methods inherited from class BlockEvent
getBlockMethods inherited from class Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
CompostItemEvent
-
-
Method Details
-
getItem
-
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. UsegetLevelsToRaise().Gets whether the composter will rise a level.- Returns:
trueif successful
-
setWillRaiseLevel
Deprecated, for removal: This API element is subject to removal in a future version.Sets whether the composter will rise a level.- Parameters:
willRaiseLevel-trueif the composter should rise a level. UsesetLevelsToRaise(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
- Specified by:
getHandlersin classEvent
-
getHandlerList
-