Can you get a dragon head by killing it with charged creepers?

Solution 1:

The fact it's not possible can also be verified by looking at the Ender Dragon's loot table in the default datapack which has the following content:

{
  "type": "minecraft:entity"
}

I.e. no item drops at all. You should be able to enable it with a loot table such as this one:

{
  "type": "minecraft:entity",
  "pools": [
    {
      "rolls": 1.0,
      "entries": [
        {
          "type": "minecraft:item",
          "name": "minecraft:dragon_head"
        }
      ],
      "conditions": [
        {
          "condition": "minecraft:entity_properties",
          "predicate": {
            "type": "minecraft:creeper",
            "nbt": "{Charged:1b}"
          },
          "entity": "killer"
        }
      ]
    }
  ]
}

Solution 2:

To my knowledge, the only way to obtain dragon heads are from the End city ships.

On death, the Ender dragon can only give a dragon egg (for the first dragon death only), spawn an end gateway at the end of the main island (one new gateway spawns in per dragon death, which caps out at 20), and varying amounts of exp. orbs, with the amount depending on whether it was the first death or a following death (the dragon drops 12000 exp. on its first death, and drops only 500 in future deaths).

It's unlikely that charged creepers are able to effect the Ender dragon's drops, since the dragon's drops are more about spawning certain blocks in the world and exp. orbs, rather than actual items.

Solution 3:

No. I tested this by traveling to the end and typing /execute at @e[type=minecraft:ender_dragon,limit=1] run summon minecraft:creeper ~ ~ ~ {powered:1b,ExplosionRadius:30b,Fuse:0,ignited:1b}.

This summoned a charged creeper that killed the enderdragon instantly. The dragon did not drop a head.