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 (theNPlugin.loop()model, the Script DSL,Walker) sleeps withDelays.tick()and must never run on the client thread. See SDK Client Reference. - Access —
Static.getClient()returns the injectedNClient;Static.getNConfig()returns theClientConfigproxy;Static.invoke/invokeLater/postare 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:ActorExwraps the live actor reference (protected final N actor,ActorEx.java:33;NpcEx/PlayerExextend 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
| Page | Area |
|---|---|
| SDK Client Reference | Static, NClient/N* interfaces, wrappers, config proxies, CLI options, events, Logger |
| SDK Queries Reference | dev.n3u.queries — all query classes and the shared AbstractQuery vocabulary |
| SDK Widgets Reference | widget facades, handler builders, loadouts |
| SDK Game Reference | game, entities, threaded packages and sailing API |
| SDK Packets Reference | NPacketWriter send methods, PacketBuffer codecs, packet events |
| SDK Pathfinder Reference | Walker, 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 plugin | External plugins (NPlugin, Gradle setup, sideloading) |
| Automate a multi-step workflow | docs/SCRIPT-DSL.md (repository) or the handler builders in SDK Widgets Reference |
| Find and interact with entities | SDK Queries Reference + SDK Game Reference |
| Walk somewhere | SDK Pathfinder Reference |
| Drive a game interface | SDK Widgets Reference |
| Send a click safely / control click placement | docs/CLICKMANAGER.md (repository) |
| Look human while doing it | Mouse movement |
| Read or send packets | SDK Packets Reference |
| Talk between clients | docs/sdk-services-reference.md (repository, IPC) |
| Find a performance problem | Profiler |
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(seeAGENTS.mdat the repository root for the full command set and the JDK 25 /--release 11toolchain pins). - Automated SDK tests are sparse and listed per reference page (
BankQuantityResolverTest,MapResourcesTest,NOverlayTest,NExternalsPanelTestinapi;StorageIsolationTestat the root;base-apihas none).
Key features
- Thread-safe interaction layer built on
Static.invokedispatch 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.
n3Client Documentation
Every n3Client user guide and SDK reference — start here, user guides, the SDK reference set, and pointers into the development documentation.
SDK Client Reference
Static accessors, NClient and the N* native interfaces, thread-affinity invariants, wrappers, config proxies, CLI options, events, and the Logger contract.