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.
In 1.8.8, the only way to get a skeleton to attack another skeleton is to manipulate their targets using custom UUIDs (Universally Unique Identifier), along with the ownerName
tag on particular projectile entities, namely Snowball
and ThrownPotion
.
Please be aware that you should not create multiple entities with the same UUID, as they are meant to be unique. In 1.8, you will run into targeting issues, while in 1.9 entities with duplicate UUIDs will be deleted when loading the chunk.
Targeting
As an example, the two skeletons to summon, each with a UUID:
1.8:
/summon Skeleton ~ ~1 ~ {UUIDLeast:1l,UUIDMost:1l,CustomName:"A",Equipment:[{id:"minecraft:bow"}]}
/summon Skeleton ~ ~1 ~ {UUIDLeast:2l,UUIDMost:2l,CustomName:"B",Equipment:[{id:"minecraft:bow"}]}
1.9:
/summon Skeleton ~ ~1 ~ {UUIDLeast:1l,UUIDMost:1l,CustomName:"A",HandItems:[{id:"minecraft:bow"}]}
/summon Skeleton ~ ~1 ~ {UUIDLeast:2l,UUIDMost:2l,CustomName:"B",HandItems:[{id:"minecraft:bow"}]}
When a projectile that uses the ownerName
tag strikes a mob, that mob will target the entity that has the UUID specified in that tag. For example, the following will cause skeleton A to attack skeleton B, because it assumes that skeleton B has thrown the snowball:
/execute @e[type=Skeleton,name=A] ~ ~ ~ summon Snowball ~ ~4 ~ {Motion:[0.0,-1.0,0.0],ownerName:"00000000-0000-0002-0000-000000000002"}
And likewise, the following causes B to attack A:
/execute @e[type=Skeleton,name=B] ~ ~ ~ summon Snowball ~ ~4 ~ {Motion:[0.0,-1.0,0.0],ownerName:"00000000-0000-0001-0000-000000000001"}
In 1.9, you can cause one mob to ride another, and the "rider" will take control of movement. However, the rider is the one that attacks. If a zombie is riding a skeleton, the zombie will make the skeleton move into melee range and the zombie itself will attack, meaning ranged battle is not possible with that method.
Just as an example, the following will cause the skeleton to move into melee attack range of villagers in 1.9:
/summon Skeleton ~ ~1 ~ {Passengers:[{id:"Zombie"}]}
Detecting Death
No target selector can target dead/dying mobs, nor will automatically-incrementing objective-types (such as deathCount
) track mobs. There are some workarounds to this, the easiest of which is testing for the mere existence of the mob and inverting the signal.
The following would simply test for the mob's existence, while you would invert the signal. If the mob was found, the signal will be off. If the mob dies, it will no longer be found and the signal is on:
/testfor @e[type=Skeleton,name=A]
/tellraw @a ["Skeleton A won!"]
/testfor @e[type=Skeleton,name=B]
/tellraw @a ["Skeleton B won!"]
Note that if you unload chunk that the skeleton is at while the mechanism is still loaded, the command block will return false since it cannot find the skeleton.
Best Answer
Based on the the information you've provided, you should be able to
/summon
the skeletons or use the/entitiydata
command and addTeam:"(team2)"
to their attributes. The skeletons don't attack players on the same team as them, so they'd only attack people on team 1 (assuming you only have 2 teams, this should work fine).