Interface HarvestEvent
- All Superinterfaces:
Cancellable, Event, FarmingEvent
Fired when a block taking part in farming is about to drop what it gives: a player who is not in
creative mode breaks it or picks its fruits, or it breaks on its own because it can no longer
stand.
FarmingEvent.block() is the state giving the harvest.
drops() can be modified: what is left in it once the event is over is dropped.
Cancelling the event drops nothing; the block is broken or picked all the same.
- Since:
- 0.1.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondrops()Returns the stacks about to be dropped, which listeners may add to, remove from or replace.player()Returns the player harvesting the block,nullwhen it breaks on its own.tool()Returns what the block is harvested with,ItemStack.EMPTYfor a bare hand or when the block breaks on its own.Methods inherited from interface Cancellable
isCancelled, setCancelledMethods inherited from interface FarmingEvent
block, position, world
-
Method Details
-
player
-
tool
ItemStack tool()Returns what the block is harvested with,ItemStack.EMPTYfor a bare hand or when the block breaks on its own.- Returns:
- what the block is harvested with,
ItemStack.EMPTYfor a bare hand or when the block breaks on its own - Since:
- 0.1.0
-
drops
-