0

I'm trying to make a map with a death-checker. I'm not a command pro, so I used MCStacker to generate a command. The below command is a function that I generated:

give @p chain_command_block{display:{Name:'{"text":"Consequence block","color":"blue","bold":true}'},Enchantments:[{}],BlockEntityTag:{Command:"execute if score @p Deaths matches 10 run title @p title {"text":"this is a test","color":"#6BFF93","bold":true}",auto:1b}} 1

This will give me a command block, which will check if I'm at 10 deaths and if so, will execute a title. But for some reason it doesn't work. Instead, the command generator wants me to make the code like this:

run title @p title {"}} 1

But if I do that, my command doesn't work anymore.

I've been stuck with it for a few hours now. How can I get this command to work? I'd prefer solutions that fix the issue in MCStacker so I can regenerate the command.

My screen with the commands:

this is my screen with the commands

The error in Minecraft log:

error log of minecraft

6
  • 5
    Possible duplicate of Why am I getting an 'unexpected token' error with this command?
    – pppery
    Commented Jul 13, 2020 at 22:05
  • 1
    @pppery Probably more of a borderline duplicate if anything. It's in the same ballpark as the linked, but this has enough subtle differences (asking about manipulating MCStacker instead of manipulating the command itself) to be a different question. According to MSE, we should only close questions that are real duplicates, those that are covering the exact same topic.
    – One 2 Many
    Commented Jul 14, 2020 at 0:45
  • 1
    I seriously do not believe this is a duplicate. This is about manipulating MCStacker, not manipulating the command itself. The OP even says that they rarely make their commands themselves, and that they always generate them. The duplicate you have linked is mainly for tweaking the raw command, which I can't see connecting to how you would fix it in MCStacker.
    – One 2 Many
    Commented Jul 21, 2020 at 2:48
  • 3
    @ExpertCoder14 The asker must challenge the duplicate by clarifying why it's not. I've rolled back your edit because it does not improve the question, it just attempts to challenge the closure. I invite you to attempt to clarify the question to make it more obvious, but a giant bold argument at the top isn't the way to go.
    – Frank
    Commented Jul 22, 2020 at 16:26
  • 2
    @Frank Thanks. I’m still working out the kinks of the system. I have a different idea now, and I’ll try it out now. Does this mean I’ve lost out on the chance to put this in the review queue for reopening by editing?
    – One 2 Many
    Commented Jul 22, 2020 at 18:27

1 Answer 1

1

Look carefully at the help popup that appears when you click the ? next to the Command field.

It says:

The command to execute. Commands containing double quotes will need to be escaped. Prefix any double quotes with a backslash.
For example \"

That gives you all the info you need to fix the command.

The issue that arises when you fail to follow this info is linked at this question. Read it and its accepted answer if you want a technical insight as to what is going on.


In your case...

Your current command is:

/give @s chain_command_block{display:{Name:'{"text":"Consequence block"}'},Enchantments:[{}],BlockEntityTag:{Command:"SEE_BELOW",auto:1b}}

Your command that is in the command block is:

execute if score @p deaths matches 10 run title @p title {"text":"this is a test","color":"#60FF93","bold":true}

Looking at the quote above, you will need to go through your command and put a \ before every ". Doing it on the following strings of text would look like this:

  • """ would become \"\"\"
  • "hello" would become \"hello\"
  • {"text":"You died!"} would become {\"text\":\"You died!\"}

And your command listed above would become:

execute if score @p deaths matches 10 run title @p title {\"text\":\"this is a test\",\"color\":\"#60FF93\",\"bold\":true}

Paste the above into the Command field of MCStacker and it should work just fine.

0

Not the answer you're looking for? Browse other questions tagged or ask your own question.