TitleAPI 1.5-RELEASE

An extensive API and server owner resource for titles and tab headers & footers

  1. JordanOsterberg
    Contributors:
    TheTrollz
    [​IMG]
    This is my very first resource on Spigot, and it's name is TitleAPI.
    [​IMG]
    TitleAPI is a very easy to use Title and Tab Header Footer system for developers AND server owners and also works in all current 1.8 AND 1.9 builds of Spigot/Bukkit.
    [​IMG]
    The API can be used like this:
    Code (Text):
    TitleUtils.getInstance().sendTitle(e.getPlayer(), "&cText!", "&eSubText!", 20, 60, 20);
    Code (Text):
    TabUtils.getInstance().sendTab(e.getPlayer(), "&cText!", "&eSubText!");
    [​IMG]
    animations.png
    Tab Header/Footer animations are possible and run off of the AnimationRunnable class, or if you're a server owner, the config.yml file, and your animation's file.
    There is currently one placeholder, %newline%.​
    Code (Text):
    AnimationRunnable runnable = new AnimationRunnable("example"); // example is the file the animation is in
                runnable.runTaskTimerAsynchronously(TitleAPI.getInstance(), 0, ConfigManager.getInstance().readAnimation("example").getInt("speed")*20);
    Code (Text):
    frames:
      header:
      - '&aTitleAPI v1.1'
      - '&cT&aitleAPI v1.1'
      - '&aT&ci&atleAPI v1.1'
      - '&aTi&ct&aleAPI v1.1'
      - '&aTit&cl&aeAPI v1.1'
      - '&aTitl&ce&aAPI v1.1'
      - '&aTitle&cA&aPI v1.1'
      - '&aTitleA&cP&aI v1.1'
      - '&aTitleAP&cI &av1.1'
      - '&aTitleAPI &cv&a1.1'
      - '&aTitleAPI v&c1&a.1'
      - '&aTitleAPI v1&c.&a1'
      - '&aTitleAPI v1.&c1'
      footer:
      - '&aThis is the example animation! You can edit this in example.yml!'
      - '&aThis is the example animation! You can edit this in example.yml!'
      - '&aThis is the example animation! You can edit this in example.yml!'
      - '&aThis is the example animation! You can edit this in example.yml!'
      - '&aThis is the example animation! You can edit this in example.yml!'
      - '&aThis is the example animation! You can edit this in example.yml!'
      - '&aThis is the example animation! You can edit this in example.yml!'
      - '&aThis is the example animation! You can edit this in example.yml!'
      - '&aThis is the example animation! You can edit this in example.yml!'
      - '&aThis is the example animation! You can edit this in example.yml!'
      - '&aThis is the example animation! You can edit this in example.yml!'
      - '&aThis is the example animation! You can edit this in example.yml!'
      - '&aThis is the example animation! You can edit this in example.yml!'
    speed: 1
     
    [​IMG]
    They can also be created with code, no files needed:
    Code (Text):
    List<String> header = new ArrayList<>();
                List<String> footer = new ArrayList<>();
                header.add("&aThis is line #1! %newline% &aand this is line #2!");
                header.add("&bThis is line #1! %newline% &band this is line #2!");
                header.add("&cThis is line #1! %newline% &cand this is line #2!");
                header.add("&dThis is line #1! %newline% &dand this is line #2!");
                footer.add("&aIP: mc.Example.net %newline% &aStore @ store.Example.net");
                footer.add("&bIP: mc.Example.net %newline% &bStore @ store.Example.net");
                footer.add("&cIP: mc.Example.net %newline% &cStore @ store.Example.net");
                footer.add("&dIP: mc.Example.net %newline% &dStore @ store.Example.net");
                AnimationRunnable runnable = new AnimationRunnable(header, footer);
                runnable.runTaskTimerAsynchronously(TitleAPI.getInstance(), 0, 20);
    [​IMG]
    [​IMG]
    There are currently three events, PlayerSentTitleEvent, PlayerSentTabEvent, and AnimationCycleEvent. You have the ability to change all of the variables, including the player.
    Or, you could print the output of each title sent. You can even cancel the title! The possibilities are somewhat endless!
    Example:
    Code (Text):
    @EventHandler
        public void onTitle(PlayerSentTitleEvent e){
            System.out.print("PlayerSentTitleEvent executed: ");
            System.out.print("Player: " + e.getPlayer().getName());
            System.out.print("Title: " + e.getTitle());
            System.out.print("SubTitle: " + e.getSubtitle());
            System.out.print("In: " + e.getIn());
            System.out.print("Stay: " + e.getStay());
            System.out.print("Out: " + e.getOut());
        }
    Code (Text):
    [21:05:30 INFO]: PlayerSentTitleEvent executed:
    [21:05:30 INFO]: Player: TheTrollz
    [21:05:30 INFO]: Title: &cText!
    [21:05:30 INFO]: SubTitle: &eSubText!
    [21:05:30 INFO]: In: 0
    [21:05:30 INFO]: Stay: 60
    [21:05:30 INFO]: Out: 20
     
    [​IMG]
    You are free to use this any way you want, as long as:
    - You give me credit
    - You don't use this in any way that breaks Mojang's EULA and/or Terms
    - You don't use this in any way that breaks SpigotMC's EULA and/or Terms
    - I can update this resource at any time, and add anything to it that doesn't violate SpigotMC's plugin guidelines.
    - I don't have to update this plugin or provide support
    - Errors will be PM'd to me instead of left in the review section

    Thanks for looking at my resource!

Recent Updates

  1. Fixed Bugs
  2. The 1.9 Update
  3. Multiple additions, see update description

Recent Reviews

  1. TomCatt_
    TomCatt_
    5/5,
    Version: 1.2-RELEASE
    Good API, wait for maven project.......fast, fast please xD
    Good Work guy. f
  2. Arektor
    Arektor
    5/5,
    Version: 1.2-RELEASE
    Now that it's complete, it deserves a 5-star. Two plugins in one, and even cooler than both of them. Who can ask for more?
    1. JordanOsterberg
      Author's Response
      Thanks for the review! :D
  3. Arektor
    Arektor
    4/5,
    Version: 1.0-BETA
    Another with the same name already exists since the beginning of 1.8, and provides a little support for tab header / footer too, but your provides events. So, both are cools ;)
    1. JordanOsterberg
      Author's Response
      Support for tab header/footer stuff will provided in the next update! Thanks for the rating!