Class HeirloomCropHarvestedEvent
java.lang.Object
org.bukkit.event.Event
ke.ric.api.events.HeirloomCropHarvestedEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
public class HeirloomCropHarvestedEvent
extends org.bukkit.event.Event
implements org.bukkit.event.Cancellable
Called when a player harvests a Heirloom crop.
Addons can modify the drops or add bonus items.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Constructor Summary
ConstructorsConstructorDescriptionHeirloomCropHarvestedEvent(org.bukkit.entity.Player player, org.bukkit.Location location, CropDefinition cropDefinition, List<org.bukkit.inventory.ItemStack> drops, boolean willReplant) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDrop(org.bukkit.inventory.ItemStack item) Add an additional drop item.Get the crop definition.Get the crop ID.List<org.bukkit.inventory.ItemStack> getDrops()Get the items that will be dropped.static org.bukkit.event.HandlerListorg.bukkit.event.HandlerListorg.bukkit.LocationGet the location where the crop was harvested.org.bukkit.entity.PlayerGet the player who harvested the crop.booleanvoidsetCancelled(boolean cancelled) voidSet the items to drop.voidsetWillReplant(boolean replant) Set whether the crop should replant.booleanCheck if the crop will replant after harvest.Methods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
HeirloomCropHarvestedEvent
public HeirloomCropHarvestedEvent(org.bukkit.entity.Player player, org.bukkit.Location location, CropDefinition cropDefinition, List<org.bukkit.inventory.ItemStack> drops, boolean willReplant)
-
-
Method Details
-
getPlayer
public org.bukkit.entity.Player getPlayer()Get the player who harvested the crop. -
getLocation
public org.bukkit.Location getLocation()Get the location where the crop was harvested. -
getCropDefinition
Get the crop definition. -
getCropId
Get the crop ID. -
getDrops
Get the items that will be dropped. -
setDrops
Set the items to drop. -
addDrop
public void addDrop(org.bukkit.inventory.ItemStack item) Add an additional drop item. -
willReplant
public boolean willReplant()Check if the crop will replant after harvest. -
setWillReplant
public void setWillReplant(boolean replant) Set whether the crop should replant. -
isCancelled
public boolean isCancelled()- Specified by:
isCancelledin interfaceorg.bukkit.event.Cancellable
-
setCancelled
public void setCancelled(boolean cancelled) - Specified by:
setCancelledin interfaceorg.bukkit.event.Cancellable
-
getHandlers
public org.bukkit.event.HandlerList getHandlers()- Specified by:
getHandlersin classorg.bukkit.event.Event
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList()
-