#How to get player head?`

1 messages · Page 1 of 1 (latest)

cold marlin
#

execute as @a[team=P1] run loot replace entity @e[tag=p1.controller] armor.head loot {"function": "minecraft:fill_player_head","entity": "this"} I have this setup in my datapack and I want it to run and set the spefic player head to the exact player head.

gritty bronzeBOT
#

<@&1201956957406109788>

Someone will come and help soon!

💬 While you wait, take this time to provide more context and details.

🙇 If nobody has answered you by <t:1740246064:t>, feel free to use the Summon Helpers button to ping our helper team.

✅ Once your question has been resolved (or you no longer need it), please click Resolve Question or run /resolve

cold marlin
somber plume
#

filling player head only works with players

#

so not just any entity

peak leaf
#

It looks like you're doing only part of a loot table, you're missing what the item actually is, how many rolls, etc

cold marlin
#
execute if entity @a[team=P1] run summon armor_stand 8 -60 8 {Small:true,ShowArms:1b,Tags:[p1.controller]}

execute as @a[team=P1] run loot replace entity @e[tag=p1.controller] armor.head loot {"function": "minecraft:fill_player_head","entity": "this"}
item replace entity @e[tag=p1.controller] armor.body with leather_chestplate[dyed_color={rgb:17053}]
item replace entity @e[tag=p1.controller] armor.legs with leather_leggings[dyed_color={rgb:17053}]
item replace entity @e[tag=p1.controller] armor.feet with leather_boots[dyed_color={rgb:17053}]``` if you want to see full control
cold marlin
atomic jackal
#

Yeah you’re putting an inline item modifier in a place where a loot table should go

peak leaf
cold marlin
#

frick

#

auto mod >:C

atomic jackal
#

If it’s easier you can just /item replace a player head in the slot beforehand and then run the item modifier you already have

cold marlin
#

this should be in datapack wiki

atomic jackal
#

Maybe it should

cold marlin
#

what should i set the entries to?

atomic jackal
cold marlin
#

help

#

im using that

atomic jackal
#

Just have one entry for a player head item

#

The entries define what the output item should be, and the functions will then do stuff to the output item before it gets outputted

cold marlin
#
  "type": "minecraft:command",
  "pools": [
    {
      "rolls": 0,
      "entries": [
        {
          "type": "minecraft:loot_table",
          "value": "minecraft:blocks/player_head",
          "functions": []
        }
      ],
      "functions": [
        {
          "function": "minecraft:fill_player_head",
          "entity": "this"
        }
      ]
    }
  ]
}```
so this looks fine?
#
  "type": "minecraft:command",
  "pools": [
    {
      "rolls": 0,
      "entries": [
        {
          "type": "minecraft:item",
          "name": "minecraft:player_head",
          "functions": []
        }
      ],
      "functions": [
        {
          "function": "minecraft:fill_player_head",
          "entity": "this"
        }
      ]
    }
  ]
}``` okay solved it
atomic jackal
#

That looks more correct yeah

cold marlin
#

ayy

#

thanks

#

been a while since i did loot table stuff