public class AsyncPlayerSendCommandsEvent<S extends BukkitBrigadierCommandSource>
extends org.bukkit.event.player.PlayerEvent
PlayerCommandSendEvent, so no filtering has been done by
other plugins yet.
WARNING: This event will potentially (and most likely) fire twice! Once for Async, and once again for Sync.
It is important that you check event.isAsynchronous() and event.hasFiredAsync() to ensure you only act once.
If for some reason we are unable to send this asynchronously in the future, only the sync method will fire.
Your logic should look like this:
if (event.isAsynchronous() || !event.hasFiredAsync()) { do stuff }
If your logic is not safe to run asynchronously, only react to the synchronous version.| Constructor | Description |
|---|---|
AsyncPlayerSendCommandsEvent(org.bukkit.entity.Player player,
com.mojang.brigadier.tree.RootCommandNode<S> node,
boolean hasFiredAsync) |
Deprecated.
|
| Modifier and Type | Method | Description |
|---|---|---|
com.mojang.brigadier.tree.RootCommandNode<S> |
getCommandNode() |
Deprecated.
|
static @NotNull org.bukkit.event.HandlerList |
getHandlerList() |
Deprecated.
|
@NotNull org.bukkit.event.HandlerList |
getHandlers() |
Deprecated.
|
boolean |
hasFiredAsync() |
Deprecated.
|
public AsyncPlayerSendCommandsEvent(org.bukkit.entity.Player player,
com.mojang.brigadier.tree.RootCommandNode<S> node,
boolean hasFiredAsync)
public com.mojang.brigadier.tree.RootCommandNode<S> getCommandNode()
public boolean hasFiredAsync()
@NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()
getHandlers in class org.bukkit.event.Event@NotNull public static @NotNull org.bukkit.event.HandlerList getHandlerList()
Copyright © 2020. All rights reserved.