Skip to content

A library for Converting Discord Formatting to Minecraft and Vice Versa

License

Notifications You must be signed in to change notification settings

hypherionmc/mcdiscordformatter

Repository files navigation

MCDiscordFormatter

Forked from THIS REPO and ported to be compatible with Modern MC versions


A library for transcoding between Minecraft and Discord.

Minecraft text is represented by Mojangs internal components

Discord text is represented using Java Strings (not relying on any specific Discord library) and is translated using a fork of Discord's SimpleAST, here.

Dependency information

Maven

<repository>
    <id>hypherion-maven-releases</id>
    <name>HypherionSA's Maven</name>
    <url>https://maven.firstdarkdev.xyz/releases</url>
</repository>

<dependency>
    <groupId>me.hypherionmc.sdlink</groupId>
    <artifactId>mcdiscordformatter-1.20.3</artifactId>
    <version>2.0.0</version>
</dependency>

Gradle

repositories {
    maven {
        url "https://maven.firstdarkdev.xyz/releases"
    }
}

dependencies {
    implementation("me.hypherionmc.sdlink:mcdiscordformatter-1.20.3:2.0.0")
}

Basic usage

// For Minecraft -> Discord translating
String output = DiscordSerializer.INSTANCE.serialize(TextComponent.of("Bold").decoration(TextDecoration.BOLD, true));

// For Discord -> Minecraft translating
Component output = MinecraftSerializer.INSTANCE.serialize("**Bold**");

About

A library for Converting Discord Formatting to Minecraft and Vice Versa

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages