Interface TalePlayer

All Superinterfaces:
PermissionHolder, TaleEntity

public interface TalePlayer extends TaleEntity, PermissionHolder
Represents a player in Hytale.

Players are a specialized type of entity with additional player-specific functionality. They inherit all entity behavior from TaleEntity and permission capabilities from PermissionHolder.

Event Behavior

Players fire both player-specific events (like PlayerJoinCallback) and general entity events (like EntityMoveCallback). When listening to entity events, you can check if the entity is a player using instanceof TalePlayer.

Permissions

Players implement PermissionHolder, providing access to the extensible permission system. Use hasPermission(String) for simple checks, or PermissionHolder.getPermissionValue(String) for dynamic values.


 // Simple boolean check
 if (player.hasPermission("cmd.teleport")) { ... }

 // Dynamic value (e.g., max homes limit)
 int maxHomes = player.getPermissionValue("homes.limit").asInt(3);
 
See Also:
  • Method Details

    • getUniqueId

      String getUniqueId()
      Returns the player's unique identifier.

      This overrides TaleEntity.getUniqueId() to clarify that for players, this represents their account UUID. If the Hytale team ends up using UUIDs, we will use that directly.

      Specified by:
      getUniqueId in interface PermissionHolder
      Specified by:
      getUniqueId in interface TaleEntity
      Returns:
      the player's UUID, guaranteed to be unique
    • getDisplayName

      String getDisplayName()
      Returns the player's display name.

      Note: Display names are NOT guaranteed to be unique across players.

      Returns:
      the player's display name
    • hasPermission

      boolean hasPermission(String permission)
      Checks if the player has the specified permission.

      Permissions are dot-separated strings following a hierarchical convention (e.g., "server.admin.kick", "world.edit", "chat.color").

      Permission checking supports wildcards:

      • server.admin.* - grants all permissions under server.admin
      • * - grants all permissions

      This method is inherited from PermissionHolder and delegates to the active PermissionService.

      Specified by:
      hasPermission in interface PermissionHolder
      Parameters:
      permission - the permission node to check
      Returns:
      true if the player has the permission, false otherwise
    • sendMessage

      void sendMessage(String message)
      Sends a message to the player.
      Parameters:
      message - the message to send