PrismarineJS / prismarine-chat

A parser for a minecraft chat message
MIT License
34 stars 21 forks source link

1.19 fromString - 'reset' ignored by client #85

Open dcrime opened 1 year ago

dcrime commented 1 year ago

While testing fromString in 1.19 (vanilla) I noticed the formatting isn't reset Example string '&cSome &rSample &aText' Output:


{
    text: 'Some',
    color: 'red',
    extra: [{
        text: 'Sample',
        color: 'reset',
        extra: [{
            text: 'Text',
            color: 'green',
        }]
    }]
}

While this should give (red)Some (white)Sample (green)Text It gives (red)Some (red)Sample (green)Text

Best solution I can think of is creating a root object and appending to it when reset (Or end of string) is encountered rather than using inheritance for the whole string