Class TitleUtil

java.lang.Object
net.caseif.crosstitles.TitleUtil

public class TitleUtil extends Object
An API for sending titles to players.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    Returns whether titles are supported on the current server.
    Returns the Throwable preventing title support, if applicable.
    static void
    sendSubtitle(org.bukkit.entity.Player player, String subtitle, org.bukkit.ChatColor color)
    Sends a subtitle to a player if one is already displaying; otherwise sets the subtitle to display when a title is next sent.
    static void
    sendTimes(org.bukkit.entity.Player player, int fadeIn, int stay, int fadeOut)
    Deprecated.
    This will not work properly on newer Minecraft versions.
    static void
    sendTitle(org.bukkit.entity.Player player, String title, org.bukkit.ChatColor color)
    Sends a title to a player.
    static void
    sendTitle(org.bukkit.entity.Player player, String title, org.bukkit.ChatColor titleColor, int fadeIn, int stay, int fadeOut)
    Sends a title with the given timing to a player.
    static void
    sendTitle(org.bukkit.entity.Player player, String title, org.bukkit.ChatColor titleColor, String subtitle, org.bukkit.ChatColor subColor)
    Sends a title and subtitle to a player.
    static void
    sendTitle(org.bukkit.entity.Player player, String title, org.bukkit.ChatColor titleColor, String subtitle, org.bukkit.ChatColor subColor, int fadeIn, int stay, int fadeOut)
    Sends a title and subtitle with the given timing to a player.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TitleUtil

      public TitleUtil()
  • Method Details

    • areTitlesSupported

      public static boolean areTitlesSupported()
      Returns whether titles are supported on the current server.
      Returns:
      whether titles are supported on the current server
    • getException

      public Throwable getException()
      Returns the Throwable preventing title support, if applicable.
      Returns:
      The Throwable preventing title support, or null if titles are supported
    • sendTitle

      public static void sendTitle(org.bukkit.entity.Player player, String title, org.bukkit.ChatColor color)
      Sends a title to a player.
      Parameters:
      player - the player to send the title to
      title - the content of the title
      color - the color of the title
    • sendSubtitle

      public static void sendSubtitle(org.bukkit.entity.Player player, String subtitle, org.bukkit.ChatColor color)
      Sends a subtitle to a player if one is already displaying; otherwise sets the subtitle to display when a title is next sent.
      Parameters:
      player - the player to send the subtitle to
      subtitle - the content of the subtitle
      color - the color of the subtitle
    • sendTimes

      @Deprecated public static void sendTimes(org.bukkit.entity.Player player, int fadeIn, int stay, int fadeOut)
      Deprecated.
      This will not work properly on newer Minecraft versions.
      Sets the timing for the current title if one is displaying; otherwise sets the timing for the next title sent.
      Parameters:
      player - the player to set title timing for
      fadeIn - the time in ticks the title should fade in over (default 20)
      stay - the time in ticks the title should remain on the screen for between fades (default 60)
      fadeOut - the time in ticks the title should fade out over (default 20)
    • sendTitle

      public static void sendTitle(org.bukkit.entity.Player player, String title, org.bukkit.ChatColor titleColor, String subtitle, org.bukkit.ChatColor subColor)
      Sends a title and subtitle to a player.
      Parameters:
      player - the player to send the title to
      title - the content of the title
      titleColor - the color of the title
      subtitle - the content of the subtitle
      subColor - the color of the subtitle
    • sendTitle

      public static void sendTitle(org.bukkit.entity.Player player, String title, org.bukkit.ChatColor titleColor, String subtitle, org.bukkit.ChatColor subColor, int fadeIn, int stay, int fadeOut)
      Sends a title and subtitle with the given timing to a player.
      Parameters:
      player - the player to send the title to
      title - the content of the title
      titleColor - the color of the title
      subtitle - the content of the subtitle
      subColor - the color of the subtitle
      fadeIn - the time in ticks the title should fade in over (default 20)
      stay - the time in ticks the title should remain on the screen for between fades (default 60)
      fadeOut - the time in ticks the title should fade out over (default 20)
    • sendTitle

      public static void sendTitle(org.bukkit.entity.Player player, String title, org.bukkit.ChatColor titleColor, int fadeIn, int stay, int fadeOut)
      Sends a title with the given timing to a player.
      Parameters:
      player - the player to send the title to
      title - the content of the title
      titleColor - the color of the title
      fadeIn - the time in ticks the title should fade in over (default 20)
      stay - the time in ticks the title should remain on the screen for between fades (default 60)
      fadeOut - the time in ticks the title should fade out over (default 20)