I'm making another map and in this one I need to get the nearest players skull on an armor stand. How would I do that and how would the target selector for putting the nearest players head on an armorstand work?
-
1Don't think this is possible.– SirBenetSep 27, 2015 at 20:44
-
@colorfusion I know it is I've seen it in other maps.– KingDarren7203Sep 27, 2015 at 23:51
-
1Could you link to these maps? Are they using any kind of mods?– SirBenetSep 28, 2015 at 17:50
-
@colorfusion I can't seem to remember which maps but I have played them and I'm using only vanilla Minecraft. I'll see if I can find them.– KingDarren7203Sep 28, 2015 at 19:27
-
2@KingDarren7203 I'm pretty sure this isn't possible in vanilla. If you tell us where you saw this done, it would help greatly with telling you how it was done.– SirBenetOct 3, 2015 at 12:53
2 Answers
As of Minecraft 1.8 and the upcoming 1.9 (currently snapshot 15w43c), there is no way to do this in vanilla Minecraft, short of a customized command for every single player.
It would require the use of placeholders/variables in NBT data, for which there is just no way.
That said, if the list of player usernames is known and fixed, you could use one command per player, executing only if that player is the one closest to the execution point.
/execute @p ~ ~ ~ execute @p[name=Alice,r=0] ~ ~ ~ summon ArmorStand ~ ~ ~ {Equipment:[{},{},{},{},{id:"skull",Damage:3,tag:{SkullOwner:"Alice"}}]}
/execute @p ~ ~ ~ execute @p[name=Bob,r=0] ~ ~ ~ summon ArmorStand ~ ~ ~ {Equipment:[{},{},{},{},{id:"skull",Damage:3,tag:{SkullOwner:"Bob"}}]}
...
/execute @p ~ ~ ~ execute @p[name=Zuul,r=0] ~ ~ ~ summon ArmorStand ~ ~ ~ {Equipment:[{},{},{},{},{id:"skull",Damage:3,tag:{SkullOwner:"Zuul"}}]}
You can add player heads onto armour stands by using this command:
/summon ArmorStand ~ ~ ~ {Equipment:[{},{},{},{},{id:"skull",Damage:3,tag:{SkullOwner:"(player name)"}}]}
-
3This answers how to add the skull to the armour stand, but not how to get the "nearest player's" name/id. Can you add that?– Robotnik ♦Sep 28, 2015 at 2:11
-
I need @players or the nearest players head, not a specific head. Sep 28, 2015 at 11:06