Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| library:minedown:usage [2020/09/16 15:40] – [How to use it] phoenix616 | library:minedown:usage [2025/06/16 11:38] (current) – Replace docs links to phoenix616.dev phoenix616 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== How to use it ====== | ====== How to use it ====== | ||
| - | The library' | + | The library' | 
| + | |||
| + | ===== MineDown using Adventure (e.g. on Paper or Velocity) ===== | ||
| + | |||
| + | ```java | ||
| + | player.sendMessage(new MineDown(rawMessage).replace(replacements).toComponent()); | ||
| + | ``` | ||
| + | or with a static approach: | ||
| + | ```java | ||
| + | player.sendMessage(MineDown.parse(rawMessage, | ||
| + | ``` | ||
| + | |||
| + | This is possible on any platform that implements the [Adventure Component API](https:// | ||
| + | |||
| + | Take a look at the MineDown JavaDocs (provided through Maven) for more | ||
| + | detailed info on the library and the included classes. | ||
| + | |||
| + | ===== On Spigot using adventure-platform ===== | ||
| + | |||
| + | ```java | ||
| + | BukkitAudiences.create(plugin).player(player).sendMessage(new MineDown(rawMessage).replace(replacements).toComponent()); | ||
| + | ``` | ||
| + | or with a static approach: | ||
| + | ```java | ||
| + | BukkitAudiences.create(plugin).player(player).sendMessage(MineDown.parse(rawMessage, | ||
| + | ``` | ||
| + | Take a look at the [MineDown JavaDocs](https:// | ||
| + | detailed info on the library and the included classes. | ||
| + | |||
| + | ===== Legacy BungeeCord-chat API on Spigot ===== | ||
| - | E.g. you can use it like this in your Spigot plugin: | ||
| ```java | ```java | ||
| player.spigot().sendMessage(new MineDown(rawMessage).replace(replacements).toComponent()); | player.spigot().sendMessage(new MineDown(rawMessage).replace(replacements).toComponent()); | ||
| Line 12: | Line 40: | ||
| ``` | ``` | ||
| - | Take a look at the [MineDown JavaDocs](https:// | + | Take a look at the [MineDown | 
| detailed info on the library and the included classes. | detailed info on the library and the included classes. | ||
| Line 33: | Line 61: | ||
| ==== Artifact ==== | ==== Artifact ==== | ||
| - | To be used with bungeecord-chat | + | === Adventure === | 
| + | |||
| + | For usage in any platform that is supported by [kyori-adventure](https:// | ||
| ```xml | ```xml | ||
| < | < | ||
| < | < | ||
| < | < | ||
| - | < | + | < | 
| - | < | + | < | 
| < | < | ||
| </ | </ | ||
| Line 45: | Line 75: | ||
| ``` | ``` | ||
| - | For usage in any platform | + | Please note that on platforms that don't implement Adventure themselves (e.g. Spigot or Bungee) you need to provide an [adventure | 
| + | |||
| + | === Legacy === | ||
| + | |||
| + | Legacy version to be used with bungeecord-chat in BungeeCord and Spigot-based servers: | ||
| ```xml | ```xml | ||
| < | < | ||
| < | < | ||
| < | < | ||
| - | < | + | < | 
| - | < | + | < | 
| < | < | ||
| </ | </ | ||
| </ | </ | ||
| ``` | ``` | ||
| - | Please note that you need to provide an [adventure | + | |
| + | <box red> | ||
| ==== Relocation ==== | ==== Relocation ==== | ||
