Interface HitBoxListener


public interface HitBoxListener
Listens for events related to a HitBox, such as damage, interaction, and mounting.

This interface allows for custom behavior when a hitbox is interacted with.

Since:
1.15.2
  • Field Details

    • EMPTY

      static final HitBoxListener EMPTY
      An empty listener that does nothing.
      Since:
      1.15.2
  • Method Details

    • builder

      @NotNull static @NotNull HitBoxListener.Builder builder()
      Creates a new builder for HitBoxListener.
      Returns:
      a new builder
      Since:
      1.15.2
    • handle

      @Internal boolean handle(@NotNull @NotNull HitBoxEvent event)
      Handles a hitbox event.
      Parameters:
      event - target event
      Returns:
      whether target event is triggered
      Since:
      2.1.0
    • sync

      @Internal void sync(@NotNull @NotNull HitBox hitBox)
      Handles tick method.
      Parameters:
      hitBox - target hitbox
      Since:
      2.1.0
    • toBuilder

      @NotNull @NotNull HitBoxListener.Builder toBuilder()
      Creates a builder initialized with this listener's current handlers.
      Returns:
      a new builder
      Since:
      1.15.2