Interface ServerWorldProperties

All Superinterfaces:
DataHolder, DataHolder.Mutable, GameRuleHolder, Identifiable, Keyed, Nameable, ResourceKeyed, ValueContainer, WeatherUniverse, WeatherUniverse.Mutable, WorldProperties

public interface ServerWorldProperties extends WorldProperties, GameRuleHolder, Nameable, Identifiable, ResourceKeyed, WeatherUniverse.Mutable
  • Method Details Link icon

    • world Link icon

      Gets the ServerWorld that correlates to this properties, if available.

      The rules are that the world must be loaded and it's ServerWorld.key() matches this properties' ResourceKeyed.key(). Lastly, the properties of that world and this properties must be reference equal.

      Returns:
      The world or Optional.empty() otherwise
    • displayName Link icon

      default Optional<Component> displayName()
      Gets the name.
      Returns:
      The name
    • setDisplayName Link icon

      default void setDisplayName(@Nullable Component name)
      Sets the name.
      Parameters:
      name - The name
    • initialized Link icon

      default boolean initialized()
      Gets if this has been initialized.
      Returns:
      Is initialized
    • loadOnStartup Link icon

      default boolean loadOnStartup()
      Gets whether this world will load when the server starts up.
      Returns:
      Load on startup
    • setLoadOnStartup Link icon

      default void setLoadOnStartup(boolean loadOnStartup)
      Sets whether this should load when the server starts up.
      Parameters:
      loadOnStartup - Load on startup
    • performsSpawnLogic Link icon

      default boolean performsSpawnLogic()
      Gets whether logic surrounding a spawn position is performed.

      It is up to the implementation on how this setting is handled. For Vanilla Minecraft, the following occurs:

      • If the world is new, a spawn point is calculated
      • The chunks around the spawn point within a radius are kept loaded in memory
      Returns:
      performs spawn logic
    • setPerformsSpawnLogic Link icon

      default void setPerformsSpawnLogic(boolean performsSpawnLogic)
      Sets whether logic surrounding a spawn position is performed.

      It is up to the implementation on how this setting is handled. For Vanilla Minecraft, the following occurs:

      • If the world is new, a spawn point is calculated
      • The chunks around the spawn point within a radius are kept loaded in memory
      Parameters:
      performsSpawnLogic - Performs spawn logic
    • worldGenerationConfig Link icon

      default WorldGenerationConfig worldGenerationConfig()
      Returns:
      The world generation settings
    • setDayTime Link icon

      void setDayTime(MinecraftDayTime time)
      Sets the in-game time of day.
      Parameters:
      time - The time of day
    • worldType Link icon

      default WorldType worldType()
      Gets the WorldType.
      Returns:
      The world type
    • setWorldType Link icon

      default void setWorldType(WorldType worldType)
      Sets the WorldType.
      Parameters:
      worldType - the type
    • pvp Link icon

      default boolean pvp()
      Gets whether PVP combat is enabled.
      Returns:
      pvp
    • setPvp Link icon

      default void setPvp(boolean pvp)
      Sets whether PVP combat is enabled.
      Parameters:
      pvp - pvp
    • gameMode Link icon

      default GameMode gameMode()
      Gets the default GameMode.
      Returns:
      The game mode
    • setGameMode Link icon

      default void setGameMode(GameMode gameMode)
      Sets the GameMode.
      Parameters:
      gameMode - game mode
    • setHardcore Link icon

      default void setHardcore(boolean hardcore)
      Sets if this is in hardcore mode.
      Parameters:
      hardcore - hardcore
    • commands Link icon

      default boolean commands()
      Gets whether commands are enabled.

      It is up to the implementation to determine how this is respected.

      Returns:
      Commands
    • setCommands Link icon

      default void setCommands(boolean commands)
      Sets whether commands are enabled.

      It is up to the implementation to determine how this is respected.

      Parameters:
      commands - commands
    • setDifficulty Link icon

      default void setDifficulty(Difficulty difficulty)
      Sets the Difficulty.
      Parameters:
      difficulty - The difficulty
    • serializationBehavior Link icon

      default SerializationBehavior serializationBehavior()
      Returns:
      Serialization behavior
    • setSerializationBehavior Link icon

      default void setSerializationBehavior(SerializationBehavior behavior)
      Parameters:
      behavior - serialization behavior
    • wanderingTraderSpawnDelay Link icon

      Ticks wanderingTraderSpawnDelay()
      Gets the delay before a WanderingTrader will be spawned, in ticks.

      In vanilla minecraft, 24,000 ticks is the default delay.

      Returns:
      The delay, in ticks
    • setWanderingTraderSpawnDelay Link icon

      void setWanderingTraderSpawnDelay(Ticks delay)
      Sets the delay before a WanderingTrader will be spawned.
      Parameters:
      delay - The delay, in ticks
    • wanderingTraderSpawnChance Link icon

      int wanderingTraderSpawnChance()
      Gets the chance that a WanderingTrader will be spawned, as a percentage

      In vanilla Minecraft, 25% is the default chance

      Returns:
      The delay, as a percentage
    • setWanderingTraderSpawnChance Link icon

      void setWanderingTraderSpawnChance(int chance)
      Sets the chance that a WanderingTrader will be spawned.
      Parameters:
      chance - The chance, as a percentage
    • wanderTraderUniqueId Link icon

      Optional<UUID> wanderTraderUniqueId()
      Gets the unique id of the WanderingTrader that has been spawned.
      Returns:
      The unique id or Optional.empty() if one has not been spawned
    • setWanderingTrader Link icon

      void setWanderingTrader(@Nullable WanderingTrader trader)
      Sets the WanderingTrader.

      In vanilla Minecraft, this will become the spawned trader.

      Parameters:
      trader - The trader
    • customBossBars Link icon

      List<KeyedValue<BossBar>> customBossBars()
      Gets the custom bars.
      Returns:
      The boss bars
    • setCustomBossBars Link icon

      void setCustomBossBars(@Nullable List<KeyedValue<BossBar>> bars)
      Sets the custom bars.
      Parameters:
      bars - The boss bars
    • viewDistance Link icon

      default int viewDistance()
      Gets the view distance.

      In Vanilla Minecraft, this is in units of chunks and is considered the radius. Consult your specific implementation vendor for further details.

      Returns:
      View distance
    • setViewDistance Link icon

      default void setViewDistance(@Nullable Integer viewDistance)
      Sets the view distance (in chunks).

      In Vanilla Minecraft, this is in units of chunks and is considered the radius. Additionally it must be greater than 3 and less than or equal to 32.

      Consult your specific implementation vendor for further details.

      Parameters:
      viewDistance - The view distance
    • worldBorder Link icon

      default WorldBorder worldBorder()
      Gets the saved WorldBorder for this world.
      Returns:
      The world border
    • weather Link icon

      default Weather weather()
      Description copied from interface: WeatherUniverse
      Gets the current Weather taking place in this volume.
      Specified by:
      weather in interface WeatherUniverse
      Returns:
      The current weather.