InteractiveMessage

Tested Versions:

  • 1.8.x

Create interactive text messages your your plugin user experience.

Methods

createInteractiveMessage

translateToTextComponent

Examples

There are three types of messages: LINK, COMMAND, SUGGEST; From enum: MessageType; Import the class with: import df2001.imapi.InteractiveMessage

Usage:

//LINK
TextComponent mainTxt = InteractiveMessage.createInteractiveMessage(
    "&6&lCLICK HERE ",
    "&bBuy your Rank at our store!",
    "https://store.example.com/ranks",
    InteractiveMessage.MessageType.LINK
);

TextComponent bodyMsg = InteractiveMessage.translateToTextComponent(" &bto visit our store and purchase your rank!");

//Send to player
player.spigot().sendMessage(mainTxt, bodyMsg);
//RUN A COMMAND
TextComponent mainTxt = InteractiveMessage.createInteractiveMessage(
    "&6&lSET MODE TO CREATIVE ",
    "&bClick to set your gamemode to creative",
    "/gamemode creative",
    InteractiveMessage.MessageType.COMMAND
);
//SUGGEST A COMMAND OR MESSAGE
TextComponent mainTxt = InteractiveMessage.createInteractiveMessage(
    "&6&lSet your chat color ",
    "&bClick to set your chat color!",
    "/chatcolor set ",
    InteractiveMessage.MessageType.SUGGEST
);

Download

Choose between these two platforms to download the API!