The library's main API access is through the MineDown.class and its parse methods.
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 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-adventure 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>
To be used with bungeecord-chat in BungeeCord and Spigot-based servers:
<dependencies> <dependency> <groupId>de.themoep</groupId> <artifactId>minedown</artifactId> <version>1.7.0-SNAPSHOT</version> <scope>compile</scope> </dependency> </dependencies>
For usage in any platform that is supported by kyori-adventure:
<dependencies> <dependency> <groupId>de.themoep</groupId> <artifactId>minedown-adventure</artifactId> <version>1.6.2-SNAPSHOT</version> <scope>compile</scope> </dependency> </dependencies>
Please note that you need to provide an adventure platform library yourself in that case. (Unless you are on Velocity or some other server which provides it)
<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.