Interface MouseEvent

All Superinterfaces:
Event

public interface MouseEvent extends Event
Provides contextual information about mouse movement and what button caused the event.
  • Method Details

    • isShiftPressed

      boolean isShiftPressed()
      Tests if the viewer has the shift key held down.
      Returns:
      true, if the shift key was pressed false otherwise
    • getButton

      MouseButton getButton()
      Gets the button that was pressed to trigger this event, or MouseButton.NONE if this button is not related to a mouse button action.
      Returns:
      Pressed button
    • getScrollDirection

      ScrollDirection getScrollDirection()
      Gets the scroll direction, or ScrollDirection.NONE, if this event is not related to a scroll action.
      Returns:
      Scroll direction.
    • getScreenPosition

      org.joml.Vector2f getScreenPosition()
      Gets the screen coordinates of the viewer's cursor
      Returns:
      Cursor screen position
    • getWorldPosition

      org.joml.Vector3f getWorldPosition()
      Gets the world space position of the viewer's cursor
      Returns:
      Cursor world position
    • getPlayer

      org.bukkit.entity.Player getPlayer()
      Gets the player that caused this event
      Returns:
      Player