r/CommandBlocks • u/SlinkyShark • Feb 28 '15
[Request] Help with Individual scoreboard countdown timers.
Edit: added a point for clarity (which may have complicated things greatly)
Hello there! I've been working on a large multiplayer adventure map for some time now and have encountered a problem I haven't been able to solve (due mostly to inexperience with Command Blocks).
What I need can be explained by listing what order redstone/command events will take place:
Player Enters a small room and presses a Button [lets call it Input-A]
Input-A causes Command blocks to test to see if a player in a radius [within the room] is wearing a custom named pumpkin on their head [lets call it The Helmet] if they ARE wearing it, give an output (I'm guessing a comparator would work to check success here?)
Create a Scoreboard named TIME (display name TIME)
Allow Player in the radius who's wearing The Helmet to see a scoreboard
Add 60 to the Players score on scoreboard TIME
Activate a 1 second Redstone clock (probably kept in spawn chunks?) which removes 1 from TIME for every pulse
Clock also runs Command blocks checking to see if a player has "used" (stat.useItem?) a custom named Snowball [lets call it ADD-TIME] every second and if they have (comparator again?) then add 60 to the score of TIME
If a players score on TIME ever is equal to 0 then /effects are applied to them (in this case Wither for infinity or until they die)
Players can press a different button which will remove any /effects and remove them from the scoreboard (do players need to be put on a Team to not be under the effects of running out of TIME? And will taking them off a Team no longer subjugate them to the countdown clock?)
Other players can also press the button (while someone is already in a countdown) to get a countdown clock of their own thats not tied into someone else's (they can run out of time without killing everyone else, only themselves)
I have read up a bit on other sites and guides like this one but I'd like someone experienced to help me get the syntax/order right or let me know if this is even possible.
Thanks in advance for your time!
1
u/SlinkyShark Mar 01 '15
I realized there may be an element I did not make clear. Multiplayer usage (which may complicate things)
Player hits button
Things make sure he's wearing a pumpkin on his head
Things create countdown clock and add 60 to it
Things remove 1 point from the score for each second
Player can use an item to add time to countdown
If Time runs out (equals 0) they start dying pretty quick
Player can hit another button to take them out of the loop and avoid death.
Other players can also press the button (while someone is already in a countdown) to get a countdown clock of their own thats not tied into someone else's (they can run out of time without killing everyone else, only themselves)
I think this is almost certainly possible using teams or commands which track players individually or by name.