I'm making a PvP map where the goal is to be the first to get 10 kills. I'm new to scoreboards, and I'm having a few problems. First, is it possible to add all players a scoreboard? I'm doing /scoreboard players add @a but it will not work. Second, How do you set the sidebar display like people do on tutorials? Do you have to add players first before you can add the sidebar, or do you have to kill a player first (I'm doing playerKillCount). Lastly, how would you test for a player that has a certain amount of kills? Such as 15 so they could be teleported to the winner's area.
Edit: Sorry for confusing title, I can't change it now
So, im going to start with the 1st question. What you need to do is make players join a certain type of objective with the objective name. for example "scoreboard players add @a (name of objective)". Second question: to put up the sidebar do "scoreboard objective setdisplay sidebar (name of the objective)" third question: you have to set up the players to (insert name of objective here) before you set up the sidebar. I hope this helps.
You're measuring the amount of kills via scoreboard right? A suitable command would be /scoreboard objectives add Kills totalKillCount (This tracks how many TOTAL kills you have, including mobs) If you'd like to track only Player kills, do /scoreboard objectives add Kills playerKillCount
This will track how many Kills you have. To show the scoreboard, you can use /scoreboard players setDisplay sidebar Kills
(Note, you don't have to set it in the sidebar. You can use belowName or list.) What you do now is up to you.
Any player who gets a kill should automatically be added to the scoreboard, if you made the scoreboard first.
To testfor a player that has a certain amount of kills, you can use the /testfor command or simply use an arugment. You can have a rapid fire redstone signal that constantly checks for a player when they reach the specified number of kills, or have them activate it.
I personally like having a rapid fire redstone signal, so if you want this one, connect it to the rapid-fire signal, and use a command block that says
/tp @a[Kills=15,score_Kills_min=15] [X] [Y] [Z]
The tp command can teleport you to a pressure plate or something, which will activate whatever you want the ending to be.
Thanks for the help guys! It worked! But I have 1 more question. Is there any way to drink a potion instantly? Like just right clicking would apply the effect to you?
EDIT: At first I though it worked, but I discovered that the comparator was always on for some reason. It wouldn't turn off if I set the minimum kills to 3 and I only had 1. Is this a minecraft glitch or is there a way to fix the stuck comparator?
I need it so it can apply just to that person, so the (speed, whatever) effect would not affect anyone else. My question still stands: Is it possible to drink potions instantly in vanilla minecraft?
The Meaning of Life, the Universe, and Everything.
Join Date:
3/23/2014
Posts:
53
Member Details
You can use a command to give the potion.
/effect @a[score_SCORENAME_min=15] minecraft:EFFECTNAME [Seconds] [Amplifier] [hideParticles]
Seconds Being how long it will last.
Amplifier being Speed X2
Hide Particles, hiding the swirly potion effects.
I am making a very complex, Call of Duty Style Map myself. I will be releasing it soon! Stay tuned, if you have any questions you can message me and I'll try to answer them
Edit: Sorry for confusing title, I can't change it now
This will track how many Kills you have. To show the scoreboard, you can use /scoreboard players setDisplay sidebar Kills
(Note, you don't have to set it in the sidebar. You can use belowName or list.) What you do now is up to you.
Any player who gets a kill should automatically be added to the scoreboard, if you made the scoreboard first.
To testfor a player that has a certain amount of kills, you can use the /testfor command or simply use an arugment. You can have a rapid fire redstone signal that constantly checks for a player when they reach the specified number of kills, or have them activate it.
I personally like having a rapid fire redstone signal, so if you want this one, connect it to the rapid-fire signal, and use a command block that says
/tp @a[Kills=15,score_Kills_min=15] [X] [Y] [Z]
The tp command can teleport you to a pressure plate or something, which will activate whatever you want the ending to be.
Hope I helped
Check my Twitter here for absolutely nothing.
EDIT: At first I though it worked, but I discovered that the comparator was always on for some reason. It wouldn't turn off if I set the minimum kills to 3 and I only had 1. Is this a minecraft glitch or is there a way to fix the stuck comparator?
Instead of /testfor -> comparator -> command block
Use /execute @p[score_kills_min=15] ~ ~ ~ (command from the command block that had the comparator pointing at it.)
As for drinking pot ions instantly, what's wrong with splash pots?
I need to make sure the potion effect only goes to the user who activates it, so it can't be given or accidentally given to others
Sure, but if you gave the potion to someone, and it was a good potion, don't you think they would know better than to splash their enemies with it?
/effect @a[score_SCORENAME_min=15] minecraft:EFFECTNAME [Seconds] [Amplifier] [hideParticles]
Seconds Being how long it will last.
Amplifier being Speed X2
Hide Particles, hiding the swirly potion effects.
I am making a very complex, Call of Duty Style Map myself. I will be releasing it soon! Stay tuned, if you have any questions you can message me and I'll try to answer them
/scoreboard players set @e[type=Item] tileType 1 {Item:{id:"minecraft:potion",Damage:8201s,Count:1b}}Then execute at the item trying to give the nearest player that has just dropped an item the effects:Now let's take care of a few things: And wala, when the player drops a strength I potion they will receive strength I and slowness I for 60 seconds.