0

I am making a capture the point map in minecraft in which two teams are capturing points. I intended a capture point that switches color every time a redstone pulse is supplied. now i have a problem with the capturing logic. because if the capture point is from team blue and a team blue player would capture it, it would turn to red and vice versa

I need to set up a score board variable that is not displayed in the sidebar. the variable should be called something like "CaptureTeam". the variable is used to indicate which team has captured the point. CaptureTeam = 1 >> blue, CaptureTeam = 0 >> red.

then I need to test the variable every 2 ticks (using a simple clock and a testfor I figured).

I would like to have 10 capture points. at the start I would like to be able to reset them to a specific team. 5 for team red and 5 for team blue.

I already have the redstone set up because I'm pretty good at that, it's just that command blocks are so situation specific(for every situation there are different commands) that I could not realy find anything on the internet.

can anybody help me with the commands for this?

  1. setting up the scoreboard

  2. changing the variable to 1 or 0

  3. testing the state of the variable

  • What have you tried to solve this yourself? Just giving us a list of requirements makes it feel like you're using us as a coding on demand service. – Frank Dec 17 '14 at 19:55
  • @frank I'm sorry, I already have set up the whole redstone circuit around it and i lookd like 2 minutes on the internet. you know there is a problem with this site, the responses are to fast and to good to go look somewhere else on the internet other than on SE :) – codermaster Dec 17 '14 at 20:11
  • The responses are so good because we have a minimum level of quality we expect. Experts stick around because we can enforce those standards. If you have something to show for what you've done, I'd recommend adding it in; the more effort you show, the more effort you'll get. It's a win-win for everyone. – Frank Dec 17 '14 at 20:15
  • you mean like this? – codermaster Dec 17 '14 at 20:21
  • That's not really effort for the part you're trying to work on. That's taking your idea as far as you're comfortable, and then leaving the rest to someone else. The trick is to try to figure out your idea first. Try some commands. See what works, see what doesn't. Put that in your question. It's not really a problem if you haven't actually gotten stuck trying to figure it out. – Frank Dec 17 '14 at 20:32
1

First, create the dummy objective:

/scoreboard objectives add CaptureTeam dummy

You can then set a fake player's score on this objective to 1 or 0, one player per capture point. This is also what you should do to reset and change them:

/scoreboard players set CP1 CaptureTeam 1
/scoreboard players set CP2 CaptureTeam 1
...
/scoreboard players set CP10 CaptureTeam 0

For example, to change the score of capture point 6 to blue, you would run:

/scoreboard players set CP6 CaptureTeam 1

Because these aren't real players, /testfor won't work. You should instead use this:

/scoreboard players test CP1 CaptureTeam 1 1

Which would test for if CP1 was blue controlled, and similarly this:

/scoreboard players test CP1 CaptureTeam 0 0

To test if it was red controlled.

  • okey, can you tel me real quick how to display all objects in the scoreboard sidethingy so i can use it for debug mode, also turning it back of would be great if you could tell me!! – codermaster Dec 17 '14 at 20:31
  • @codermaster /scoreboard objectives setdisplay sidebar CaptureTeam to display it in the sidebar. I'm not sure what you mean by "turning it back of" means, what would be the intended end result? – SirBenet Dec 17 '14 at 20:32
  • so it stops showing it on the side :) sorry if you don't understand, i'm not a native english speaker – codermaster Dec 17 '14 at 20:33
  • also after running the command the sidebar does not show up – codermaster Dec 17 '14 at 20:34
  • /scoreboard objectives setdisplay sidebar will remove it from the sidebar. It will not display until you set some scores (nothing to display if it's empty). – SirBenet Dec 17 '14 at 20:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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