4

I want to spawn a player head in my custom Minecraft map I'm making, but the problem is, the username has to be defined to give the actual player's head:

/give @p minecraft:skull 1 3 {SkullOwner:"<playername>"}

But I want this to work for any player that plays the map. Is there a way to build a command to do this?

  • Not possible for any player, unfortunately. – SirBenet Apr 28 '17 at 0:16
2

I wrote a script to do it...

This is written in Python and works on vanilla minecraft (even snapshots)

I currently give players a purple_shulker_box the first time they are seen by the server

https://github.com/Veritas83/Minecraft.SNAPSHOT.Commands.Mod/blob/master/commands.by.YT_Veritas0923.py

Line 1150-1153

if freeshulkerbox == True:
    cmdin = "give " + player + " purple_shulker_box 1\n"
    print "[" + get24hrtime() + "] [Script thread/EXEC]: " + cmdin,
    p.stdin.write(cmdin)

Change to:

if freeshulkerbox == True:
    cmdin = "give " + player + " minecraft:skull 1 3 {SkullOwner:" + player + "}\n"
    print "[" + get24hrtime() + "] [Script thread/EXEC]: " + cmdin,
    p.stdin.write(cmdin)

I think this will accomplish what you are asking.

Update:

I just tested this, and it does indeed work. :)

enter image description here

| improve this answer | |
  • Wow! Would thus work for a command block though? I want to do this for a single player map... – Ben Apr 30 '17 at 4:47
0

There is currently no known way in minecraft to do this.

| improve this answer | |

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.