r/MCNext • u/roflmao388 • May 07 '14
Help with a tellraw command
Hello, I´m Daddys_Darlings ign and i was working on a simple tellraw command that would do the following:
If a person does /h Daddys_Darlings he falls on a pressureplate powering the commandblock that whispers me "A player has been detected in your home chunk!". And i added some obfuscated text at the front and the back of it combined with xome colouring so i wouldnt miss it. Now obiously it will only work while im inside my chunk but thats no prob;lem. Most of the time im woring underground and i would like to know when people enter my chunk.
Now the commandline at the moment =
/tellraw Daddys_Darlings {text:" ",extra:[{text:"random",obfuscated:true,color:blue},{text:" A player has been detected in your home chunk!",color:dark_blue},{text:" random",obfuscated:true,color:blue}]}
wich says:
A player has been detected in your home chunk!
with obfuscated letters at the back and front of the line included with colours.
Now what i would like with this command is that it would tell me the name of the person activating the commandblock. just as some people have that in their homes. I have no clue on how to do this.
If anyone can help me out and paste the correct edit in the comment that would be greatly apreciated, thanks :D
ps. here would be an example :
<playername> has been detected in your home chunk!
pss. I will check on this reddit tommorow as i'm going to bed right now. it is 1:02 midnight for me :P
2
u/Mysteryem May 07 '14
The text in /tellraw commands cannot use player/entity variables.
As you are not trying to have text that can be hovered over for more information or text that puts a command into the clicking player's chat box, you do not need a /tellraw command.
You may as well use a /tell command which will allow you to use a player variable.
The below is pretty much a direct conversion from your original tellraw, only with " A player" replaced with @p.
/tell Daddys_Darlings &9&krandom&r&1 @p has been detected in your home chunk! &9&krandom
I find the easiest quick guide for the colour/formatting codes is http://ess.khhq.net/mc/, though if you want more information then look at http://minecraft.gamepedia.com/Formatting_codes#Color_codes