Tutorial Make your own API's!

Discussion in 'Resources' started by AdityaTD, May 18, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    AdityaTD

    Hey there everyone, this is my first tutorial and I want to teach you all on how to make your own API. I have just made my own API which you can have a look at: TitlesAPI

    You should know on how to make a basic framework of a plugin.
    My main class is: me.AdityaTD.TestAPI.API
    After you have made your class do this:
    Code:
    public static void sendMessage(Player player, String message){
    player.sendMessage(message);
    }
    I have made a Message Function for a player.

    If you want to use it in your other plugin, you need to set API plugin in your build path as same as you added bukkit. After That:
    Code:
    public void onJoin(PlayerJoinEvent event){
    API.sendMessage(event.getPlayer(), ChatColor.GOLD + "This is a test API implementation");
    }
    I have made a new plugin and I have made a PlayerJoinEvent so when a player joins my plugin would implement my API to send a message.

    It's that simple. If you have any further questions or suggestions then comment them below. :)

    Subscribe to my YouTube: www.youtube.com/user/adityatripathidelhi
    Thank You! :D
     
    ChipDev likes this.
  2. Offline

    ChipDev

    You should know how to make an API before going to bukkit, simply making methods in java?
     
  3. @ChipDev There is more to making an API than making methods, quite a bit more to be honest. However, what @AdityaTD has covered here is indeed "how to make a method and call it an API". If it's helpful to anyone, then they shouldn't be making plugins.
     
    GrandmaJam, teej107 and ChipDev like this.
  4. Offline

    ChipDev

    Well, I mean that is what he listed.
    I bet 6/10 people think API's are just methods.
     
  5. Offline

    AdityaTD

    Well guys this is just basic tutorial on how to make a API nothing advance in this one! :)
     
    ChipDev likes this.
  6. @ChipDev And I'll bet at least that amount use an apostrophe in "APIs" even though they probably shouldn't ;)

    @AdityaTD This isn't how to make an API. It needs to be more advanced to even be considered a "basic API". APIs consist of design decisions, and various other things... you know, interfaces and whatnot. Heck, the I in API stands for interface! So, this is not an API tutorial. This is a "how to make a method" tutorial.
     
    ChipDev likes this.
  7. Offline

    Totom3

    There's no point in making a tutorial THAT basic... You don't seem to understand what an API is either. If you want to make a tutorial on how to make an API, at least know what you'll be talking about, and give a better example..

    BTW your Youtube channel is completely unrelated to programming, why bother advertise for it?
     
  8. Offline

    teej107

    Your example is not an API. Its a useless wrapper method basically. If you want an example of an API, take a look at WorldEdit, WorldGuard, or even CraftBukkit as well.
     
  9. Offline

    mrCookieSlime

    Thread locked.
    Really nothing to add here.
    Java is a Requirement for Bukkit.
    And APIs on its own are already part of Java, however this is not even an API.
     
Thread Status:
Not open for further replies.

Share This Page