0

I need to know how to detect if a player kills a zombie so I can finish my game where zombies attempt to attack a castle and you have to defend it. I want to make so that when you kill 50 zombies you win the game.

if this is possible please tell me how to do it.

8
  • Have you made any attempt to solve this yourself? Arqade works better when askers show effort to solve their own problems; we see that you have a problem you've worked on, and answerers respond to that. You also get a more specific answer that's tailored exactly to the part you're stuck, and Arqade gets a very specific question. Everybody wins!
    – Frank
    Commented Feb 25, 2017 at 22:05
  • i'm stuck at every part. Commented Feb 25, 2017 at 22:07
  • What part is, "every part"? What have you tried to solve this?
    – Frank
    Commented Feb 25, 2017 at 22:30
  • i'm stuck at every part and I used other posts on this website and other websites and they are all outdated. Commented May 31, 2017 at 1:08
  • So what is every part? Show us what you've tried! Not doing so makes it sound like you want us to do it all for you.
    – Frank
    Commented May 31, 2017 at 1:50

1 Answer 1

1

You can add an objective of type stat.killEntity.Zombie, which will keep track of how many zombies the player has killed:

/scoreboard objectives add KillZombie stat.killEntity.Zombie

You can select people who have killed 50 zombies with @a[score_KillZombie_min=50]. For example, to teleport them somewhere:

/tp @a[score_KillZombie_min=50] X Y Z
3
  • ok. so, how to I set the score back to 0? Commented Feb 25, 2017 at 22:13
  • also, will "/title @a[score_KillZombie_min=50] Title [text:"you won!]" work? Commented Feb 25, 2017 at 22:17
  • nevermind I found out how to set it to zero Commented Feb 25, 2017 at 22:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.