I'm working on creating a scenario in which there are two factions, attackers and defenders.
Picture it like a "capture the flag", during which players from either side kill those of the other and earn points for doing so.
Those points are to be measured collectively for the team, not for every individual player.
My issue arises when I attempt to setdisplay the teams' killcounts.
Currently, my commandblocks are set up as follows:
#1: /scoreboard objectives add playerKills playerKillCount "Kill"
#2: /scoreboard objectives add KillsbyDefenders dummy "Kills"
#3: /scoreboard objectives add KillsbyAttackers dummy "Kills"
#4: /scoreboard objectives setdisplay sidebar.team.gold KillsbyDefenders
#5: /scoreboard objectives setdisplay sidebar.team.dark_red KillsbyAttackers
#6: /scoreboard players operation @a[team=Defenders] KillsbyDefenders= @a[team=Defenders] playerKills
#7: /scoreboard players operation @a[team=Attacker] KillsbyAttackers = @a[team=Attackers] playerKills
*The team colours are correct.
Although the individual players (i.e. teams) are displayed, the objective does not get any values added to it.
I manually tested this by overriding both objectives (KillsbyDefenders & KillsbyAttackers) and it worked.
When leaving it to the mechanism however, it does not.
I have found some discussions on the topic, but they were mostly outdated and did not help me in solving this.
I'd be very grateful for any help in this matter.