Class AsyncPlayerConfigurationEvent

java.lang.Object
net.minestom.server.event.player.AsyncPlayerConfigurationEvent
All Implemented Interfaces:
Event, EntityEvent, PlayerEvent

public class AsyncPlayerConfigurationEvent extends Object implements 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 Details

    • AsyncPlayerConfigurationEvent

      public AsyncPlayerConfigurationEvent(@NotNull @NotNull Player player, boolean isFirstConfig)
  • Method Details

    • getPlayer

      @NotNull public @NotNull Player getPlayer()
      Description copied from interface: PlayerEvent
      Gets the player.
      Specified by:
      getPlayer in interface PlayerEvent
      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

      public void addFeatureFlag(@NotNull @NotNull 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.
      Parameters:
      feature - A minecraft feature flag
      See Also:
    • removeFeatureFlag

      public boolean removeFeatureFlag(@NotNull @NotNull 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 behavior
      Parameters:
      feature - A minecraft feature flag
      Returns:
      if the feature specified existed prior to being removed
      See Also:
    • getFeatureFlags

      @NotNull public @NotNull Set<FeatureFlag> 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

      @Nullable public @Nullable Instance getSpawningInstance()
    • setSpawningInstance

      public void setSpawningInstance(@Nullable @Nullable Instance spawningInstance)