Interface ServerWorldProperties

    • Method Detail

      • world

        java.util.Optional<ServerWorld> world()
        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

        java.util.Optional<Component> displayName()
        Gets the name.
        Returns:
        The name
      • setDisplayName

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

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

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

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

        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

        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
      • setDayTime

        void setDayTime​(MinecraftDayTime time)
        Sets the in-game time of day.
        Parameters:
        time - The time of day
      • setWorldType

        void setWorldType​(WorldType worldType)
        Sets the WorldType.
        Parameters:
        worldType - the type
      • pvp

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

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

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

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

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

        boolean commands()
        Gets whether commands are enabled.

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

        Returns:
        Commands
      • setCommands

        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

        void setDifficulty​(Difficulty difficulty)
        Sets the Difficulty.
        Parameters:
        difficulty - The difficulty
      • wanderingTraderSpawnDelay

        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

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

        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

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

        java.util.Optional<java.util.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

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

        In vanilla Minecraft, this will become the spawned trader.

        Parameters:
        trader - The trader
      • customBossBars

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

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

        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

        void setViewDistance​(@Nullable java.lang.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