2

I have made a minigame on my server, mctrees.net, using command blocks but it dosen't work with multiplayer so I would like to make it place the commands that run for the game but for it to make it specific to each player. e.g. I have a command that usually gets run:

/setblock **@p**[r=10] dirt ~ ~10 ~ 

and I would like to make it setblock that command in a command block when a player (trebor97351) starts the game. it should setblock a command block with the command:

/setblock **trebor97351**[r=10] dirt ~ ~10 ~

How would I do this? I know that you can place command blocks with prefilled commands but you can't specify a player when doing that?

  • If u use /Sudo {name} {command with out \} will make them run the command, I believe it is still dependent on permission though. Since it's a server you could just find a plugin to do it instead – Jaconah Apr 14 '16 at 16:30
  • @Juconah That command can only be used if you have a specific plugin. – nelson2tm Apr 14 '16 at 18:38
  • you are all saying i should use a plugin, but what plugin do you suggest? – trebor97351 Apr 16 '16 at 21:04
1

By the way, unless you have a mod changing this, the syntax for /setblock has no player selectors. You can, however, use /execute, along with [name=], to accomplish this:

/execute @p[r=10,name=<username>] ~ ~ ~ setblock ~ ~10 ~ minecraft:dirt
0

make a certain score. for example apply

then try this

execute @a[score_apply_min=0,score_apply=0] ~ ~ ~ setblock ~ ~10 ~ minecraft:dirt

score_apply_min=0 tests for players with a score of 0 as minimum

score_apply=0 (must be with score_apply_min=0) acts as the maximum value for the score apply.

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.