Interface PlantGrowEvent

All Superinterfaces:
Cancellable, Event, FarmingEvent

public interface PlantGrowEvent extends FarmingEvent, Cancellable
Fired when a plant is about to grow: a crop reaching its next stage, a cane growing one block taller, a stem bearing a fruit. FarmingEvent.position() is the plant growing, and FarmingEvent.block() its state before it grows.

Changing the grown state changes what the plant turns into. Cancelling the event leaves the plant as it is; it tries again on a later random tick, or the next time it is fertilized.

Since:
0.1.0
See Also:
  • Method Details

    • target

      BlockPosition target()
      Returns where the grown state is about to be written.: FarmingEvent.position() for a plant growing in place, another block for a plant growing taller or bearing a fruit
      Returns:
      where the grown state is about to be written
      Since:
      0.1.0
    • grown

      BlockData grown()
      Returns the state about to be written at target().
      Returns:
      the state about to be written at target()
      Since:
      0.1.0
    • setGrown

      void setGrown(BlockData grown)
      Sets the state written at target() once the event is over, in place of the one the plant chose.
      Parameters:
      grown - the state to write
      Since:
      0.1.0
    • fertilized

      boolean fertilized()
      Returns true if a fertilizer causes the growth, false if the plant grows on its own.
      Returns:
      true if a fertilizer causes the growth, false if the plant grows on its own
      Since:
      0.1.0