Minecraft legacy color code message translator
Project description
JSONTextMC
JSONTextMC is a module for translating legacy messages to and from JSON-formatted text.
Output is not valid JSON by itself, it must be translated into JSON with json.loads()
.
Strict modes and inheritance of various JSON elements can be controlled.
Requires Python 3.0.
Table of Contents
Installation
Use the package manager pip to install JSONTextMC.
python3 -m pip install jsontextmc
See the package page on PyPi here.
Use the output in any place where a JsonTextComponent is accepted (e.g. /tellraw, /title, .json files).
Support
Supports all Vanilla Minecraft formatting codes:
- All color codes
- All formatting codes
- Hexidecimal
- Alows both
#
andx
as prefix codes
- Alows both
Usage
Read the PyDocs in the module for details about usage. Essentially:
to_json()
: Legacy -> JSONfrom_json()
: JSON -> Legacy
Strict and inheritance modes control how legacy text is handled and translated into JSON.
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
If there is an individual issue you would like to bring attention to, please open one here.
License
Distributed under the GPLv3 license. (visit GNU's website)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.