Class FancyMessage


  • public class FancyMessage
    extends java.lang.Object
    A Utilities/Builder class for the BaseComponents API
    • Method Summary

      Modifier and Type Method Description
      FancyMessage changePage​(java.lang.String page)
      Change the page in a book
      FancyMessage command​(java.lang.String string)
      The command the player will use/say when they message the messages
      net.md_5.bungee.api.chat.BaseComponent[] getBaseComponents()  
      FancyMessage link​(java.lang.String string)
      Opens the link for the player when they message the messages
      FancyMessage onClick​(FancyClick fce)
      CAN NOT BE USED WITH COMMAND Add a callback for an onClick CallBack self deletes after 5 minutes from first message, unless told otherwise
      FancyMessage onClick​(FancyClickEvent fce)  
      FancyMessage say​(java.lang.String string)
      The message the player will use/say when they message the messages
      void send​(org.bukkit.entity.Player player)
      Sends the messages to a player
      void send​(org.bukkit.entity.Player[] players)
      Sends the messages to an array of players
      void sendToConsole​(org.bukkit.command.CommandSender sender)
      Sends the fancy messages in the form of plain text to the console
      FancyMessage showItem​(org.bukkit.inventory.ItemStack item)  
      FancyMessage suggest​(java.lang.String string)
      Autotypes a messages into their chatbar when they message the messages
      FancyMessage then​(java.lang.String string)
      Adds a new string section to the messages, this allows new tooltips, and events.
      FancyMessage then​(FancyMessage fancyMessage)  
      java.lang.String toJSON()  
      FancyMessage tooltip​(java.lang.String... strings)
      Tooltips are what appear when you hover over the messages
      java.lang.String toPlainText()  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FancyMessage

        public FancyMessage()
        Default Constructor
      • FancyMessage

        public FancyMessage​(java.lang.String string)
        Constructor with first text
        Parameters:
        string - the String to start with
      • FancyMessage

        public FancyMessage​(FancyMessage fancyMessage)
    • Method Detail

      • then

        public FancyMessage then​(java.lang.String string)
        Adds a new string section to the messages, this allows new tooltips, and events.
        Parameters:
        string - The String to add
        Returns:
        The FancyMessage
      • tooltip

        public FancyMessage tooltip​(java.lang.String... strings)
        Tooltips are what appear when you hover over the messages
        Parameters:
        strings - The tooltips to add
        Returns:
        The FancyMessage
      • showItem

        public FancyMessage showItem​(org.bukkit.inventory.ItemStack item)
      • command

        public FancyMessage command​(java.lang.String string)
        The command the player will use/say when they message the messages
        Parameters:
        string - The command to run
        Returns:
        The FancyMessage
      • say

        public FancyMessage say​(java.lang.String string)
        The message the player will use/say when they message the messages
        Parameters:
        string - The command to run
        Returns:
        The FancyMessage
      • changePage

        public FancyMessage changePage​(java.lang.String page)
        Change the page in a book
        Parameters:
        page - The page to change to
        Returns:
        The FancyMessage
      • onClick

        public FancyMessage onClick​(FancyClick fce)
        CAN NOT BE USED WITH COMMAND Add a callback for an onClick CallBack self deletes after 5 minutes from first message, unless told otherwise
        Parameters:
        fce - The FancyClickEvent
        Returns:
        The FancyMessage
      • suggest

        public FancyMessage suggest​(java.lang.String string)
        Autotypes a messages into their chatbar when they message the messages
        Parameters:
        string - The String to type
        Returns:
        The FancyMessage
      • link

        public FancyMessage link​(java.lang.String string)
        Opens the link for the player when they message the messages
        Parameters:
        string - The link
        Returns:
        The FancyMessage
      • send

        public void send​(org.bukkit.entity.Player player)
        Sends the messages to a player
        Parameters:
        player - The player
      • send

        public void send​(org.bukkit.entity.Player[] players)
        Sends the messages to an array of players
        Parameters:
        players - The players
      • getBaseComponents

        public net.md_5.bungee.api.chat.BaseComponent[] getBaseComponents()
        Returns:
        Get all the BaseComponents
      • toJSON

        public java.lang.String toJSON()
        Returns:
        Get the FancyMessage as JSON
      • sendToConsole

        public void sendToConsole​(org.bukkit.command.CommandSender sender)
        Sends the fancy messages in the form of plain text to the console
        Parameters:
        sender - The console sender
      • toPlainText

        public java.lang.String toPlainText()
        Returns:
        Get the Fancy Message as just plain text