1

Command Block Help With Mob Kills

Sylastia 5/22/16 7:56 pm
441
5/24/2016 10:46 pm
So I have a very basic problem, but my broad knowledge of command blocks cannot reach this one subject: Scoreboards. So recently I have been making a map where you are teleported into an arena, then invisible ghasts will fly around and you need to kill them by knocking their fireballs back at them. So there are custom villagers that will sell you stuff for golden nuggets, but I do not know how to give someone a golden nugget every time they kill a ghast. I already have the scoreboard set up so a sidebar shows up telling you the amount of ghasts you have killed, but how do I give a player a golden nugget for every ghast they kill? I love any response and I will try all!

Thanks,
~Stagnate
Posted by
Sylastia
Level 5 : Apprentice Miner
1

  Have something to say?

JoinSign in

5

Mityky
05/24/2016 10:46 pm
Level 1 : New Crafter
I'd like to add onto the previous idea:

1) Set up 2 scoreboards:

/scoreboard objectives add GhastsKilled stat.killEntity.Ghast

/scoreboard objectives add nugget stat.killEntity.Ghast

2) Make a clock and have these two commands in this order (similar to the 1st idea):

/give @a[score_nugget_min=1] gold_nugget 1

/scoreboard players set @a[score_nugget_min=1] nugget 0

3) Enter this command for display only:

/scoreboard objectives setdisplay sidebar GhastsKilled

And you should be good to go!
Let me know how it goes!
1
Sylastia
05/22/2016 8:37 pm
Level 5 : Apprentice Miner
Wait nevermind about my last reply! I just thought of the idea of making another scoreboard with the same objective! Thank you so much with the command though!
Please tell me if you have any other ideas!
1
Sylastia
05/22/2016 8:31 pm
Level 5 : Apprentice Miner
Hello Tedk, the command worked out great! I just have one small problem. I would like it so all of the other players can see how many ghast kills you've gotten, do you know how to fix that? Thank you for the command though! If we can't find a remedy towards this, it's okay if I don't have a side bar.
1
Heklo
05/22/2016 8:14 pm
Level 25 : Expert System
Hi, what you can do here is have another objective that also adds one for every ghast you kill, for example: ghastKills.

From here, you have a command block circuit spamming the following two commands in sequential order:

give @a[score_ghastKills_min=1] gold_nugget 1

The second command:

scoreboard players reset @a ghastKills

Let me know if anything is unclear. Hope I helped.
1
Sylastia
05/22/2016 8:03 pm
Level 5 : Apprentice Miner
To sum it up I just basically need to know how to give a player a golden nugget once they have killed a ghast.
1

Welcome