Class PlayerMouseButtonEvent

java.lang.Object
fr.hytale.loader.event.types.player.PlayerMouseButtonEvent
All Implemented Interfaces:
com.hypixel.hytale.event.IBaseEvent<Void>, com.hypixel.hytale.event.IEvent<Void>

public class PlayerMouseButtonEvent extends Object implements com.hypixel.hytale.event.IEvent<Void>
Called when a player clicks a mouse button.

This event is fired when a player presses or releases a mouse button. It provides access to the button ID, the action (press/release), and interaction details.

Since:
1.0.2
Version:
1.0.4
Author:
HytaleLoader
  • Constructor Summary

    Constructors
    Constructor
    Description
    PlayerMouseButtonEvent(com.hypixel.hytale.server.core.event.events.player.PlayerMouseButtonEvent originalEvent, Player player)
    Constructs a new PlayerMouseButtonEvent.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Gets the client use time.
    com.hypixel.hytale.server.core.asset.type.item.config.Item
    Gets the item in the player's hand.
    com.hypixel.hytale.protocol.MouseButtonEvent
    Gets the mouse button event details.
    Gets the player who clicked the mouse button.
    com.hypixel.hytale.protocol.Vector2f
    Gets the screen point coordinates.
    com.hypixel.hytale.math.vector.Vector3i
    Gets the target block position.
    com.hypixel.hytale.server.core.entity.Entity
    Gets the target entity.
    boolean
    Checks if this event has been cancelled.
    void
    setCancelled(boolean cancelled)
    Sets the cancelled state of this event.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PlayerMouseButtonEvent

      public PlayerMouseButtonEvent(com.hypixel.hytale.server.core.event.events.player.PlayerMouseButtonEvent originalEvent, Player player)
      Constructs a new PlayerMouseButtonEvent.
      Parameters:
      originalEvent - the original Hytale player mouse button event
      player - the player who clicked the mouse button
  • Method Details

    • getMouseButton

      public com.hypixel.hytale.protocol.MouseButtonEvent getMouseButton()
      Gets the mouse button event details.
      Returns:
      the mouse button event
    • getClientUseTime

      public long getClientUseTime()
      Gets the client use time.
      Returns:
      the client use time
    • getItemInHand

      public com.hypixel.hytale.server.core.asset.type.item.config.Item getItemInHand()
      Gets the item in the player's hand.
      Returns:
      the item in hand
    • getTargetBlock

      public com.hypixel.hytale.math.vector.Vector3i getTargetBlock()
      Gets the target block position.
      Returns:
      the target block position
    • getTargetEntity

      public com.hypixel.hytale.server.core.entity.Entity getTargetEntity()
      Gets the target entity.
      Returns:
      the target entity
    • getScreenPoint

      public com.hypixel.hytale.protocol.Vector2f getScreenPoint()
      Gets the screen point coordinates.
      Returns:
      the screen point
    • isCancelled

      public boolean isCancelled()
      Checks if this event has been cancelled.
      Returns:
      true if cancelled, false otherwise
    • setCancelled

      public void setCancelled(boolean cancelled)
      Sets the cancelled state of this event.
      Parameters:
      cancelled - true to cancel, false to allow
    • getPlayer

      public Player getPlayer()
      Gets the player who clicked the mouse button.
      Returns:
      the player