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
 
 public class ServerConnectEvent extends Event implements 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 SummaryNested Classes Modifier and Type Class Description static classServerConnectEvent.Reason
 - 
Constructor SummaryConstructors Constructor Description ServerConnectEvent(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 SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancanEqual(Object other)booleanequals(Object o)ProxiedPlayergetPlayer()Player connecting to a new server.ServerConnectEvent.ReasongetReason()Reason for connecting to a new server.ServerConnectRequestgetRequest()Request used to connect to given server.@NonNull ServerInfogetTarget()Server the player will be connected to.inthashCode()booleanisCancelled()Cancelled state.voidsetCancelled(boolean cancelled)Cancelled state.voidsetTarget(@NonNull ServerInfo target)Server the player will be connected to.StringtoString()
 
- 
- 
- 
Constructor Detail- 
ServerConnectEvent@Deprecated public ServerConnectEvent(ProxiedPlayer player, ServerInfo target) Deprecated.
 - 
ServerConnectEvent@Deprecated public ServerConnectEvent(ProxiedPlayer player, ServerInfo target, ServerConnectEvent.Reason reason) Deprecated.
 - 
ServerConnectEventpublic ServerConnectEvent(ProxiedPlayer player, ServerInfo target, ServerConnectEvent.Reason reason, ServerConnectRequest request) 
 
- 
 - 
Method Detail- 
getPlayerpublic ProxiedPlayer getPlayer() Player connecting to a new server.
 - 
getTarget@NonNull public @NonNull ServerInfo getTarget() Server the player will be connected to.
 - 
getReasonpublic ServerConnectEvent.Reason getReason() Reason for connecting to a new server.
 - 
getRequestpublic ServerConnectRequest getRequest() Request used to connect to given server.
 - 
isCancelledpublic boolean isCancelled() Cancelled state.- Specified by:
- isCancelledin interface- Cancellable
- Returns:
- the cancelled state of this event
 
 - 
setTargetpublic void setTarget(@NonNull @NonNull ServerInfo target)Server the player will be connected to.
 - 
setCancelledpublic void setCancelled(boolean cancelled) Cancelled state.- Specified by:
- setCancelledin interface- Cancellable
- Parameters:
- cancelled- the state to set
 
 - 
canEqualprotected boolean canEqual(Object other) 
 
- 
 
-