3

I can't use a /title command in a /execute command. Like this:

/execute @a[score_Health_min=0,score_Health_max=1] ~ ~ ~ /title @a title ["",{"text":"/!\\ You Died :( /!\\","color":"dark_red","underlined":true}]

I use this command and it won't work. Because I'm making a map and when the player died or dying, it will say in the screen:

/!\ You Died /!\

Please help me I don't know how to do this and if it uses a fill clock. I'm just gonna add a fill clock in my map.

5

The \ character is a special control character for escape sequences. You had placed it before a quotation mark, which essentially prevents that quote from doing its job (closing the string) and instead to be a part of the value. The result is the next available quote closing the string, which then leads to a syntax error due to the lack of a comma afterwards.

You will want to escape the backslash by applying another backslash before it.

As well, there is no score_name_max parameter, and is thus ignored. The parameter you want is simply score_name.

Fixed command:

/execute @a[score_Health_min=0,score_Health=1] ~ ~ ~ /title @a title ["",{"text":"/!\\ You Died :( /!\\","color":"dark_red","underlined":true}]
| improve this answer | |
  • Good answer! In programming, the \ character deals with commands like these: "Say "hi"" The computer would think the string is ended at the second ". That's why you use escape characters: "Say \"hi\"" – APCoding Apr 9 '16 at 15:07
  • Well it didn't worked for some reason and i'm using mc 1.9.2 so does it work?Because i'm making a minigame map and if a player dies,a title command appear but it does not. – Rjlapatan Apr 10 '16 at 6:40
  • @Rjlapatan I can't really help if you don't provide any error messages or details as to why it doesn't work "for some reason". The command itself does work as long as a player was found in the first place. – Skylinerw Apr 10 '16 at 6:47
  • Its ok now if it doesn't work again,it means this question is now answered.Thanks for helping me @Skylinerw – Rjlapatan Apr 10 '16 at 9:47
1
  • where the spawn point is place two command blocks:

    /tp @p[r=2]

    /title @p[r=2]

  • make these command blocks repeating (if you're on 1.9 just set it, on 1.8 you should create a clock or more simple a small Redstone circuit with repeaters in circle)

When a player die and is in the spawn location it will execute /title command only to him, and will be teleported to the real spawn location

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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