docs.dev

SDK Overview

The two n3Client SDK artifacts, their module map, the core contracts every plugin relies on, and task-based entry points into the reference pages.

The n3Client distribution ships two SDK artifacts, base-api and api, that plugins compile against. This page is the index; each area has a dedicated reference with verified surfaces, worked examples, failure handling and known limits. The source of truth for this page is docs/SDK-DOCS.md in the n3Client repository.

Module map

base-api   (low-level contract)
├── dev.n3u            # Static accessors, invoke() thread helpers, Logger, ClientPaths
├── dev.n3u.api        # N* native interfaces: NClient, NPacketWriter, NPacketBuffer, ...
├── dev.n3u.packets    # PacketBuffer codecs, ByteBufferPool, PacketMapReader
├── dev.n3u.services   # ClickManager, ClickStrategy, ClickPacket, ipc, hotswapper,
│                      # ConfigManager, AutoLogin, WorldSetter, CatFacts,
│                      # mouserecorder/trajectory, profiler, proxy, pathfinder algo enum
├── dev.n3u.util       # ClientConfig + NConfig proxies, optionsparser, ThreadPool,
│                      # reflection helpers, Profiler (lightweight timing)
├── dev.n3u.data       # login types; dev.n3u.events: PacketReceived/Sent, BankCacheChanged
└── dev.n3u.model.ui   # N3Theme, options panel, Fancy* Swing components, NPluginPanel

api   (high-level SDK)
├── dev.n3u.queries             # fluent queries: NpcQuery, InventoryQuery, WidgetQuery, ...
├── dev.n3u.api.entities        # NpcAPI, PlayerAPI, TileItemAPI, TileObjectAPI, ActorAPI
├── dev.n3u.api.game            # Movement, Scene, Combat, Skill, Var, Camera, Worlds, Quest,
│                               # House, ClientScript, Game + game/sailing
├── dev.n3u.api.widgets         # facades: Bank, Inventory, Dialogue, Widget, Equipment, ...
├── dev.n3u.api.threaded        # Delays, Dialogues, Cannon, GrandExchange, Minigames
├── dev.n3u.api.handlers        # BankBuilder, NpcBuilder, TileObjectBuilder, TradeBuilder, ...
├── dev.n3u.api.loadouts        # Inventory/Equipment loadouts, restock config
├── dev.n3u.util.handler        # StepHandler engine + Script DSL (handler/script)
├── dev.n3u.services.pathfinder # Walker, WalkerPath, StrategicPathing, transports, teleports
├── dev.n3u.services            # GameManager (tick source, path rendering), mouse overlay
├── dev.n3u.util                # NPlugin base class, ClickManagerUtil, AsyncTask,
│                               # ActorPathing, Location, MessageUtil, WorldPointUtil,
│                               # DialogueNode, Distance, RelativePosition, TileDrawingUtil
└── dev.n3u.data                # wrappers (ActorEx, PlayerEx, NpcEx, ItemEx, TileItemEx,
                                # TileObjectEx) + locatables (BankLocations, ...)

The map summarizes main entry points per package, verified by directory listing on 2026-11-06; smaller helpers inside listed packages are not itemized.

Core contracts

  • Thread affinity — every mutating API hops to the client thread via Static.invoke; worker-thread automation (the NPlugin.loop() model, the Script DSL, Walker) sleeps with Delays.tick() and must never run on the client thread. See SDK Client Reference.
  • Access — Static.getClient() returns the injected NClient; Static.getNConfig() returns the ClientConfig proxy; Static.invoke/invokeLater/post are the dispatch and event-bus primitives.
  • Snapshots — query results are point-in-time; re-query each tick. Wrapper objects (*Ex) are live handles, not snapshots: ActorEx wraps the live actor reference (protected final N actor, ActorEx.java:33; NpcEx/PlayerEx extend it) and every accessor reads current game state at call time (isIdle, getInteracting, healthBarVisible) — re-query each tick for identity/despawn reasons, not because values are frozen.

Reference pages

PageArea
SDK Client ReferenceStatic, NClient/N* interfaces, wrappers, config proxies, CLI options, events, Logger
SDK Queries Referencedev.n3u.queries — all query classes and the shared AbstractQuery vocabulary
SDK Widgets Referencewidget facades, handler builders, loadouts
SDK Game Referencegame, entities, threaded packages and sailing API
SDK Packets ReferenceNPacketWriter send methods, PacketBuffer codecs, packet events
SDK Pathfinder ReferenceWalker, algorithms, collision/transport/teleport data, boat pathing
docs/sdk-services-reference.md (repository)IPC, hot-swap classloading, config storage, auto-login, proxies

The services reference is not published on this site; read it in the repository.

Task-based entry points

I want to…Start at
Build an external pluginExternal plugins (NPlugin, Gradle setup, sideloading)
Automate a multi-step workflowdocs/SCRIPT-DSL.md (repository) or the handler builders in SDK Widgets Reference
Find and interact with entitiesSDK Queries Reference + SDK Game Reference
Walk somewhereSDK Pathfinder Reference
Drive a game interfaceSDK Widgets Reference
Send a click safely / control click placementdocs/CLICKMANAGER.md (repository)
Look human while doing itMouse movement
Read or send packetsSDK Packets Reference
Talk between clientsdocs/sdk-services-reference.md (repository, IPC)
Find a performance problemProfiler

The Script DSL and ClickManager guides live in the repository only and are not published on this site.

UI components

Reusable Swing pieces for plugin panels live in base-api/src/main/java/dev/n3u/model/ui/components/: NPluginPanel (base plugin panel), FancyButton, FancyCard, FancyDropdown, FancySpinner, FancyDualSpinner, ToggleSlider, CollapsiblePanel, NFrame, OptionPanel, themed by N3Theme. Compose these instead of raw Swing so panels match the client look — see UI components and the UI consistency notes at the end of Profiler and Mouse movement.

Building and testing

  • Publish locally for external development: .\gradlew.bat buildAndPublishAll (see AGENTS.md at the repository root for the full command set and the JDK 25 / --release 11 toolchain pins).
  • Automated SDK tests are sparse and listed per reference page (BankQuantityResolverTest, MapResourcesTest, NOverlayTest, NExternalsPanelTest in api; StorageIsolationTest at the root; base-api has none).

Key features

  • Thread-safe interaction layer built on Static.invoke dispatch to the client thread.
  • High-level pathfinding with transports, teleports and requirement gates.
  • Hot-swappable plugin architecture with sideload discovery.
  • Click strategy control, trajectory-based mouse movement, and an integrated JVM profiler.

On this page