Class AsyncPlayerConfigurationEvent
java.lang.Object
net.minestom.server.event.player.AsyncPlayerConfigurationEvent
- All Implemented Interfaces:
Event, AsyncEvent, EntityEvent, PlayerEvent
Called when a player enters the configuration state (either on first connection, or if they are
sent back to configuration later). The player is moved to the play state as soon as all event
handles finish processing this event.
The spawning instance must be set for the player to join.
The event is called off the tick threads, so it is safe to block here
It is valid to kick a player using Player.kick(net.kyori.adventure.text.Component) during this event.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFeatureFlag(FeatureFlag feature) Add a feature flag, see Minecraft Wiki's Feature Flags for a list of applicable features Note: the flag "minecraft:vanilla" is already included by default.The list of currently added feature flags.Gets the player.booleanReturns true if this is the first time the player is in the configuration phase (they are joining), false otherwise.booleanbooleanremoveFeatureFlag(FeatureFlag feature) Remove a feature flag, see Minecraft Wiki's Feature Flags for a list of applicable features Note: removing the flag "minecraft:vanilla" may result in weird behaviorvoidsetClearChat(boolean clearChat) Set whether the player's chat will be cleared when exiting the configuration state.voidsetHardcore(boolean hardcore) voidsetSendRegistryData(boolean sendRegistryData) voidsetSpawningInstance(@Nullable Instance spawningInstance) booleanIf true, the player's chat will be cleared when exiting the configuration state, otherwise it will be preserved.booleanMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface PlayerEvent
getEntity
-
Constructor Details
-
AsyncPlayerConfigurationEvent
-
-
Method Details
-
getPlayer
Description copied from interface:PlayerEventGets the player.- Specified by:
getPlayerin interfacePlayerEvent- Returns:
- the player
-
isFirstConfig
public boolean isFirstConfig()Returns true if this is the first time the player is in the configuration phase (they are joining), false otherwise. -
isHardcore
public boolean isHardcore() -
setHardcore
public void setHardcore(boolean hardcore) -
addFeatureFlag
Add a feature flag, see Minecraft Wiki's Feature Flags for a list of applicable features Note: the flag "minecraft:vanilla" is already included by default.- Parameters:
feature- A minecraft feature flag- See Also:
-
removeFeatureFlag
Remove a feature flag, see Minecraft Wiki's Feature Flags for a list of applicable features Note: removing the flag "minecraft:vanilla" may result in weird behavior- Parameters:
feature- A minecraft feature flag- Returns:
- if the feature specified existed prior to being removed
- See Also:
-
getFeatureFlags
The list of currently added feature flags. This is an unmodifiable copy of what will be sent to the client.- Returns:
- An unmodifiable set of feature flags
- See Also:
-
willClearChat
public boolean willClearChat()If true, the player's chat will be cleared when exiting the configuration state, otherwise it will be preserved. The default is not to clear the chat.- Returns:
- true if the chat will be cleared, false otherwise
- See Also:
-
setClearChat
public void setClearChat(boolean clearChat) Set whether the player's chat will be cleared when exiting the configuration state.- Parameters:
clearChat- true to clear the chat, false otherwise- See Also:
-
willSendRegistryData
public boolean willSendRegistryData() -
setSendRegistryData
public void setSendRegistryData(boolean sendRegistryData) -
getSpawningInstance
-
setSpawningInstance
-