SPGoding / spu

SPU Performs Updating, an npm package that provides method to update Minecraft commands. No longer maintained; use https://github.com/SPGoding/datapack-language-server to update newer datapacks instead.
https://npmjs.com/package/spu
MIT License
49 stars 5 forks source link

Issue with tellraw and customName #40

Closed phoenixlzx closed 6 years ago

phoenixlzx commented 6 years ago

Hello,

I get error to parse tellraw commands:

/tellraw @a [{"selector":"@s"}," throws item"]

Error:

Updated error. 
Line #1: Failed to parse 'tellraw @a [{"selector":"@s"}," throws item"]': 
Parser 'minecraft:component' failed to parse '[{"selector":"@s"}," throws item"]': Expected a valid JSON.

And customName does not convert:

/summon item ~ ~ ~ {PickupDelay:70,CustomName:"Terracotta",CustomNameVisible:1,Item:{id:"minecraft:magenta_glazed_terracotta",Count:1b,tag:{display:{Lore:["lore line 1","lore line 2"]}}}}

I get this from spu:

/summon item ~ ~ ~ {PickupDelay:70,CustomName:"Terracotta",CustomNameVisible:1,Item:{id:"minecraft:magenta_glazed_terracotta",tag:{display:{Lore:["lore line 1","lore line 2"]}},Count:1b}}

It will execute but there is warning in console. The correct one seems to be:

/summon item ~ ~ ~ {CustomNameVisible:1b,PickupDelay:70,CustomName:"{\"text\":\"Terracotta\"}",Item:{id:"minecraft:magenta_glazed_terracotta",Count:1b,tag:{display:{Lore:["lore line 1","lore line 2"]}}}}

(From https://mcstacker.net/1.13converter.php)

Thanks.

SPGoding commented 6 years ago

Both fixed. Thanks for your suggestion!

Good night.

phoenixlzx commented 6 years ago

Thank you for the quick fix.

I have sent you an email, please check that out.

Thanks again.

phoenixlzx commented 6 years ago

BTW The tellraw 1.13 result should be

/tellraw @a {"selector":"@a","color":"white","extra":[{"text":"throws","color":"white"}]}

It seems the extra section is only used for more than one segment in tellraw, like this:

/tellraw @a {"text":"test","color":"white","extra":[{"selector":"@s","color":"aqua"}]}
SPGoding commented 6 years ago

Arrays can still be used in text components.