Provider API
Interface ID 1, version 2.0. Include <PAPER/Provider.h> (and <PAPER/Client.h> for the helper). Records live in paper::api, the table in paper::api::provider. Provider registers your mod as an owner; the owner token it issues is valid for every PAPER interface. Follow the discovery rules and the runtime contract.
Connect
- Resolve
PAPERAPI_QueryInterfaceV1(kQueryExportName) from the loadedPAPER.dll. If PAPER is not loaded, keep running without its features. - On the game thread, once PAPER is ready,
paper::api::Client::connect(query, "Your mod", capabilities)queries Provider 2.0 and callsregisterConsumer. A mod built for the pre-2.0 API is refused. - Check
client.grantedCapabilities()against the mask you requested. client.acquire(table)queries each further interface, such as PhysicalReload.client.close()on the game thread unregisters the owner and releases everything it holds.
Entry points
Calls marked bool or count return that value instead of Status and fail closed with false or 0.
| Function | Capability | Thread | Purpose |
|---|---|---|---|
getModVersion | none | Any | PAPER's version string, for example "1.2.0", valid for the process lifetime. |
isReady | none | Any | bool: PAPER's runtime is ready. |
getRuntimeState | RuntimeState | Game | bool: runtime snapshot. |
getConfigState | RuntimeState | Game | bool: configuration snapshot. |
getCapturedTransformCount | CapturedTransforms | Game | count: native transforms captured this frame. |
copyCapturedTransforms | CapturedTransforms | Game | count: copies up to kMaxCapturedTransforms (192) named local transforms. |
getNativeHandPose | NativeHandPose | Game | bool: hand-in-weapon plus 15 finger-local transforms for one hand. |
registerConsumer | none | Game | Registers a new owner. NotReady before isReady, OwnerConflict when the mod name is taken, CapacityReached beyond kMaxConsumers (16). Grants the requested bits PAPER knows. |
unregisterConsumer | owner | Game | Ends the owner's callbacks, authority request and physical-reload lease. |
getGrantedCapabilities | owner | Game | count: the granted mask, 0 for an unknown owner. |
setAnimationAuthority | AnimationAuthority | Game | Requests native reload animation on arms, hands and/or weapon; lease 0 lasts until cleared, 1 to kMaxAuthorityLeaseFrames (1200) expires. |
clearAnimationAuthority | AnimationAuthority | Game | Ends the owner's authority request. |
registerEventCallback | FrameCallbacks | Game | Registers callback(event, userData), up to kMaxCallbacks (16). |
unregisterEventCallback | FrameCallbacks | Game | Removes one callback. |
getNativePoseFrameState | NativePosePipeline | Game | Pose-pipeline frame. |
getNativeHandSolution | NativePosePipeline | Game | Resolved solution of one hand. |
Registration, events and authority
ConsumerRegistration:modName[64], nonempty and NUL-terminated within the array, andrequestedCapabilities(ConsumerCapabilitymask). The name is the owner's identity: one owner per name.ConsumerHandle:ownerToken,grantedCapabilities,providerGeneration.Event:kind(EventKind) and the frame'sruntimestate. Kinds:FrameComplete(1),RuntimeReset(2),ConfigReloaded(3),PresentationComplete(11); kinds 4 to 10 (weapon motion and manipulation) are retired and never reused. Callbacks run on the game thread inside PAPER's frame; the event is borrowed for the call.PresentationCompleteis delivered only to owners withNativePosePipelineand does not advance leases.AuthorityRequest:flags(NativeAnimationAuthorityFlag: arms, hands, weapon, or the combined reload pose) andleaseFrames. A nonzero lease expires after that many PAPER frame callbacks; zero persists until clear or owner unregistration. Authority coordinates an animation owner your mod already has; it submits no pose or IK data.
Native pose describes the pose-pipeline records. Shared types, results and bounds are in types and results; the full header is in complete declarations. A mod built against PAPER 1.2 is updated with migrating from PAPER 1.2.
paper::api::RuntimeState state{};
if (client.providerApi()->getRuntimeState(client.owner(), &state) &&
state.weaponGenerationKey != cachedWeaponKey) {
// the equipped weapon changed: drop weapon-specific caches
}