Skip to content

milkdrinkers/ColorParser

Repository files navigation

ColorParser

license Maven metadata URL documentation javadoc GitHub last commit


Description

A simple utility library for easily adding MiniMessage support with Adventure on any platform.


Useful Links

  • Documentation - Link
  • JavaDoc - Link
  • MiniMessage Formatting - Link
  • MiniMessage Previewer - Link
  • Adventure Documentation - Link

Examples

Basic usage example parsing a string into a component:

Component message = ColorParser.of("<#00ff00><hover:show_text:'<red>test'>R G B!").build();
player.sendMessage(message);

This example has a custom placeholder (<player>) in the string that needs to be replaced:

Component message = ColorParser.of("<green><player> Teleported to you.").parseMinimessagePlaceholder("player", player.getName()).build();
player.sendMessage(message);

This example also parses legacy color codes in the string:

Component message = ColorParser.of("&6So<green>me &5String &4Here").parseLegacy().build();
player.sendMessage(message);

This example parses all PlaceholderAPI placeholders in the string:

Component message = ColorParser.of("Your Displayname is: %player_displayname%").parsePAPIPlaceholders(player).build();
player.sendMessage(message);

Installation

Please check out our Documentation for installation steps.