Package dev.inputbooster.api
Interface InputBoosterAPI
public interface InputBoosterAPI
InputBoosterAPI — Entry point for all mods that depend on InputBooster.
Quick Start
// Check mod is present and get the instance
if (InputBoosterAPI.isLoaded()) {
InputBoosterAPI api = InputBoosterAPI.getInstance();
int hz = api.getPollRateHz();
}
Dependency Setup (build.gradle)
repositories {
maven { url "https://maven.fabricmc.net/" }
}
dependencies {
modImplementation "dev.inputbooster:inputbooster-api:3.1.0"
}
fabric.mod.json
"depends": {
"inputbooster": ">=3.1.0"
}
-
Method Summary
Modifier and TypeMethodDescriptiondoubleRolling average input-to-drain latency in milliseconds.intCPS for the last second (accepted clicks, after the limiter).intCurrent FPS as seen by the mod.static InputBoosterAPIReturns the live InputBoosterAPI instance.intMax CPS cap from config.static Optional<InputBoosterAPI> Returns the live API instance if available.doublePeak input-to-drain latency in milliseconds (session-wide).intCurrent active poll rate in Hz (60–1000).Names of all currently saved profiles.longTotal inputs that were queued and replayed by the polling thread.longTotal inputs recovered this session (across all key types).booleanisActive()True when InputBooster is actively processing inputs.booleanbooleanTrue when the mod is in AUTO (FPS-adaptive) mode.booleanbooleanbooleanbooleanbooleanbooleanTrue when the game has a player loaded and InputBooster is ready.static booleanisLoaded()Returns true if InputBooster is present and fully initialized.booleanbooleanbooleanloadProfile(String name) Load a previously saved profile by name.voidregisterListener(InputBoosterEventListener listener) Register a listener that is called every time InputBooster queues aInputBoosterEvent.voidReset the peak latency counter.booleansaveProfile(String name) Save the current settings as a named profile.voidsetActive(boolean active) Enable or disable InputBooster processing.voidsetAntiIdleEnabled(boolean enabled) voidsetAutoMode(boolean auto) Switch between AUTO and MANUAL mode.voidsetAutoSprintEnabled(boolean enabled) voidsetAutoStrafeEnabled(boolean enabled) voidsetBurstModeEnabled(boolean enabled) voidsetCpsLimiterEnabled(boolean enabled) voidsetMaxCps(int maxCps) voidsetPollRateHz(int hz) Set the poll rate.voidsetSprintFixEnabled(boolean enabled) voidsetWTapAssistEnabled(boolean enabled) voidunregisterListener(InputBoosterEventListener listener) Unregister a previously registered listener.
-
Method Details
-
getInstance
Returns the live InputBoosterAPI instance. Never null when InputBooster is loaded; throws if the mod is absent (guard withisLoaded()first). -
isLoaded
static boolean isLoaded()Returns true if InputBooster is present and fully initialized. Always call this beforegetInstance()to avoid crashes when InputBooster is an optional dependency. -
getOptional
Returns the live API instance if available. -
getPollRateHz
int getPollRateHz()Current active poll rate in Hz (60–1000). -
setPollRateHz
void setPollRateHz(int hz) Set the poll rate. Value is clamped to [60, 1000]. -
isAutoMode
boolean isAutoMode()True when the mod is in AUTO (FPS-adaptive) mode. -
setAutoMode
void setAutoMode(boolean auto) Switch between AUTO and MANUAL mode. -
isActive
boolean isActive()True when InputBooster is actively processing inputs. -
setActive
void setActive(boolean active) Enable or disable InputBooster processing. -
isGameReady
boolean isGameReady()True when the game has a player loaded and InputBooster is ready. -
getCurrentFps
int getCurrentFps()Current FPS as seen by the mod. -
getTotalHits
long getTotalHits()Total inputs recovered this session (across all key types). -
getRecoveredInputs
long getRecoveredInputs()Total inputs that were queued and replayed by the polling thread. -
getCurrentCps
int getCurrentCps()CPS for the last second (accepted clicks, after the limiter). -
getMaxCps
int getMaxCps()Max CPS cap from config. -
isSprintFixEnabled
boolean isSprintFixEnabled() -
isAutoSprintEnabled
boolean isAutoSprintEnabled() -
isWTapAssistEnabled
boolean isWTapAssistEnabled() -
isAntiIdleEnabled
boolean isAntiIdleEnabled() -
isAutoStrafeEnabled
boolean isAutoStrafeEnabled() -
isCpsLimiterEnabled
boolean isCpsLimiterEnabled() -
isBurstModeEnabled
boolean isBurstModeEnabled() -
isBurstModeActive
boolean isBurstModeActive() -
setSprintFixEnabled
void setSprintFixEnabled(boolean enabled) -
setAutoSprintEnabled
void setAutoSprintEnabled(boolean enabled) -
setWTapAssistEnabled
void setWTapAssistEnabled(boolean enabled) -
setAntiIdleEnabled
void setAntiIdleEnabled(boolean enabled) -
setAutoStrafeEnabled
void setAutoStrafeEnabled(boolean enabled) -
setCpsLimiterEnabled
void setCpsLimiterEnabled(boolean enabled) -
setBurstModeEnabled
void setBurstModeEnabled(boolean enabled) -
setMaxCps
void setMaxCps(int maxCps) -
saveProfile
Save the current settings as a named profile. Returns false if the profile list is full and the name is new. -
loadProfile
Load a previously saved profile by name. Returns false if no profile with that name exists. -
getProfileNames
Names of all currently saved profiles. Never null. -
getAverageLatencyMs
double getAverageLatencyMs()Rolling average input-to-drain latency in milliseconds. -
getPeakLatencyMs
double getPeakLatencyMs()Peak input-to-drain latency in milliseconds (session-wide). -
resetPeakLatency
void resetPeakLatency()Reset the peak latency counter. -
registerListener
Register a listener that is called every time InputBooster queues aInputBoosterEvent.InputBoosterAPI.getInstance().registerListener(event -> { if (event.type() == InputBoosterEvent.Type.POLL_RATE_CHANGED) { System.out.println("New Hz: " + event.intValue()); } }); -
unregisterListener
Unregister a previously registered listener.
-