⭐
StarAPI Documentation
  • ⭐API Information
    • ❔About Our API's
    • ⬇️Installing Our API
  • 🌟StarAPI (Spigot/Paper)
    • 📂Abilities
      • ⏳Transmition
      • 🤯Implosion
      • 🏹MultiShot
    • 📂Builders
      • 👕Armor Builder
      • 📊Bossbar Builder
      • ☄️Command Builder
      • ⚔️Item Builder
      • 🧟‍♂️Mob Builder
      • 💯Scoreboard Builder
      • 🔗Webhook Builder
      • 🔨Message Builder
      • 🏗️Actionbar Builder
    • 📂Files
      • 📃Create Files
      • 📁Create Folders
      • 📖Read Files
      • 🖊️Write Files
    • 📂Inventory Utilities
      • 💎Animated Items
      • 📖Book Content
      • 📔Book GUI
      • 🎞️Filler
      • 🪁Inventory Items
      • 📝Inventory Name
      • 💀Inventory Skulls
    • 📂Message Utilities
      • 🤖Auto Responses
      • 🎨Message Colors
    • 📂Recipes
      • ⚒️Crafting Recipes
      • 🧑‍🍳Furnace Recipes
    • 📂Timers
      • 🕙Active Timers
      • ❌Cancel Timers
      • 🕙Delayed Timers
      • 🕐Create Timers
    • 📂Misc
      • 💀Give Skulls
      • 📈Progress Bars
      • ⬛Block Placer
Powered by GitBook
On this page
  • Overview
  • Methods
  • Usage
  • Example
  1. StarAPI (Spigot/Paper)
  2. Message Utilities

Message Colors

Use hex colors and regular colors inside of messages, lore and other stuff!

Overview

The MessageColors class provides a utility method to convert hexadecimal color codes to Minecraft color codes in messages.

Methods

hex

public static String hex(String message)

Converts hexadecimal color codes in a message to Minecraft color codes.

Parameters

  • message: The message containing hexadecimal color codes to be converted.

Returns

  • String: The message with converted color codes.

Usage

  1. Call the hex method of the MessageColors class and pass the message containing hexadecimal color codes as a parameter.

  2. The method will replace hexadecimal color codes in the message with their corresponding Minecraft color codes.

Example

String message = "This is a message with #FF0000 red color.";
String formattedMessage = MessageColors.hex(message);

In this example, the hexadecimal color code #FF0000 will be converted to the corresponding Minecraft color code for red. The resulting formattedMessage will contain the message with the color applied.

PreviousAuto ResponsesNextRecipes

Last updated 1 year ago

🌟
📂
🎨