Class PlayerInputSession

java.lang.Object
me.tayebyassine.homestead.sessions.PlayerInputSession
All Implemented Interfaces:
org.bukkit.event.Listener

public final class PlayerInputSession extends Object implements org.bukkit.event.Listener
A session that waits for a player to type text input in chat.

Sessions are created via the PlayerInputSession.Builder and automatically register as a Bukkit Listener to intercept the next chat message. The session supports configurable prompt display (chat, title, or action bar), input validation, a cancel keyword, and an automatic timeout.

Only one session can be active per player at a time; creating a new session replaces any previous one.

  • Field Details

  • Method Details

    • isWaitingForInput

      public static boolean isWaitingForInput(org.bukkit.entity.Player player)
      Check whether the given player is currently waiting for input.
      Parameters:
      player - the player to check
      Returns:
      true if an active input session exists for the player
    • builder

      public static PlayerInputSession.Builder builder(Homestead plugin, org.bukkit.entity.Player player)
      Create a new builder for a player input session.
      Parameters:
      plugin - the plugin instance
      player - the player to request input from
      Returns:
      a new builder instance
    • onChat

      public void onChat(org.bukkit.event.player.AsyncPlayerChatEvent e)
    • onCommand

      public void onCommand(org.bukkit.event.player.PlayerCommandPreprocessEvent e)
    • onQuit

      public void onQuit(org.bukkit.event.player.PlayerQuitEvent e)