public interface TabCompleteEvent extends Event, Cancellable
Player
send a tab complete requests.
In Vanilla, this is done by pressing the TAB
key while chat
is open.
Modifier and Type | Interface and Description |
---|---|
static interface |
TabCompleteEvent.Chat
Fired when a
Player sends a tab complete request for chat. |
static interface |
TabCompleteEvent.Command
Fired when a
Player sends a tab complete request for a command. |
Modifier and Type | Method and Description |
---|---|
List<String> |
getOriginalTabCompletions()
Gets the immutable list of the suggestions originally generated.
|
String |
getRawMessage()
Gets the message sent to the server for tab completion.
|
List<String> |
getTabCompletions()
Gets the list of available suggestions.
|
Optional<Location<World>> |
getTargetPos()
Gets the location of the block that the player is looking at, if
available.
|
boolean |
isUsingBlock()
Gets whether the player is tab completing from a block's GUI.
|
getCause, getContext, getSource
isCancelled, setCancelled
String getRawMessage()
The Vanilla client does not send the entire contents of the chat box. Instead, it sends the contents of the chat box up to the cursor position (excluding the character after the cursor).
List<String> getOriginalTabCompletions()
In Vanilla, these suggestions are usually player names, in the case
of TabCompleteEvent.Chat
.
Note: Entries *should not* contain spaces, as they produce strange behavior on the Vanilla client (tabbing between entries causes them to be appended to the text box, instead of replacing the existing entry.
List<String> getTabCompletions()
Optional<Location<World>> getTargetPos()
In Vanilla, this will be available if the player is looking at a block within mineable range (the wireframe is displayed on the client).
boolean isUsingBlock()
In Vanilla, this will be true
if the player is tab
completing in a commandblock or commandblock minecart's GUI, and
false
otherwise.