• Stars
    star
    267
  • Rank 150,057 (Top 4 %)
  • Language
    Java
  • License
    MIT License
  • Created over 6 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A MarkDown inspired markup library for Minecraft chat components

MineDown

A library that adds the ability to use a MarkDown inspired markup to write Minecraft chat components!

It provides a custom mark up syntax which is loosely based on MarkDown that adds the ability to use the full power of component messages with the same simplicity as legacy formatting codes. (Which it can still support!) It also includes a way to directly replace placeholders in the messages, both string based and component based ones!

See this plugin for a simple implementation.

Syntax

Inline Formatting

Description Syntax More Info Preview
Color legacy &6Text Formatting codes
Color &gold&Text Color names
RGB Hex Color &#ff00ff&Text Full hexadecimal format
RGB Hex Color &#f0f&Text Short format (equivalent to long one)
Gradient &#f0f-#fff&Text Inline gradients
Rainbow &rainbow&Text Inline Rainbow
Rainbow Phase &rainbow:20&Text Inline Rainbow with a phase
Bold **Text**
Italic ##Text##
Underlined __Text__
Strikethrough ~~Text~~
Obfuscated ??Text??

Events

You can define click and hover events with the commonly used MarkDown link syntax as well as specify formatting, font and colors that way.

Simple Syntax

Description Syntax
General syntax [Text](text-color text-formatting... link hover text)
Simple Link [Text](https://example.com)
Simple Command [Text](/command to run)
Link + Hover [Text](https://example.com Hover Text)
Text formatting [Text](blue underlined !bold)
Gradient [Text](#fff-#000)
Rainbow [Text](rainbow)
Phased Rainbow [Text](rainbow:20)
Text formatting + Link + Hover [Text](#0000ff underlined https://example.com Hover Text)

Advanced Syntax

Description Syntax More Info
General syntax [Text](action=value) ClickEvent.Action, HoverEvent.Action
Link [Text](open_url=https://example.com)
Color [Text](color=red) Color names
RGB Hex Color [Text](color=#ff00ff) Full hexadecimal format
RGB Hex Color [Text](color=#f0f) Short format (equivalent to long one)
RGB Color Gradient [Text](color=#fff-#000) Gradient of two colors. (Supports all color forms)
RGB Color Gradient [Text](color=#fff-#333-#222) Gradient of three colors.
RGB Rainbow [Text](color=rainbow) An RGB rainbow.
Phased RGB Rainbow [Text](color=rainbow:50) An RGB rainbow with a specific phase.
Formatting [Text](format=underlined,bold) Specify formatting
Disable Formatting [Text](format=!underlined) Disable the specific formatting with a ! prefix
Font [Text](font=custom_font) Set a custom font from a resource pack
Run Command [Text](run_command=/command string) Run command on click
Suggest Command [Text](suggest_command=/command) Suggest a command on click
Simple Hover [Text](hover=Hover Text) Show hover text
Hover Text [Text](show_text=Hover Text) Show hover text
Hover Entity Info [Text](show_entity=uuid:pig Name) Show entity information.
Hover Item Info [Text](show_item=stone*2 nbt...) Show item information, additional information needs to be provided as a string of the nbt in json
Insertion [Text](insert=insert into input) Insert into input on shift click, can be combined with other events

All advanced settings can be chained/included in a event definition. You can't however add multiple different colors or click and hover actions!

How to use it

The library's main API access is through the MineDown.class and its parse methods.

E.g. you can use it like this in your Spigot plugin:

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.

Include it into your plugin

You can easily include this library into your plugin by using maven. Make sure to relocate it into your plugin's package!

Repository

<repositories>
    <repository>
        <id>minebench-repo</id>
        <url>https://repo.minebench.de/</url>
    </repository>
</repositories>

Artifact

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>

For usage in any platform that is supported by kyori-adventure:

<dependencies>
    <dependency>
        <groupId>de.themoep</groupId>
        <artifactId>minedown-adventure</artifactId>
        <version>1.7.1-SNAPSHOT</version>
        <scope>compile</scope>
    </dependency>
</dependencies>

Please note that you need to provide an adventure platform library yourself in that case.

Relocation

<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>

Alternative to shading

Alternatively you can also directly depend on my MineDownPlugin instead of shading in this library! MineDownPlugin includes a non-relocated version of this library.

License

MineDown is licensed under the MIT open source license:

Copyright (c) 2017 Max Lee (https://github.com/Phoenix616)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

More Repositories

1

InventoryGui

A library for Bukkit plugins to create GUIs with inventories
Java
162
star
2

Snap

Experimental tool to run BungeeCord plugins on Velocity
Java
105
star
3

ResourcepacksPlugins

Set resource packs on whole proxy, per server and per world!
Java
66
star
4

ConnectorPlugin

Plugin to simplify communication between multiple Minecraft servers (and proxies) in a network. Supports plugin messages, redis and MQTT (e.g. using RabbitMQ or Google Cloud. MQTT is untested rn!). RedisBungee alternative.
Java
53
star
5

RandomTeleport

Bukkit plugin which lets you teleport players to random locations. [v2: 1.13 - 1.16.x]
Java
17
star
6

IDConverter

Converts numeric item IDs to Bukkit Material names (1.13 and legacy) in files (e.g. configs)
Java
12
star
7

Updater

Update utility, made mainly for Minecraft plugins but can be used for any software
Java
11
star
8

TFT-Overlay-Java

Java Overlay for League of Legends' Teamfight Tactics.
Java
11
star
9

VersionConnector

Bungee plugin to connect different Minecraft client versions to different servers on join
Java
10
star
10

ServerStatus

Small BungeeCord plugin to check the status of connected servers
Java
9
star
11

BetterBeds

Bukkit plugin to make sleeping in Minecraft a lot better.
Java
8
star
12

MineDownPlugin

Plugin providing commands to send MineDown messages
Java
7
star
13

EditArmorStands

Bukkit plugin to edit all the awesome features of ArmorStands
Java
5
star
14

lang

Language config framework for Bukkit, Bungee and standalone java programs
Java
5
star
15

TimedScripts

Bukkit plugin to create scripts to run commands in correctly timed processes
Java
4
star
16

WhatPlugin

What plugin is a command from? What is its permission, aliases and description? Find out with this cool kid's Bukkit plugin!
Java
3
star
17

NamechangeSimulator

Bukkit plugin to simulate Minecraft online mode name changes
Java
3
star
18

OpenShulkerBoxes

Simple Bukkit/Spigot plugin to open the inventories of Shulker Boxes without placing them down
Java
3
star
19

ResourcePackDecryptor

A simple tool to unpack corrupted zip files commonly used to "encrypt" Minecraft resource packs with tools like PackSquash.
Java
3
star
20

MapToImage

Simple Bukkit plugin to save maps to images
Java
2
star
21

GlobalWarps

Simple global network warp plugin depending on ConnectorPlugin
Java
2
star
22

ShowItem

Show your items to other players via chat.
Java
2
star
23

CommandBlockPermissions

Bukkit plugin to manage command blocks with permissions
Java
2
star
24

TemporaryBlocks

Bukkit plugin to remove player placed blocks after a certain, per-type configurable delay.
Java
2
star
25

AutoQueue

Bungee plugin to automatically queue players that try to join a server
Java
2
star
26

BungeePlugin

Framework to better provide some basic Bungee plugin methods like Bukkit does
Java
2
star
27

EnhancedVanilla

Bukkit plugin to add new mechanics that enhance the vanilla gameplay
Java
1
star
28

BlockElytraArrowBoost

Simple bukkit plugin to block boosting yourself with arrows while gliding with an Elytra!
Java
1
star
29

df-style-glowing-earth

Glowing Earth style for the German browser game Darkfleet.de
CSS
1
star
30

hook

Library to simplify hooking into other plugins.
Java
1
star
31

BukkitPlugin

Simple base for plugins based on the Bukkit API
Java
1
star
32

TextIconsRP-Web

Web tool to easily convert and find icons from the Text Icons Rsourcepack by WolfieMario
JavaScript
1
star
33

StopFocusSteal

Really simple AutoHotKey script to stop unwanted focus steal under Windows
AutoHotkey
1
star
34

OpenAuctions

An open source auction house plugin for Paper Minecraft servers. WIP for the next couple of months/years! ETA: Nov '23
1
star
35

ListenerControl

Simple Bukkit plugin to unregister event listeners of other plugins
Java
1
star
36

NeoBans

Modern player banning plugin
Java
1
star
37

CheaperPhysicsEvent

Paper plugin to replace BlockPhysicsEvent listeners with the BlockDestroyEvent
Java
1
star
38

FakeEconomy

Simple, in-memory Vault economy provider. Not a real economy plugin! Only useful for testing.
Java
1
star
39

DynamicSlots

Dynamically set your Minecraft server list slots (Bungee&Bukkit)
Java
1
star
40

BlockPluginMessages

Bungee plugin to block specific plugin message channels for specific servers in your network
Java
1
star