Skip to main content

World SDK

com.n3plugins.sdk.world owns read-side world and world-map reference material. Use it when a plugin needs current-world state, loaded world-list snapshots, or coordinate conversions. World hopping writes stay in WorldActions.

note

This page covers reads only. Opening the hopper, loading worlds, and hopping are result-aware action operations documented on World Actions.

WorldsApi

WorldsApi reads the current world id, current world flags, and loaded RuneLite world-list entries.

Optional<Integer> currentWorld = WorldsApi.currentWorldId();

List<WorldSnapshot> members = WorldsApi.worlds().stream()
.filter(world -> world.hasType(WorldType.MEMBERS))
.collect(Collectors.toList());

Optional<WorldSnapshot> world302 = WorldsApi.find(302);
Optional<WorldSnapshot> current = WorldsApi.current();

Methods:

  • currentWorldId() - current world id, or empty when the client is unavailable or does not expose a positive world id.
  • currentWorldTypes() - immutable current world type flags from client.getWorldType(), or an empty list when unavailable.
  • worlds() - immutable WorldSnapshot list from client.getWorldList(), or empty before the world list is loaded.
  • find(worldId) - matching WorldSnapshot from the loaded list.
  • current() - current world's loaded WorldSnapshot, if both the current id and world list entry are available.
  • currentWorldHasType(type) - true when the current world type list contains the requested WorldType.

WorldSnapshot

WorldSnapshot is an immutable copy of a RuneLite World list entry. It contains:

  • getId()
  • getPlayerCount()
  • getLocation()
  • getIndex()
  • getActivity()
  • getAddress()
  • getTypes()
  • hasType(type)
  • isCurrent()

getTypes() returns a defensive EnumSet copy. isCurrent() is set by comparing the entry id to the current client world id at snapshot time.

WorldMapApi

WorldMapApi reads world-map state and performs current-client coordinate conversions.

boolean open = WorldMapApi.isOpen();
Optional<Point> center = WorldMapApi.mapPosition();
Optional<Float> zoom = WorldMapApi.zoom();

Optional<LocalPoint> local = WorldMapApi.toLocal(worldPoint);
Optional<WorldPoint> world = WorldMapApi.toWorld(localPoint);

Methods:

  • isOpen() - checks whether the world-map view widget is visible.
  • mapPosition() - current world-map center position from RuneLite's WorldMap, when available.
  • zoom() - current world-map zoom from RuneLite's WorldMap, when available.
  • toLocal(worldPoint) - converts a world tile to a scene LocalPoint, or empty when the client is unavailable, the point is null, or the tile is outside the current scene.
  • toWorld(localPoint) - converts a local point to a top-level world tile, or empty when the client or point is unavailable.

These helpers report state and convert coordinates only. They do not add menu entries, start walking, open the map, or hop worlds.