Package org.bukkit.event.server

# Class TabCompleteEvent

java.lang.Object
org.bukkit.event.Event
org.bukkit.event.server.TabCompleteEvent

All Implemented Interfaces:
  `Cancellable`

public class TabCompleteEvent extends Event implements Cancellable
Called when a `CommandSender` of any description (ie: player or console) attempts to tab complete.
Note that due to client changes, if the sender is a Player, this event will only begin to fire once command arguments are specified, not commands themselves. Plugins wishing to remove commands from tab completion are advised to ensure the client does not have permission for the relevant commands, or use `PlayerCommandSendEvent`.

## Nested Class Summary

## Nested classes/interfaces inherited from class org.bukkit.event.Event

`Event.Result`

## Constructor Summary

Constructors
Constructor
Description
`TabCompleteEvent(@NotNull CommandSender sender, @NotNull String buffer, @NotNull List<String> completions)`
`TabCompleteEvent(@NotNull CommandSender sender, @NotNull String buffer, @NotNull List<String> completions, boolean isCommand, Location location)`

## Method Summary

Modifier and Type
Method
Description
`@NotNull String`
`getBuffer()`
Return the entire buffer which formed the basis of this completion.
`@NotNull List<String>`
`getCompletions()`
The list of completions which will be offered to the sender, in order.
`static @NotNull HandlerList`
`getHandlerList()`
`@NotNull HandlerList`
`getHandlers()`
`Location`
`getLocation()`
`@NotNull CommandSender`
`getSender()`
Get the sender completing this command.
`boolean`
`isCancelled()`
Gets the cancellation state of this event.
`boolean`
`isCommand()`
`void`
`setCancelled(boolean cancelled)`
Sets the cancellation state of this event.
`void`
`setCompletions(@NotNull List<String> completions)`
Set the completions offered, overriding any already set.

### Methods inherited from class org.bukkit.event.Event

`callEvent, getEventName, isAsynchronous`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### TabCompleteEvent

public TabCompleteEvent(@NotNull @NotNull CommandSender sender, @NotNull @NotNull String buffer, @NotNull @NotNull List<String> completions)

### TabCompleteEvent

public TabCompleteEvent(@NotNull @NotNull CommandSender sender, @NotNull @NotNull String buffer, @NotNull @NotNull List<String> completions, boolean isCommand, @Nullable Location location)

## Method Details

### getSender

@NotNull public @NotNull CommandSender getSender()
Get the sender completing this command.

Returns:
  the `CommandSender` instance

### getBuffer

@NotNull public @NotNull String getBuffer()
Return the entire buffer which formed the basis of this completion.

Returns:
  command buffer, as entered

### getCompletions

@NotNull public @NotNull List<String> getCompletions()
The list of completions which will be offered to the sender, in order. This list is mutable and reflects what will be offered.

Returns:
  a list of offered completions

### isCommand

public boolean isCommand()

Returns:
  True if it is a command being tab completed, false if it is a chat message.

### getLocation

@Nullable public Location getLocation()

Returns:
  The position looked at by the sender, or null if none

### setCompletions

public void setCompletions(@NotNull @NotNull List<String> completions)
Set the completions offered, overriding any already set. The passed collection will be cloned to a new List. You must call {`getCompletions()`} to mutate from here

Parameters:
  `completions` - the new completions

### isCancelled

public boolean isCancelled()
Description copied from interface: `Cancellable`
Gets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins

Specified by:
  `isCancelled` in interface `Cancellable`
Returns:
  true if this event is cancelled

### setCancelled

public void setCancelled(boolean cancelled)
Description copied from interface: `Cancellable`
Sets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins.

Specified by:
  `setCancelled` in interface `Cancellable`
Parameters:
  `cancelled` - true if you wish to cancel this event

### getHandlers

@NotNull public @NotNull HandlerList getHandlers()

Specified by:
  `getHandlers` in class `Event`

### getHandlerList

@NotNull public static @NotNull HandlerList getHandlerList()