Package net.md_5.bungee.api.event
Class ServerConnectEvent
java.lang.Object
net.md_5.bungee.api.plugin.Event
net.md_5.bungee.api.event.ServerConnectEvent
- All Implemented Interfaces:
Cancellable
Called when deciding to connect to a server. At the time when this event is
called, no connection has actually been made. Cancelling the event will
ensure that the connection does not proceed and can be useful to prevent
certain players from accessing certain servers.
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionServerConnectEvent
(ProxiedPlayer player, ServerInfo target) Deprecated.ServerConnectEvent
(ProxiedPlayer player, ServerInfo target, ServerConnectEvent.Reason reason) Deprecated.ServerConnectEvent
(ProxiedPlayer player, ServerInfo target, ServerConnectEvent.Reason reason, ServerConnectRequest request) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
Player connecting to a new server.Reason for connecting to a new server.Request used to connect to given server.@NonNull ServerInfo
Server the player will be connected to.int
hashCode()
boolean
Cancelled state.void
setCancelled
(boolean cancelled) Cancelled state.void
setTarget
(@NonNull ServerInfo target) Server the player will be connected to.toString()
-
Constructor Details
-
ServerConnectEvent
Deprecated. -
ServerConnectEvent
@Deprecated public ServerConnectEvent(ProxiedPlayer player, ServerInfo target, ServerConnectEvent.Reason reason) Deprecated. -
ServerConnectEvent
public ServerConnectEvent(ProxiedPlayer player, ServerInfo target, ServerConnectEvent.Reason reason, ServerConnectRequest request)
-
-
Method Details
-
getPlayer
Player connecting to a new server. -
getTarget
Server the player will be connected to. -
getReason
Reason for connecting to a new server. -
getRequest
Request used to connect to given server. -
isCancelled
public boolean isCancelled()Cancelled state.- Specified by:
isCancelled
in interfaceCancellable
- Returns:
- the cancelled state of this event
-
setTarget
Server the player will be connected to. -
setCancelled
public void setCancelled(boolean cancelled) Cancelled state.- Specified by:
setCancelled
in interfaceCancellable
- Parameters:
cancelled
- the state to set
-
toString
-
equals
-
canEqual
-
hashCode
public int hashCode()
-