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?

3
  • 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
    Commented Apr 14, 2016 at 16:30
  • @Juconah That command can only be used if you have a specific plugin.
    – nelson2tm
    Commented Apr 14, 2016 at 18:38
  • you are all saying i should use a plugin, but what plugin do you suggest? Commented Apr 16, 2016 at 21:04

2 Answers 2

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .