I recently started working on a map and I encountered a problem when it comes to Mob death detection. I tried this setup but it just didn't work for me because I got really confused with it. So I'm asking if anyone knows how to do this?
I want to make something like a Mob Detection System. For example: the player kills a mob, the mob's death somehow sends a Redstone signal to a command block, which then teleports the player.
-
Rather than track mob death, why not track player mob kills?– aytimothyCommented Mar 22, 2020 at 7:44
-
1What kind of mob, how many mobs, please give some more information– Bloodbeast 234Commented Mar 22, 2020 at 9:06
-
3Duplicate of How do I detect the death of a mob?– Fabian RölingCommented Mar 22, 2020 at 11:48
-
"it just didn't work for me because I got really confused with it" is not a proper statement of your problem. What part of it didn't work? In what way? What have you tried yourself beyond that?– Fabian RölingCommented Mar 22, 2020 at 11:48
1 Answer
Type this command into the chat:
/scoreboard objectives add mobKilled minecraft.killed:minecraft.zombie
Then in a repeating always active command block put this command in it:
/tp @a[scores={mobKilled=1..}] *your location here*
Then in a chain, conditional, always active command block connected to the repeating one:
/scoreboard players set @a[scores={mobKilled=1..}] mobKilled 0
The first command creates a scoreboard which tracks zombie deaths,
Then the repeating command block teleports all players who have killed a zombie to your location,
Then the chain command block resets the players score (The mob can be changed in the first command if you want, like this: minecraft.killed:minecraft.mobhere instead of zombie
-
-
Thanks, I would appreciate it if you marked it as answer Commented Mar 22, 2020 at 10:49