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 [2024/08/11 12:36] (current) – Update to focus on adventure phoenix616 | ||
---|---|---|---|
Line 3: | Line 3: | ||
The library' | The library' | ||
- | E.g. you can use it like this in your Spigot plugin: | + | ===== 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](https:// | ||
+ | detailed info on the library and the included classes. | ||
+ | |||
+ | ===== On Spigot | ||
+ | |||
+ | ```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 ===== | ||
```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 ==== |