I'm working on a vanilla minigame map for an event this weekend. I have the mechanics, map, and so on figured out, however things are still quite buggy.
- There's an infinite loop running that checks if team 'Players' is empty. It has an infinite repeater loop powering a command block that does /scoreboard teams list Players. The loop is checked by a comparator with a repeater immediately after, which leads into a redstone torch inverter that powers command blocks. tl;dr: if team Players is empty, it should run some commands.
- If team Players is empty, the game sets the spawnpoint to the lobby, clears all inventories, teleports all players to said hub, announces that the Players lost the game
- While the game is running, the spawnpoint is inside a small tube with a pressure plate that runs some commands. Respawning players trigger that plate.
- The aforementioned pressure plate is relatively close (~10b) to the infinite loop, and its redstone circuitry runs closer. There might be a chance that currents are being carried over.
- When a player dies, the pressure plate first triggers a command block that checks if they were members of the team 'X'. If so, it runs through a comparator and repeater and runs game-end events similar to those that happen when the Players team is empty. It also removes them from their team.
- Regardless of team, the pressure plate will broadcast a death message and teleport the player to a separate wait room.
- Currently, the game triggers BOTH game-ending events when any player dies, regardless of whether that player was the 'last' player or the member of team X.
If you need anything more or would like to see the redstone itself, PM me and I'll send you either the world file or an invitation to the Realm it's hosted on.
Moving on to another bug, I need a command block to check whether a player is a member of a certain team, and only output a signal if they are. (/testfor @p[team=TEAM] does not work.) How might this be done?
I wish. It triggers a TON of things, and I'm really crunched for time rn, so I'd like to know what command would work to test if the player was a member of team TEAM. If not it must not output signal. xP
I am using comparators, yes. However the issue w/ changing simply the target of the /testfor is that I need it to check if the player who triggered the command was a member of TEAM, not if there are any players in TEAM.
Assuming your IGN is the same as your forum tag, I've added you to the Realm it's hosted on. Hopefully we can meet up there. =P