How to get nearest players head onto armorstand with summon

How to get nearest players head onto armorstand with summon - Group of Women Sitting on a Changing Room

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?



Best Answer

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"}}]}



Pictures about "How to get nearest players head onto armorstand with summon"

How to get nearest players head onto armorstand with summon - Hockey Team Standing in the Locker Room
How to get nearest players head onto armorstand with summon - A Boy in Hockey Uniform Standing in the Locker Room
How to get nearest players head onto armorstand with summon - A Group of Hockey Players



How do you get an armor stand to look at players?

You can summon an armor stand that has a diamond helmet, diamond chestplate, diamond leggings, and diamond boots hanging on it whenever you want using a cheat (game command) in Minecraft. This is done using the /summon command. This is a quick and easy way to get a full set of diamond armor that you can wear.



How to Summon Armor Stands With Custom Heads in Minecraft 1.16 Java Edition




More answers regarding how to get nearest players head onto armorstand with summon

Answer 2

You can add player heads onto armour stands by using this command:

/summon ArmorStand ~ ~ ~ {Equipment:[{},{},{},{},{id:"skull",Damage:3,tag:{SkullOwner:"(player name)"}}]}

Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

Images: cottonbro, Tima Miroshnichenko, Ron Lach, Ron Lach