Class PlayerInputSession
java.lang.Object
me.tayebyassine.homestead.sessions.PlayerInputSession
- All Implemented Interfaces:
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA builder for constructingPlayerInputSessioninstances with a fluent API. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic PlayerInputSession.BuilderCreate a new builder for a player input session.static booleanisWaitingForInput(org.bukkit.entity.Player player) Check whether the given player is currently waiting for input.voidonChat(org.bukkit.event.player.AsyncPlayerChatEvent e) voidonCommand(org.bukkit.event.player.PlayerCommandPreprocessEvent e) voidonQuit(org.bukkit.event.player.PlayerQuitEvent e)
-
Field Details
-
SESSIONS
-
-
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:
trueif an active input session exists for the player
-
builder
Create a new builder for a player input session.- Parameters:
plugin- the plugin instanceplayer- 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)
-