Class ChatEditor
java.lang.Object
net.joseplay.allianceutils.api.chat.ChatEditor
- All Implemented Interfaces:
org.bukkit.event.Listener
Utility listener that allows capturing the next chat message from a player
and redirecting it to a custom handler.
Commonly used for chat-based input systems (e.g. menus, editors). When a player is registered, their next message will:
- Be intercepted
- Not be sent to public chat
- Be delivered to the provided
Consumer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidonChat(org.bukkit.event.player.AsyncPlayerChatEvent event) Intercepts chat messages and redirects them if the player is registered.static voidRegisters a player to wait for their next chat message.
-
Constructor Details
-
ChatEditor
public ChatEditor()
-
-
Method Details
-
wait
Registers a player to wait for their next chat message.- Parameters:
player- the player who will provide inputconsumer- the handler that will receive the message
-
onChat
public void onChat(org.bukkit.event.player.AsyncPlayerChatEvent event) Intercepts chat messages and redirects them if the player is registered.- Parameters:
event- the chat event
-