Drain icon

Drain -----

The Minecraft Plugin Library - Create Plugins with Ease



[​IMG]

Drain is a well-documented library for Spigot and Bukkit plugins that helps you to develop your plugins faster and easier. It includes many functionalities to make your development life easier.

If one of your plugins needs Drain, just put the JAR into your plugins directory.

Don't use the ratings for bug reports, consider opening an issue on GitHub!

Features
  • Useful annotations (e.g. @Cancel to cancel an event directly)
  • Useful utility classes
  • A command builder to create commands fast and easy
  • An ItemFactory to create custom items faster
  • And more!

The Difference

The code for a simple /heal command looks like this - if you don't use Drain:

Code (Java):
public class HealCommand implements CommandExecutor {

    public boolean onCommand (CommandSender commandSender, Command command, String s, String [ ] strings ) {
        if (commandSender instanceof Player ) {
            Player player = (Player ) sender ;
            if (player. hasPermission ( "command.heal" ) ) {
                player. setHealth ( 20 ) ;
                return true ;
            } else {
                player. sendMessage ( "§cYou are not allowed to do this!" ) ;
                return false ;
            }
        } else {
            commandSender. sendMessage ( "§cThis command is player-only!" ) ;
            return false ;
        }
    }
}
With Drain, you can focus on the essential part of your command and significantly shorten your code.

A /heal command with Drain:

Code (Java):
new DynamicCommandBuilder ( "heal", this )
        . setPlayerOnly ( true )
        . setPermission ( "command.heal" )
        . setPermissionErrorMessage ( "§cYou are not allowed to do this!" )
        . setExecutor (data -> ( (Player ) data. getSender ( ) ). setHealth ( 20 ) )
        . build ( ) ;
Apart from that, Drain offers other features, like useful annotations and classes. Head over to our wiki to learn more!


Feel free to test it out! The source code is available over on GitHub. If you need help, join
our Discord server and create a ticket.
Resource Information
Author:
----------
Total Downloads: 188
First Release: Apr 18, 2021
Last Update: Apr 18, 2021
Category: ---------------
All-Time Rating:
0 ratings
Find more info at discord.gg...
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings