Skip to content

Instantly share code, notes, and snippets.

@webcrawls
Created October 21, 2020 16:15
Show Gist options
  • Save webcrawls/c03cbd5d02436e5e4cedc2ab1bf93306 to your computer and use it in GitHub Desktop.
Save webcrawls/c03cbd5d02436e5e4cedc2ab1bf93306 to your computer and use it in GitHub Desktop.
a helper method for the adventure text library
/**
* Serializes an adventure Component to a String, for use in methods which don't support components.
*
* @param component Component to serialize
* @return Formatted string
*/
public static String componentToString(Component component) {
return TextComponent.toLegacyText(BungeeComponentSerializer.get().serialize(component));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment