[1.13-1.17] EasyAPI 1.3.0

Language, AutoReloadFile, Command from Vanilla, NPC, Hologram, ItemUtils, PlayerUtils and more!

  1. DeeChael
    Native Minecraft Version:
    Tested Minecraft Versions:
    • 1.13
    • 1.14
    • 1.15
    • 1.16
    • 1.17
    Source Code:
    Easy.png EasyAPI
    Version example:
    1.1.0 means first generation, version 2, first patch

    (Example videos on my bilibili channel: https://space.bilibili.com/197734515)

    EasyAPI is a simple api for spigot server
    Why so big because plugin jar include libraries
    There are some examples

    Code (Java):
    //Create language default first
    LanguageDefault languageDefault = new LanguageDefault(YourPluginInstance);
    //Add default text, if exists in file it won't be replace
    languageDefault.addDefault("example.text", "Example Message");
    //Then create a new language, "en_us" is language code, you can find language code in org.ezapi.configuration.LanguageCode or https://minecraft.fandom.com/wiki/Language
    Language language = new Language(languageDefault, "en_us");
    //Now regster language
    Code (Java):
    //Create a new EzCommand
    EzCommand command = new EzCommand("command_name");
    //This is execute without arguments
    //executes method need a BiFunction so I use lambda as example
    //EzCommand is similar to 1.13+ nms command
            command.executes((sender, argument) -> {
    //sender is org.ezapi.command.EzSender
    //ChatMessage is org.ezapi.chat.ChatMessage, the text registered in language can be used right here, the boolean after key is flag, if flag is true it will read "example.text" from language file, or else just send "example.text"
                sender.sendMessage(new ChatMessage("example.text", true));
    //Need return a number, 0 is failed, 1+ is success
                return 1;
    Use "then" method to add arguments
    Code (Java):
    command.then(new EzCommand("reload")
                    .executes((sender, argument) -> {
                        sender.sendMessage(new ChatMessage("Reloaded", false));
                        return 1;
    //Find arguments in "org.ezapi.command.argument" package or org.ezapi.command.argument.EzArgumentTypes class
            command.then(new EzArgument(BaseArguments.string(), "string")
                    .suggest((sender, suggestions) -> suggestions.suggest("test").suggest("example").buildFuture())
                    .executes((sender, argument) -> {
                        sender.sendMessage(new ChatMessage(argument.getAsString("string"), false));
                        return 1;
    Register command:
    Code (Java):
    EzCommandManager.register("prefix", command);

    You can create inventory by code:
    Code (Java):
    EzInventory inventory = new EzInventory(this, 6);
            EzInventory inventory = new EzInventory(this, 6, new ChatMessage("Title", false));
    6 is the amount of lines, supports from 1 to 6
    Add a input item by code:
    Code (Java):
    inventory.add(slotNumber, new Input() {
                public void onDraw(Player player, DrawSetting drawSetting) {
                    if (player.isOp()) {
                        drawSetting.setDisplayName(new ChatMessage("Button name", false));
    Or add a clickable input (button):
    Code (Java):
    inventory.add(slotNumber, new Button() {
                public void onClick(Player player, ClickType click, InventoryAction action) {
                    if (player.isOp() && click.isLeftClick() && action == InventoryAction.PICKUP_ALL) {
                        player.sendMessage("You clicked a button");

                public void onDraw(Player player, DrawSetting drawSetting) {
                    if (player.isOp()) {
                        drawSetting.setDisplayName(new ChatMessage("Button name", false));
    Open to a player:
    Code (Java):
    If you don't need this inventory anymore, please drop it
    Code (Text):
    Or you can make be droped when player closeIt:
    Code (Java):
    StorageAPI has been removed!
    First, create a storage
    Code (Java):
    //Create mysql connection
            Mysql mysql = new Mysql(host, port, database, table, username, password);
            //Create sqlite connection
            Sqlite sqlite = new Sqlite(file, table);
            //Create mongoDB connection
            //Unsupported in 1.2.9+
            MongoDB mongoDB = new MongoDB(host, port, username, password, authDatabase, database);
            //Create YamlStorage
            YamlStorage yamlStorage = new YamlStorage(file);
            //Create JsonStorage
            JsonStorage jsonStorage = new JsonStorage(file);
            //Create TomlStorage
            TomlStorage tomlStorage = new TomlStorage(file);
            //Create PropertiesStorage
            PropertiesStorage propertiesStorage = new PropertiesStorage(file);
    Store context need use org.ezapi.storage.StorageContext.
    Create a new context by:
    Code (Java):
    StorageContext context = new StorageContext();
    You can also get a StorageContext from json object string:
    Code (Java):
    StorageContext context = StorageContext.getByString(jsonObjectString);

    Code (Text):
    //Import org.ezapi.module.hologram.TextHologram to start
    TextHologram hologram = new TextHologram(new ChatMessage("example", false), world, location);
    //I think you can understand how to create a new hologram
    //Make a player can see the hologram
    hologram.addViewer(player); //org.bukkit.entity.Player
    //Remove a player who can see the hologram
    //Refresh hologram to a player
    //Set the location of hologram
    hologram.setLocation(Location location);
    //A bug: if you remove a viewer then add him/her to viewers again, then cannot see the hologram

    Finally, NPC API was been added in version 1.2.0
    NPC in 1.2.0 only has Type Player, more types in future!
    Create a NPC first!
    Code (Java):
    //import org.ezapi.module.npc.EzNPC
    //import org.ezapi.module.npc.NPCType
    EzNPC npc = new EzNPC(NPCType.PLAYER, new ChatMessage("NPC Name"), location);
    //Then add viewer to let a player see it!
    //Other methods are same as HologramAPI methods!
    //Make npc look at player
    //Set npc data
    //For example, if npc type is player, set data as a string, npc 's skin will be set to the skin of the player named the string
    npc.setData("Notch"); //Set npc skin to Notch's skin
    //Listening on player left or right click the npc
    //[S]Known bugs: Every time player right click the npc, will call 5 times.[/S] Fixed in 1.2.2
    //Need a function, no return, with two arguments: a player and a ClickType fromorg.ezapi.module.packet.play.in.InteractEntity.ClickType
    //You can use lambda instead of extends the function class
    npc.setOnClick((player, clickType) -> {
        player.sendMessage("You clicked the npc");
    //To clear viewer and make the npc cannot be use anymore

    Scoreboard API released in 1.2.17
    Code (Java):
    //Create a new scoreboard
    EzScoreboard scoreboard = new EzScoreboard(new ChatMessage("&c&lExample", false));
    //Add text, the int is witch line, line number higher, position higher
    scoreboard.setText(8, new ChatMessage("&b&l| &bThanks for playing!", false));
    scoreboard.setText(7, new ChatMessage("&b&l|    ", false));
    scoreboard.setText(6, new ChatMessage("&b&l| &bPlayer", false));
    scoreboard.setText(5, new ChatMessage("&b&l| &e{display_name}", false));
    scoreboard.setText(4, new ChatMessage("&b&l|   ", false));
    scoreboard.setText(3, new ChatMessage("&b&l|  ", false));
    scoreboard.setText(2, new ChatMessage("&b&l| ", false));
    scoreboard.setText(1, new ChatMessage("&b&l|&e example.com", false));
    //Make a player can see the scoreboard
    //Remove line witch is 1
    //Make a player cannot see the scoreboard
    //Set title display name
    scoreboard.setTitle(new ChatMessage("New Display", false));
    //Drop the scoreboard

    Code (Java):
    //Create a new boss bar
    EzBossBar bossBar = new EzBossBar(new ChatMessage("Ender Dragon", false));
    //Add a new viewer
    //Set boss bar progress
    //Set boss bar color
    //Set boss bar style
    //Make sky dark
    //Play music to player
    //Create fog
    //Make player cannot see the boss bar
    //Make player can see the boss bar
    //Remove a viewer
    //Drop the boss bar

    Code (Java):
    File file = new File("plugins/EasyAPI/", "example.yml");
    FileUtils.create(file, true);
    AutoReloadFile autoReloadFile = new AutoReloadFile(EasyAPI.getInstance(), file);
    autoReloadFile.onModified(() -> {
        System.out.println("content: " + FileUtils.readText(file));
    autoReloadFile.onDeleted(() -> {

    And there are also a lot Utils in package org.ezapi.util
    Fill stone from a to b
    Code (Java):
     BuildingUtils.fill(a, b, Material.STONE);
    Fill stone with hollow style from a to b
    Code (Java):
     BuildingUtils.hollow(a, b, Material.STONE);
    Fill stone with outline style from a to b
    Code (Java):
     BuildingUtils.outline(a, b, Material.STONE);
    Replace block x to y from a to b
    Code (Java):
     BuildingUtils.replace(a, b, x, y);
    Draw a circle, a as center(Location), r as radius(double), b as block(Material), f as beFilled(boolean)
    Code (Java):
     BuildingUtils.circle(a, r, b, f);
    Draw a line from a to b with block x
    Code (Java):


    Set player skin
    Code (Java):
    Player player;
    PlyaerUtils.skin(player, "Online player name");
    //You can find online player name on namemc.com
    Sending title has many methods, this is a easiest example
    Code (Java):
    //EasyAPI ChatMessage
    ChatMessage message = new ChatMessage("Title", false);
    Player player;
    PlayerUtils.title(message, player);
    //Subtitle: PlayerUtils.subtitle(message, player);
    //Actionbar: PlayerUtils.actionbar(message, player);
    Sending title and subtitle at the same time:
    Code (Java):
    //EasyAPI ChatMessage
    ChatMessage title = new ChatMessage("Title", false);
    ChatMessage subtitle = new ChatMessage("Subtitle", false);
    Player player;
    PlayerUtils.titleWithSubtitle(title, subtitle, player);
    Sending message
    Code (Java):
    //EasyAPI ChatMessage
    ChatMessage message = new ChatMessage("Title", false);
    Player player;
    PlayerUtils.sendMessage(message, player);
    Sending nms packet
    Code (Java):

    Player player;
    Object nmsPacket;
    PlayerUtils.sendPacket(player, nmsPacket);

    Draw outline from a to b with Flame particles as 0.5 distance between every particle
    Code (Java):
    ParticleUtils.outline(from, to, Particle.FLAME, 0.5);
            ParticleUtils.asyncOutline(from, to, Particle.FLAME, 0.5);
    You can also draw a circle with ParticleUtils

    Spawn a fake item stack, everybody can see it, but nobody can pick it up
    Code (Java):
    ItemUtils.spawnUnpickItem(itemStack, location);
    Spawn a fake item stack, only some players can see it, but nobody can pick it up
    Code (Java):
    ItemUtils.spawnUnpickItem(itemStack, location, players);
    Spawn a item stack but only one player can see it and pick it up
    Code (Java):
    ItemUtils.spawnPickItemOnlySee(itemStack, location, player);
    Spawn a item stack everybody can see but only one player can pick it up
    Code (Java):
    ItemUtils.spawnPickItem(itemStack, location, player);
    Spawn a item stack only one player can pick up and some players can see
    Code (Java):
    ItemUtils.spawnPickItem(itemStack, location, player, whoCanSee);
    Make a item stack to a JsonObject from Google Gson
    Code (Java):
    Make a item stack to json object string
    Code (Java):
    Get a item stack from JsonObject
    Code (Java):
    ItemStack itemStack = ItemUtils.toItemStack(jsonObject);
    Get a item stack from json object string
    Code (Java):
    ItemStack itemStack = ItemUtils.toItemStack(jsonObjectString);

    Other utils:
    _Obliviate_, huanmeng_cn and Nemo_64 like this.

Recent Updates

  2. Added more features for EasyPlugin class
  3. Fixed bugs

Recent Reviews

  1. huanmeng_cn
    Version: 1.2.8
    很有研究价值(doge) 希望能一直更新下去!
    1. DeeChael
      Author's Response
  2. SnowCutieOwO
    Version: 1.2.2


    1. DeeChael
      Author's Response