How can I detect which specific mob was killed by a player and increase a score accordingly?

I'm making a Tower Defense map and my score system is pretty simple, whenever you kill a zombie the 'Money' scoreboard gets 1 more score.

I used the command

/scoreboard objectives add Money stat.killEntity.Zombie Money

to set up the counter for that.

In my map there are different zombies, some have got more health then others. My problem is, all the different zombies give as much Money. So if the player kills a zombie of Lvl 1 or Lvl 12, the players always just gets 1 money. All the zombies are summoned with a '/summon' command and my solution to this was to give the different zombies different names and somehow make the scoreboard track down what zombie the player killed. (It will check the name of the zombie that has been killed)

Does someone know how? Or an easier or better way? I would highly appreciate it! I've got this problem for a while now and I cant make progress because of this. If someone can help me I'll credit him/her in my map.


If your map is not going to be multiplayer, you may want to consider tracking if each zombie spawned is alive by attempting to execute commands on them and checking if said commands succeed.

Another solution, which I think is probably the best, is to implement custom loot from the different zombies that you spawn, perhaps paper or gold that is renamed to different values, or just different drops from each enemy, that are then automatically cleared from the players' inventories in exchange for scoreboard points.


what is probably a bit better than your "different mobs" version: you could give them named armor (if you don't want them to be armored make them wear Zombie head items on their "real" head and name these) with 100% drop rate (0% for irrelevant armor parts so you don't need to mess around with them), then give score depending on the name of the heads the players collect and immediately clear the player's inventory for the specific item

a few advantages towards the multi-mob style:

  • all the enemies behave like Zombies (what you probably originally wanted them to)
  • you can have many levels not limited by the amount of hostile mobs in MineCraft
  • you can make this per mob, i.e. you can put level 1 Zombies, level 1 Skeletons and level 1 Endermen into the same wave

not sure if you like this better than your version of doing it, but if you do my planned in-game name is CreatorCraft ;-)

EDIT: just figured out that hacatu's "custom loot" answer is just what I explained