1
Need some command block help...
Here is what i'm trying to do:
I want to give a player points (dummy scoreboard) based on what mob was killed (ex: Zombie=1). I also want to create a shop which uses this scoreboard to do stuff like give an item or spawn a monster by using that scoreboard as currency, as well as increasing a mob's hp when spawning it with a command block.
This is a lot to ask for so one person will probably not know how to do everything here. Any help is appreciated!
I want to give a player points (dummy scoreboard) based on what mob was killed (ex: Zombie=1). I also want to create a shop which uses this scoreboard to do stuff like give an item or spawn a monster by using that scoreboard as currency, as well as increasing a mob's hp when spawning it with a command block.
This is a lot to ask for so one person will probably not know how to do everything here. Any help is appreciated!
4
- EDIT -
Have a better idea for multiplayer, although:
No scoreboard display just for now
But:
No requirement for real-time tracking and operating the scoreboards
Here's what it is:
We've got counts for Zombies, Skeletons and Creepers killed. Each incremented automatically by default.
The shop functions similarly, by giving players items that require some amount of specific entities killed, after that their score is decremented by the cost of the item.
Which items, how many, and everything else is for you to decide.
Have a better idea for multiplayer, although:
No scoreboard display just for now
But:
No requirement for real-time tracking and operating the scoreboards
Here's what it is:
* Global Objectives:
scoreboard objectives add eGetPlayerKill_Z stat.killEntity.Zombie
scoreboard objectives add eGetPlayerKill_C stat.killEntity.Creeper
scoreboard objectives add eGetPlayerKill_S stat.killEntity.Skeleton
* Shop:
@@ZOMBIESHOP
execute @p[r=4,score_eGetPlayerKill_Z_min=minScoreValue] ~ ~ ~ give @p itemName itemCount itemData dataTag
scoreboard players remove @p eGetPlayerKill_Z itemCost
@@CREEPERSHOP
execute @p[r=4,score_eGetPlayerKill_C_min=minScoreValue] ~ ~ ~ give @p itemName itemCount itemData dataTag
scoreboard players remove @p eGetPlayerKill_C itemCost
@@SKELETONSHOP
execute @p[r=4,score_eGetPlayerKill_S_min=minScoreValue] ~ ~ ~ give @p itemName itemCount itemData dataTag
scoreboard players remove @p eGetPlayerKill_S itemCost
We've got counts for Zombies, Skeletons and Creepers killed. Each incremented automatically by default.
The shop functions similarly, by giving players items that require some amount of specific entities killed, after that their score is decremented by the cost of the item.
Which items, how many, and everything else is for you to decide.
Thanks! This will definitely help!
Hi there!
I just looked into your idea, and I quickly came up with a simple solution to the first part. It may not be the best if you're making a multiplayer game, but for singleplayer it will work just fine. I can also look into the shop idea if you'd like.
First make 2 scoreboard objectives, one for your dummy objective (I called mine CreepScore) and one for tracking the mobkills (ZombiesKilled of type stat.killEntity.Zombie).
The setup is 3 command blocks per mob you want to track, so 3 for zombies, 3 for creepers, etc. I use an arrow (-->) to indicate command blocks pointing into other command blocks.
Repeating, Unconditional, Always Active --> Chain, Conditional, Always Active --> Chain, Conditional, Always Active.
Commands:
Repeating:
This tests for the nearest one player who killed a zombie.
First Chain:
This adds points to the dummy objective "CreepScore".
Second Chain:
This removes 1 from the ZombiesKilled objective. The next time they kill a zombie, they'll get more points. I had to make an edit as my last command didn't account for killing multiple zombies at one time.
To keep going for other mobs, you can just make more objectives of type stat.killEntity.[Whatever Entity You Want] and then change the points added to CreepScore on the second command block.
I just looked into your idea, and I quickly came up with a simple solution to the first part. It may not be the best if you're making a multiplayer game, but for singleplayer it will work just fine. I can also look into the shop idea if you'd like.
First make 2 scoreboard objectives, one for your dummy objective (I called mine CreepScore) and one for tracking the mobkills (ZombiesKilled of type stat.killEntity.Zombie).
/scoreboard objectives add CreepScore dummy/scoreboard objectives add ZombiesKilled stat.killEntity.ZombieThe setup is 3 command blocks per mob you want to track, so 3 for zombies, 3 for creepers, etc. I use an arrow (-->) to indicate command blocks pointing into other command blocks.
Repeating, Unconditional, Always Active --> Chain, Conditional, Always Active --> Chain, Conditional, Always Active.
Commands:
Repeating:
testfor @p[score_ZombiesKilled_min=1,c=1]This tests for the nearest one player who killed a zombie.
First Chain:
/scoreboard players add @p[score_ZombiesKilled_min=1,c=1] CreepScore 1This adds points to the dummy objective "CreepScore".
Second Chain:
/scoreboard players remove @p[score_ZombiesKilled_min=1,c=1] ZombiesKilled 1This removes 1 from the ZombiesKilled objective. The next time they kill a zombie, they'll get more points. I had to make an edit as my last command didn't account for killing multiple zombies at one time.
To keep going for other mobs, you can just make more objectives of type stat.killEntity.[Whatever Entity You Want] and then change the points added to CreepScore on the second command block.
