Interface Target

All Known Implementing Classes:
EntityTarget, LocationTarget

public sealed interface Target permits EntityTarget, LocationTarget
Represents a target location or entity within a skill execution context.
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable org.bukkit.entity.Entity
    Gets this target as a Bukkit Entity, if applicable.
    @NotNull org.bukkit.Location
    Gets the location of this target.
    default boolean
    Checks if this target is an entity.
  • Method Details

    • getLocation

      @NotNull @NotNull org.bukkit.Location getLocation()
      Gets the location of this target.
      Returns:
      the target location
    • getAsEntity

      @Nullable @Nullable org.bukkit.entity.Entity getAsEntity()
      Gets this target as a Bukkit Entity, if applicable.
      Returns:
      the target entity, or null if it represents a location
    • isEntity

      default boolean isEntity()
      Checks if this target is an entity.
      Returns:
      true if the target is an entity, false otherwise