ModsJava
KeyboardListenerAPI
Java mod listed for Minecraft 1.13–1.21. Downloads from the MC Java Mods app on Android.
⬇ Download on Spigot
KeyboardListenerAPI
This plugin currently only acts as an API interface. Unless other plugins require this plugin as a dependency, the plugin itself will not perform any operations
About KeyboardListenerAPI
KeyboardListenerAPI is designed to simplify the listening method of the original key. Through a short registration statement, developers can easily listen what key the player presses. However, due to the limitations of the server, KBLAPI can only listen a few specific keys through the events associated with Bukkit keys.
If you are looking for an API that can listen the full keyboard, sorry, no plugin can currently implement this function, please look for Mod.
Import API to your project
Maven (pom.xml)
Code (Text):
<dependencies>
<dependency>
<groupId>io.github.hexsook</groupId>
<artifactId>kblapi-api</artifactId>
<version>1.2</version>
</dependency>
</dependencies>
<dependency>
<groupId>io.github.hexsook</groupId>
<artifactId>kblapi-api</artifactId>
<version>1.2</version>
</dependency>
</dependencies>
Code (Text):
implementation("io.github.hexsook:kblapi-api:1.2")
Code (Text):
implementation 'io.github.hexsook:kblapi-api:1.2'
To register a key listener, you need to add following code to your plugin main class:
Code (Java):
package
your_package
;
import io.github.hexsook.kblapi.api.Key ;
import io.github.hexsook.kblapi.api.KeyboardListener ;
import io.github.hexsook.kblapi.api.KeyboardListenerAPI ;
import org.bukkit.entity.Player ;
import org.bukkit.plugin.java.JavaPlugin ;
public class YourPluginMain extends JavaPlugin {
@Override
public void onEnable ( ) {
KeyboardListenerAPI api = KeyboardListenerAPI. get ( ) ;
api. addKeyListener ( this, Key. Q, new KeyboardListener ( ) {
@Override
public void pressed (Player player ) {
player. sendMessage ( "你按下了Q" ) ;
}
} ) ;
}
}
import io.github.hexsook.kblapi.api.Key ;
import io.github.hexsook.kblapi.api.KeyboardListener ;
import io.github.hexsook.kblapi.api.KeyboardListenerAPI ;
import org.bukkit.entity.Player ;
import org.bukkit.plugin.java.JavaPlugin ;
public class YourPluginMain extends JavaPlugin {
@Override
public void onEnable ( ) {
KeyboardListenerAPI api = KeyboardListenerAPI. get ( ) ;
api. addKeyListener ( this, Key. Q, new KeyboardListener ( ) {
@Override
public void pressed (Player player ) {
player. sendMessage ( "你按下了Q" ) ;
}
} ) ;
}
}
Q, F, SHIFT, SHIFT+Q, SHIFT+F
NOTE: If a key is being listened to, the event that would have been associated with that key will be cancelled.
Get Support
If you like my plugin, please leave a 5-STAR rating.
If you encounter any problems using the plugin, please open an Issue on Github. Sending bugs in the reviews is not a good choice.
Quick facts
- Edition: Minecraft Java
- File type: .jar
- Minecraft versions listed: 1.13, 1.14, 1.15
- How to install: Install the matching mod loader (Forge, Fabric or NeoForge) for your Minecraft version. → Download the .jar. → Put it in the .minecraft/mods folder and launch that loader profile.
- Where to get it: Opens on Spigot — not every file is mirrored on our own servers.
Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.
KeyboardListenerAPI is a free Minecraft Java mod. Compatible with Minecraft 1.13, 1.14, 1.15, 1.16 and newer. Downloaded 71 times (via Spigot). Download it and open it directly in the game.