Class PlayerPlaceVegetationEvent

All Implemented Interfaces:
Cancellable
Direct Known Subclasses:
PlayerCreativePlaceVegetationEvent

public class PlayerPlaceVegetationEvent extends PlayerVegetationEvent
Called when the player places a plant (saplings, seedlings etc).
  • Constructor Details

    • PlayerPlaceVegetationEvent

      protected PlayerPlaceVegetationEvent(long pointer)
  • Method Details

    • setTypeID

      public void setTypeID(short typeID)
      Sets the type ID of the plant.
      Parameters:
      typeID - the new plant type ID.
    • setPosition

      public void setPosition(Vector3f position)
      Changes the plant position.
      Parameters:
      position - the new plant world position.
    • setPosition

      public void setPosition(float x, float y, float z)
      Changes the plant position.
      Parameters:
      x - the new plant world x position.
      y - the new plant world y position.
      z - the new plant world z position.
    • setRotation

      public void setRotation(Quaternion rotation)
      Changes the plant rotation.
      Parameters:
      rotation - the new plant rotation. Set to null to reset the rotation (Quaternion.IDENTITY).
    • setRotation

      public void setRotation(float pitch, float yaw, float roll)
      Changes the plant rotation.
      Parameters:
      pitch - the new x angle, as euler rotation (pitch).
      yaw - the new y angle, as euler rotation (yaw).
      roll - the new z angle, as euler rotation (roll).
    • isGrowable

      public boolean isGrowable()
      Gets whether or not this plant can grow.
      Returns:
      true if this plant can grow (e.g saplings, seedlings etc), false if not.
    • getGrowthTime

      public int getGrowthTime()
      Gets the growth time for this plant in seconds. The growth time determines how long it takes until this plant grows (reaching the next growth stage). Returns 0 if this plant cannot grow.
      Returns:
      the growth time, in seconds.
    • setGrowthTime

      public void setGrowthTime(int growthTime)
      Sets the growth time (in seconds) for this plant. Only works for plants which are growable (see isGrowable()).
      Parameters:
      growthTime - the new growth duration in seconds.