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 Details

    • getInstance

      static InputBoosterAPI getInstance()
      Returns the live InputBoosterAPI instance. Never null when InputBooster is loaded; throws if the mod is absent (guard with isLoaded() first).
    • isLoaded

      static boolean isLoaded()
      Returns true if InputBooster is present and fully initialized. Always call this before getInstance() to avoid crashes when InputBooster is an optional dependency.
    • getOptional

      static Optional<InputBoosterAPI> 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

      boolean saveProfile(String name)
      Save the current settings as a named profile. Returns false if the profile list is full and the name is new.
    • loadProfile

      boolean loadProfile(String name)
      Load a previously saved profile by name. Returns false if no profile with that name exists.
    • getProfileNames

      List<String> 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

      void registerListener(InputBoosterEventListener listener)
      Register a listener that is called every time InputBooster queues a InputBoosterEvent.
      
       InputBoosterAPI.getInstance().registerListener(event -> {
           if (event.type() == InputBoosterEvent.Type.POLL_RATE_CHANGED) {
               System.out.println("New Hz: " + event.intValue());
           }
       });
       
    • unregisterListener

      void unregisterListener(InputBoosterEventListener listener)
      Unregister a previously registered listener.