Skip to content

Latest commit

 

History

History
73 lines (54 loc) · 1.76 KB

File metadata and controls

73 lines (54 loc) · 1.76 KB

World API Reference

Complete reference for the HytaleLoader World API.

Overview

The World class (fr.hytale.loader.api.World) is a lightweight wrapper around Hytale's native world object. It provides simplified access to world information and serves as a reference in Location objects.

Getting a World Instance

From Player Location

Player player = event.getPlayer();
Location loc = player.getLocation();
World world = loc.getWorld();

Most common way to get a world reference.

From Native World

com.hypixel.hytale.server.core.universe.world.World nativeWorld = /* ... */;
World world = new World(nativeWorld);

Wrap a native Hytale world object.

Methods

getName()

String worldName = world.getName();
player.sendMessage("You are in: " + worldName);

Returns the name of the world.

Returns: String - The world name (e.g., "default", "nether", etc.)

getNativeWorld()

com.hypixel.hytale.server.core.universe.world.World nativeWorld = world.getNativeWorld();

// Use native world for advanced operations
nativeWorld.execute(() -> {
    // Thread-safe world operations
});

Returns the underlying native Hytale world object.

Returns: com.hypixel.hytale.server.core.universe.world.World - Native world instance

Use Cases:

  • Advanced ECS operations
  • Thread-safe world manipulation via world.execute()
  • Accessing native-only features

Common Use Cases

Checking World Name

Location loc = player.getLocation();
if (loc.getWorld().getName().equals("dungeon")) {
    player.sendMessage("You are in a dungeon!");
}

Version History

  • v1.0.4: Initial World API release

See Also