Interface Server

All Superinterfaces:
Audience, ForwardingAudience, Pointered

public interface Server extends ForwardingAudience
  • Field Details

    • DEFAULT_WORLD_UNLOAD

      static final Consumer<Player> DEFAULT_WORLD_UNLOAD
  • Method Details

    • pluginHandler

      @NotNull @NotNull PluginHandler pluginHandler()
      Gets the PluginHandler instance
      Returns:
      the plugin handler instance
      Since:
      1.0.0
    • eventHandler

      @NotNull @NotNull EventHandler eventHandler()
      Gets the EventHandler instance
      Returns:
      the event handler instance
      Since:
      1.0.0
    • commandHandler

      @NotNull @NotNull CommandHandler commandHandler()
      Gets the CommandHandler instance
      Returns:
      the command handler instance
      Since:
      1.0.0
    • teamHandler

      @NotNull @NotNull TeamHandler teamHandler()
      Gets the TeamHandler instance
      Returns:
      the team handler instance
      Since:
      1.0.0
    • scheduler

      @NotNull @NotNull Scheduler scheduler()
      Gets the Scheduler instance
      Returns:
      the scheduler instance
      Since:
      1.0.0
    • onlinePlayers

      @NotNull @NotNull Collection<? extends Player> onlinePlayers()
      Gets all players currently connected.
      Returns:
      the players online
      Since:
      1.0.0
    • playerCount

      int playerCount()
      Gets the number of players currently connected.
      Returns:
      the number of players
      Since:
      1.0.0
    • player

      @Nullable @Nullable Player player(@NotNull @NotNull UUID uniqueId)
      Gets a player by its unique id
      Parameters:
      uniqueId - the unique id of the player
      Returns:
      the player or null
      Since:
      1.0.0
    • createWorld

      @NotNull @NotNull World createWorld(@NotNull World.Builder builder)
      Creates a world with the specified builder.
      Parameters:
      builder - the builder for the world
      Returns:
      the world
      Since:
      1.0.0
    • world

      @Nullable @Nullable World world(@NotNull @NotNull String name)
      Gets a world by its name.
      Parameters:
      name - the name of the world
      Returns:
      the world or null
      Since:
      1.0.0
    • unloadWorld

      void unloadWorld(@NotNull @NotNull World world, @NotNull @NotNull Consumer<Player> consumer)
      Unloads the specified world.
      Parameters:
      world - the world to unload
      consumer - the consumer to consume all players in the world
      Since:
      1.0.0
    • unloadWorld

      default void unloadWorld(@NotNull @NotNull World world)
      Unloads the specified world.
      Parameters:
      world - the world to unload
      Since:
      1.0.0
    • createEntity

      <T extends Entity> T createEntity(@NotNull @NotNull Class<T> clazz)
      Creates an entity by its class.
      Type Parameters:
      T - the entity type
      Parameters:
      clazz - the class of the entity
      Returns:
      a new instance of the specified entity type
      Since:
      1.0.0
    • entity

      @Nullable @Nullable Entity entity(int id)
      Gets an entity by its id.
      Parameters:
      id - the id of the entity
      Returns:
      the entity or null
      Since:
      1.0.0
    • createContainer

      @NotNull @NotNull Container createContainer(@NotNull Container.Type type, @NotNull @NotNull Component title)
      Creates a container by its type.
      Parameters:
      type - the type of the container
      title - the title of the container
      Returns:
      a new instance of the container
      Since:
      1.0.0
    • consoleCommandSource

      @NotNull @NotNull CommandSource consoleCommandSource()
      Gets the console command source object.
      Returns:
      the console command source object
      Since:
      1.0.0
    • config

      @NotNull @NotNull MinecraftConfig config()
      Gets the configuration.
      Returns:
      the configuration
      Since:
      1.0.0
    • createScoreboard

      @NotNull @NotNull Scoreboard createScoreboard(@NotNull @NotNull String name, @NotNull @NotNull Component displayName, @Nullable @Nullable NumberFormat numberFormat, @NotNull @NotNull DisplaySlot displaySlot)
      Creates a new scoreboard/objective with the specified attributes.
      Parameters:
      name - the name of the objective
      displayName - the display name of the objective
      numberFormat - the number format or null for the default one
      displaySlot - the display slot of the objective
      Returns:
      the newly created scoreboard
      Since:
      1.0.0
    • shutdown

      void shutdown()
      Shutdowns the server.
      Since:
      1.0.0