Home›Java›Mods›Drain
Drain
ModsJava

Drain

Java mod listed for Minecraft 1.8. Download on the author's site.

⬇ Download on Spigot
[​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.

Spoiler: For Server Owners (Installation)
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​

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.
​
Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

Drain is a free Minecraft Java mod. Compatible with Minecraft 1.8. Downloaded 232 times (via Spigot). Download it and open it directly in the game.

Explore more