Skip to content

[Suggestion] Pretty NBT #142

@ShaneBeee

Description

@ShaneBeee

I wanted to suggest the addition of pretty NBT printing.
This is basically what Minecraft uses when you run the /data command, and its prints the colourful NBT strings

Here is an example showing printing an NBT compound, pretty printing a compound, and pretty printing a compound with a split (split creates new lines, with a string option for how it spaces):

If it helps at all, I will include my class I use in my plugin for this:
https://github.com/ShaneBeee/SkBee/blob/master/src/main/java/com/shanebeestudios/skbee/api/reflection/ChatReflection.java
(pardon my messy code)
Just a heads up also, Minecraft changed the way it worked in 1.17 with a new "tag visitor" system, hence the 2 sets of reflection for 1.16 and 1.17
Hope this helps

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions