Skip to content

API Usages (NetherPortals)

Ben Woo edited this page Mar 15, 2021 · 3 revisions

This pages provides examples and explanation for the common API usages of Multiverse-Core introduced here. It's impossible to cover all API methods in this guide, but rest assured we have javadocs and source code provided.

The MVWorldManager interface is the heart of managing worlds in Multiverse. You can use various methods in this class to create, delete, regen worlds and much more!

Getting the WorldManager instance

MVWorldManager worldManager = core.getMVWorldManager();

If you are unsure of getting the Multiverse-Core instance, see here.

Creating a world

Lets now create a new overworld called creative.

worldManager.addWorld(
    "creative", // The worldname
    World.Environment.NORMAL, // The overworld environment type.
    null, // The world seed. Any seed is fine for me, so we just pass null.
    WorldType.NORMAL, // Nothing special. If you want something like a flat world, change this.
    true, // This means we want to structures like villages to generator, Change to false if you don't want this.
    null // Specifies a custom generator. We are not using any so we just pass null.
);

Things to note:

  • World names follow the Bukkit API's NamespacedKey, which means it does not allow spaces or special characters.

Loading/Unloading a world

You may want to unload worlds when unused and load them back when it's needed.

// unloading
worldManager.unloadWorld("creative");

// loading
worldManager.loadWorld("creative");

Things to note:

  • You cannot unload the default world defined in level-name of server.properties.
  • You can only load worlds that are known by Multiverse, use the MVWorldManager#addWorld method mentioned previously.

Multiverse-Core

Getting Started

Configuration

Help

Developers

Other

Multiverse-Portals

Getting Started

Configuration

Developers

Multiverse-NetherPortals

Getting Started

Configuration

Help

Developers

Multiverse-Inventories

Getting Started

Configuration

Help

Developers

Multiverse-SignPortals

Getting Started

Configuration


A great place to get help is from Multiverse's Discord (Click the logo for invite link):

Multiverse's Discord

Clone this wiki locally