Skip to main content

JSONTextMC

Minecraft uses two main systems for formatting text.

The Legacy format uses section symbols and hexadecimal color coding, while the JSON format uses key-value pairs to color individual parts of text.

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.10+.

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 # and x as prefix codes

Usage

Read the PyDocs in the module for details about usage. Essentially:

  • to_json(): Legacy -> JSON
  • from_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)

Metadata

Release files for jsontextmc 3.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jsontextmc 3.2.0
File Size Uploaded
jsontextmc-3.2.0.tar.gz 16.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for jsontextmc 3.2.0
File Interpreter ABI Platform
jsontextmc-3.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 32.5 kB

Release files / jsontextmc-3.2.0.tar.gz

Download URL jsontextmc-3.2.0.tar.gz
Size 16.1 kB
Tags Source
SHA-256 checksum
How to use checksums
99f41c768937b54751d11a04309819c68b87f5680975781b52e35929e0ce809e
BLAKE2b-256 checksum
How to use checksums
53880cf1dabd1dbc11630c791ff39edd31fb94648764e27cd341a4bb800289c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.9

Release files / jsontextmc-3.2.0-py3-none-any.whl

Download URL jsontextmc-3.2.0-py3-none-any.whl
Size 16.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b75449c3623ec63ee47fd0af326ca6d14f49134a2c74f2a215f3ebea8ad6016b
BLAKE2b-256 checksum
How to use checksums
891091ab0fb36b0a0a412edf2eaaa5f9e361db6089c7c0edc341695280174bb6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.9

Release history Release notifications | RSS feed

This release

3.2.0 This release

2 release files

3.1.0

1 release file

3.0

1 release file

2.0.3

1 release file

2.0.2

1 release file

2.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page