The library's main API access is through the MineDown.class and its parse methods.
player.sendMessage(new MineDown(rawMessage).replace(replacements).toComponent());
or with a static approach:
player.sendMessage(MineDown.parse(rawMessage, replacements));
This is possible on any platform that implements the Adventure Component API!
Take a look at the MineDown JavaDocs for more detailed info on the library and the included classes.
BukkitAudiences.create(plugin).player(player).sendMessage(new MineDown(rawMessage).replace(replacements).toComponent());
or with a static approach:
BukkitAudiences.create(plugin).player(player).sendMessage(MineDown.parse(rawMessage, replacements));
Take a look at the MineDown JavaDocs for more detailed info on the library and the included classes.
player.spigot().sendMessage(new MineDown(rawMessage).replace(replacements).toComponent());
or with a static approach:
player.spigot().sendMessage(MineDown.parse(rawMessage, replacements));
Take a look at the MineDown Legacy JavaDocs for more detailed info on the library and the included classes.
You can easily include this library into your plugin by using maven. Make sure to relocate it into your plugin's package!
<repositories> <repository> <id>minebench-repo</id> <url>https://repo.minebench.de/</url> </repository> </repositories>
For usage in any platform that is supported by kyori-adventure/has an adventure-platform adapter:
<dependencies> <dependency> <groupId>de.themoep</groupId> <artifactId>minedown-adventure</artifactId> <version>1.7.3-SNAPSHOT</version> <scope>compile</scope> </dependency> </dependencies>
Please note that on platforms that don't implement Adventure themselves (e.g. Spigot or Bungee) you need to provide an adventure platform library yourself in that case. (Both Paper and Velocity provide adventure)
Legacy version to be used with bungeecord-chat in BungeeCord and Spigot-based servers:
<dependencies> <dependency> <groupId>de.themoep</groupId> <artifactId>minedown</artifactId> <version>1.7.1-SNAPSHOT</version> <scope>compile</scope> </dependency> </dependencies>
<build> <plugins> <plugin> <artifactId>maven-shade-plugin</artifactId> <version>3.1.0</version> <configuration> <relocations> <relocation> <pattern>de.themoep.minedown</pattern> <shadedPattern>your.package.path.libraries.minedown</shadedPattern> </relocation> </relocations> </configuration> <executions> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> </execution> </executions> </plugin> </plugins> </build>
Alternatively you can also directly depend on my MineDownPlugin instead of shading in this library! MineDownPlugin includes a non-relocated version of this library.