Skip to content

A library for transcoding between Minecraft and Discord.

License

Notifications You must be signed in to change notification settings

QuiltServerTools/MCDiscordReserializer

 
 

Repository files navigation

MCDiscordReserializer Build Deploy

A library for transcoding between Minecraft and Discord.

Minecraft text is represented using Kyori's Adventure (compatible with 4.x.x).

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

Version

Text/Adventure Version MCDiscordReserializer version Maintained
4.x.x 4.x.x
3.x.x 3.x.x

Versions 4.2.0 and up

Maven

<dependencies>
    <dependency>
        <groupId>dev.vankka</groupId>
        <artifactId>MCDiscordReserializer</artifactId>
        <version>4.2.0</version>
    </dependency>
</dependencies>

Gradle

repositories {
    mavenCentral()
}

dependencies {
    implementation 'dev.vankka:MCDiscordReserializer:4.2.0'
}
Versions Before 4.2.0
#### Maven
```xml
<repositories>
    <repository>
        <id>Vankka-Nexus</id>
        <url>https://nexus.vankka.dev/repository/maven-public/</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>dev.vankka</groupId>
        <artifactId>MCDiscordReserializer</artifactId>
        <version>3.0.1</version>
    </dependency>
</dependencies>
```

#### Gradle
```groovy
repositories {
    maven { 
      id 'Vankka-Nexus'
      url 'https://nexus.vankka.dev/repository/maven-public/' 
    }
}

dependencies {
    implementation 'dev.vankka:MCDiscordReserializer:3.0.1'
}
```

Basic usage

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

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

About

A library for transcoding between Minecraft and Discord.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%