mcrcon icon indicating copy to clipboard operation
mcrcon copied to clipboard

Problem with syntax

Open LeonardoCT opened this issue 1 year ago • 4 comments

Hello, when i run /summon minecraft:cow 147 75 -64 {CustomName:""CoolCow""} From the normal console it works but when i try: mcrcon -H localhost -p my_password "summon minecraft:cow 147 75 -64 {CustomName:""NomePersonalizzato""}" Only a normal cow spawns without the CustomName i think the problem is that mcrcon is not correctly parsing the data

LeonardoCT avatar Mar 29 '24 12:03 LeonardoCT

Hi,

Mcrcon is not really parsing the input so I guess the terminal is decimating the quotation marks from the input.

Try escaping the quotes like this: "summon minecraft:cow 147 75 -64 {CustomName:\"NomePersonalizzato\"}"

Tiiffi avatar Mar 29 '24 16:03 Tiiffi

Hi, thanks for the fast reply, still no custom name, just a normal cow spawns: image

This is the exact command i used: mcrcon.exe -H [redacted] -p [redacted] "summon minecraft:cow 150 73 -49 {CustomName:"NomePersonalizzato"}"

i even tried some variations: mcrcon.exe -H [redacted] -p [redacted] "summon zombie 150 73 -49 {CustomName:'[{"text":"NomePersonalizzato"}]'}" ,,,But this is what i get: image And i still get a normal zombie

i would like to mention that the second command executes just fine from in-game command window (chat) and a custom entity with the right name spawns, i think there must be a problem when mcrcon sends the comand to the server.

LeonardoCT avatar Mar 30 '24 01:03 LeonardoCT

Since you mentioned that the terminal could be decimating the input i will try to experiment with something, another note: the main goal of what im doing is to integrate with (Mix it up!) a software that allows the execution of commands upon custom twitch event (like a follower or a donation) and do some in-game stuff, i can do stuff like get the player coordinates (i had to make a little parser to make it digest the entity data and ONLY get the coordinates) and spawn an entity (or a block) and it wold be very nice to summon the entity with the name of the follower

LeonardoCT avatar Mar 30 '24 01:03 LeonardoCT

Ok, i found the solution, i escaped both quotations in the second iteration and got it to work with this: mcrcon.exe -H [redacted] -p [redacted] "summon zombie 150 73 -49 {CustomName:'[{"text":"NomePersonalizzato"}]'}"

LeonardoCT avatar Mar 30 '24 01:03 LeonardoCT