1
0
Fork 0
mirror of https://github.com/haselkern/Minecraft-ArmorStand.git synced 2025-12-03 06:24:07 +00:00

Text components do not need to wrapped as a JSON string

This commit is contained in:
Lenny Lord 2025-11-20 01:29:00 +05:30 committed by thelennylord
parent edc9abf002
commit 7bd46b4528

View file

@ -724,6 +724,12 @@ function generateCustomName() {
props.obfuscated = nameObfuscated;
}
if (mcVersion >= MC_VERSION.v1_21_5) {
// Since 1.21.5+, text components are no longer stored as JSON wrapped by a string.
// So just return the props object instead
return props
}
let stringified = JSON.stringify(props);
if (mcVersion < MC_VERSION.v1_14) {
// Stringify again to escape double quotes, as versions below 1.14