I have placed multiple heads with different skin but same player name. I'm doing this because I can't afford multiple minecraft accounts. How do I get the head and give it to player inventory using commands?

How can I modify this to place it into the player's helmet slot?

  • How are your heads stored? Are they items, entities, or placed blocks? – ExpertCoder14 Oct 11 '20 at 17:36
  • placed or inside chest , other than that no – user6668201 Oct 11 '20 at 20:00

If the head is inside a template chest, you can use /clone to clone the chest to a player's position, and use /setblock in destroy mode to cause the chest to drop the head on the player.

  1. Clone the chest to player's position.

    /execute at @p run clone Tx Ty Tz Tx Ty Tz ~ ~ ~

    T: Location of template chest.

  2. Set the chest to air, causing it to drop all the items on the player.

    /execute at @p run setblock ~ ~ ~ air destroy
  3. Delete the chest entity.

    /kill @e[type=item,nbt={id:"minecraft:chest"}]
  • thank you , i tried to upvote this as a thanks but because of reputation i can't , but i also can't mark this as answer because i would prefer directly giving it to player inventory instead of dropping it near player to prevent player missing it – user6668201 Oct 13 '20 at 7:20
  • That's all I could think of because /data modify and /execute store cannot update player data. – ExpertCoder14 Oct 13 '20 at 14:24

You could do

loot replace entity <player selector> <slot> mine <cords> minecraft:stick

That should work unless I messed up the command syntax. If it doesn’t work for you comment it so I can help. That command will replace the slot the command specifies on the player with the loot from mining the head. (Which will be the head). This works if the head is placed. I hope this helps.

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.