Resource Title / Subtitle sender

Discussion in 'Plugin Help/Development/Requests' started by gpotter2, May 14, 2015.

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

    gpotter2

    TitleSender

    Hey !

    Here's my new API to send titles/subtitles to a player using reflections :D
    If you use it, it would be nice to put my name in the credits, and say it in this thread :)

    Installation:

    This api is using the DarkBlade12's Reflection Util class:
    https://github.com/DarkBlade12/Part...rkblade12/particleeffect/ReflectionUtils.java

    Just add the 2 classes (TitleSender.java & ReflectionUtils.java) to your plugin.

    Usage:

    The titles and subtitles are in the minecraft Chat JSON format !
    If you don't know how to use it, you may create them with the JSONString() function.

    You have 3 options to use the api:
    1. Send a title to a player
    2. Send a subtitle to a player
    3. Send a subtitle and a title to a player
    Other params will be needed:
    • fadeIn: the time in which the title/subtitle will appear in a fade effect.
    • stay: thie time in which the title/subtitle will stay on the screen.
    • fadeOut: the time in which the title/subtitle will disappear in a fade effect.
    Important note:
    The times are in ticks (1sec = 20ticks) !!!

    JSONString:

    JsonString() is a function to combine the JSONPart text into a JSONString that you can send to the player. A JSONPart is customizable with a String, a color and you can add a font with setParam().

    Download

    GitHub

    Exemple to send Title and subtitle with JSONString:

    Code:
    List<JSONPart> list = new LinkedList<JSONPart>();
      list.add(new JSONPart("Hey ", ChatColor.GREEN));
    list.add(new JSONPart("gpotter2", ChatColor.BLUE).setParam(JSONParam.BOLD, JSONParam.UNDERLINED));
      list.add(new JSONPart(" !", ChatColor.DARK_AQUA));
    
      List<JSONPart> list2 = new LinkedList<JSONPart>();
      list2.add(new JSONPart("How ", ChatColor.GREEN));
      list2.add(new JSONPart("are", ChatColor.BLUE));
      list2.add(new JSONPart("you !", ChatColor.DARK_AQUA));
      TitleSender.sendTitleAndSubTitle(player, TitleSender.JSONString(list), TitleSender.JSONString(list2), 10, 60, 10);
     
    Last edited: May 15, 2015
    seanliam2000 likes this.
  2. Online

    timtower Moderator Moderator

    Moved to Bukkit alternatives
     
Thread Status:
Not open for further replies.

Share This Page