Interface User

All Superinterfaces:
Subject
All Known Subinterfaces:
ClanPlayer

public interface User extends Subject
Represents an online or offline player.
  • Method Details

    • getUniqueId

      UUID getUniqueId()
      Gets the UUID of user.
    • getPlayerData

      PlayerData getPlayerData()
      Gets the PlayerData of user.
      Returns:
      The player data
    • isOnline

      boolean isOnline()
      Whether this user is online.
      Returns:
      true if online, false otherwise
    • getOnlinePlayer

      @Nullable Object getOnlinePlayer()
      Gets the online player object.
      Returns:
      The online player object, if available
    • getCurrentClaim

      @Nullable Claim getCurrentClaim()
      Gets the current Claim player is in. Note: This will return no claim if player is not online.
      Returns:
      The current claim
    • canBreak

      default boolean canBreak(Object location)
      Checks if this user can break a block at specified location.
      Parameters:
      location - The target block location
      Returns:
      true if user can break, false if not
    • canPlace

      default boolean canPlace(Object placedItem, Object location)
      Checks if this user can place a block at specified location.
      Parameters:
      placedItem - The item being placed
      location - The target block location
      Returns:
      true if user can place, false if not
    • canHurtEntity

      default boolean canHurtEntity(Object itemStack, Object entity)
      Checks if this player can attack entity.
      Parameters:
      itemStack - The item being used to attack entity
      entity - The target entity
      Returns:
      true if entity can be attacked, false if not
    • canInteractWithEntity

      default boolean canInteractWithEntity(Object itemStack, Object entity, TrustType trustType)
      Checks if this player can interact with entity.
      Parameters:
      itemStack - The item being used to interact with entity
      entity - The target entity
      trustType - The minimum TrustType required
      Returns:
      true if entity can be interacted with, false if not
    • canUseBlock

      default boolean canUseBlock(Object location, TrustType trustType, boolean leftClick, boolean shift)
      Checks if this user can use a block at specified location.
      Parameters:
      location - The target block location
      trustType - The minimum TrustType required
      leftClick - If block will be activated on left-click
      shift - If block activation requires shift
      Returns:
      true if user can use block, false if not
    • canUseItem

      default boolean canUseItem(Object itemStack, Object location, TrustType trustType, boolean leftClick, boolean shift)
      Checks if this user can use item at a specified location.
      Note: If item is custom, pass a string identifier in format 'modid:name'
      Note: If item is activated on right-click then 'leftClick' should be false.
      Parameters:
      itemStack - The target itemStack
      location - The location where item will be used
      trustType - The minimum TrustType required.
      leftClick - If item will be activated on left-click.
      shift - If item activation requires shift.
      Returns:
      true if player can use item, false if not
    • canIgnoreClaim

      default boolean canIgnoreClaim(Claim claim)
      Checks if this user can ignore a claim.
      Parameters:
      claim - The claim to check
      Returns:
      Whether this user can ignore the claim
    • canManageAdminClaims

      default boolean canManageAdminClaims()
      Checks if this user can manage admin claims.
      Returns:
      true if can manage, false if not
    • canManageWildernessClaims

      default boolean canManageWildernessClaims()
      Checks if this user can manage wilderness claims.
      Returns:
      true if can manage, false if not
    • canPvp

      default boolean canPvp(Claim claim)
      Checks if this user can pvp in Claim.
      Parameters:
      claim - The claim to check
      Returns:
      Whether user has ability to pvp inside claim
    • inPvpCombat

      default boolean inPvpCombat()
      Checks if this user is in pvp combat.
      Returns:
      true if in pvp combat, false if not