Light weight and simple library to create spigot events in the go. I created this api since I find the spigot APIs incredible tedious to use and also leads to a lot of boilerplate code...
Usage
First, to use the api, you need to register your plugin
@Override
public void onEnable() {
JEvents.register(this);
}
jEvents provides a very simple event creation abstraction. Here is an example:
JEvents.subscribe(InventoryClickEvent.class) // The class of the event you want to listen
.handler(event->{
event.setCancelled(true);
// Do something here
});
As you can see, the creation of a listener is way easier than spigot's API, you just need specify the Event class, and
you are good to go
More examples of the api usage:
JEvents.subscribe(InventoryClickEvent.class)
.filter(event -> event.getInventory().equals(myInv)) // Only apply the action inside the handler
.filter(event -> event.getSlot() == 3) // if the filters are met
.handler(event -> {
event.setCancelled(true);
// Do something here
});
JEvents.subscribe(PlayerDeathEvent.class)
.biHandler((subscription, playerDeathEvent) -> {
playerDeathEvent.setDeathMessage("Ha you died loser");
subscription.unregister(); // Unregisters the listener
});Similar projects
Plugin →Let Me Despawn
Improves performance by tweaking mob despawn rules. Say bye to pesky unintentional persistent mobs.
25MSueta
JourneyMap
Real-time map used for mapping in-game or your browser as you explore.
14.7MSueta
Emotecraft
Create your own emotes in Minecraft.
7.5MSueta
Simple Tpa
A simple tpa plugin which sends requests
5.4MSueta
Common Network
Forge and Fabric Unified Networking Solution
3.9MSueta
Set Home
A lightweight plugin for players to set their homes.
3.8MSueta