Minecraft Vanilla Team Logic

So I have a Purpur server, and I need to know if it's possible to do the following: When a player dies on Alive team: - /team leave <player> - /team join Dead <player> When a player dies on Playing team: They respawn at playing team spawnpoint. This would be using Minecraft's team system. And I can add in any plugins if needed.
12 Replies
Admincraft Meta
Thanks for asking your question!
Make sure to provide as much helpful information as possible such as logs/what you tried and what your exact issue is
Make sure to mark solved when issue is solved!!!
/close !close !solved !answered
Requested by kingordinary#0
Kingaling
KingalingOP2y ago
This probably isn't important, but we are doing this for a Dead, Alive, and Playing scoreboard. So we typed out all the logic on a google doc before I put anything in game to make it easier. So below is all the logic we've written out so far, but again its prob not important but it gives a better understanding of what we are doing ig: When player joined server: - /team leave <player> - /team join Dead <player> When a player dies on Alive team: - /team leave <player> - /team join Dead <player> When a player dies on Playing team: They respawn at team spawnpoint. Custom command: /event revive (selector) - /team leave (selector) - /team join Alive (selector) Custom command: /event alive (selector) (radius) - /team leave (selector)[distance=..(radius)] - /team join Alive (selector)[distance=..(radius)] Custom command: /event playing (selector) (radius) - /team leave (selector)[distance=..(radius)] - /team join playing (selector)[distance=..(radius)] Custom command: /event playing spawnpoint - /spawnpoint @a[team=Playing] (selector) Custom command: /event dead spawnpoint - /spawnpoint @a[team=Dead] (selector)
snowznz.bak
snowznz.bak2y ago
So you want certain command ran when players die depending on their team? @Kingaling
@EventHandler
public void onPlayerDeath(PlayerDeathEvent event) {
Player player = (Player) event.getEntity();
Scoreboard scoreboard = player.getScoreboard();
Team team = scoreboard.getEntryTeam(player.getName());

if (team.getName().equals("Alive") {
// Do stuff here
}
}
@EventHandler
public void onPlayerDeath(PlayerDeathEvent event) {
Player player = (Player) event.getEntity();
Scoreboard scoreboard = player.getScoreboard();
Team team = scoreboard.getEntryTeam(player.getName());

if (team.getName().equals("Alive") {
// Do stuff here
}
}
Kingaling
KingalingOP2y ago
Yes! So when a player dies, and they are on the "Playing" team, they'd simply spawn aat their spawnpoint. But if they die and are on the Alive team, 2 commands would be run to force them to leave all other teams and join the "Dead" team Is it possible to get this done using an already existing plugin? Like skript or smth? Or?
snowznz.bak
snowznz.bak2y ago
Just use skript on death: execute command “”
Kingaling
KingalingOP2y ago
can u detect if a player is on a certain team on skript?
snowznz.bak
snowznz.bak2y ago
Not sure
Kingaling
KingalingOP2y ago
alr I looked through the docs and couldn't find anything, I also asked in the Skript disc so ig I'll see if not I can j get my friend to implement this into a plugin
snowznz.bak
snowznz.bak2y ago
A plug-in is probably better If your friend can’t let me know and I’ll whips up something for you
Kingaling
KingalingOP2y ago
My friend was able to create this! But i've ran into another problem. It seems as tho whenever the server restarts, it seems like empty teams get removed. Is it possible to force the teams to not get removed upon restart? Or maybe a way to delete and recreate the teams everytime the server restarts?
Admincraft Meta
For safety reasons we do not allow executables to be sent as they might contain malware. If you're compiling for someone please DM them and as a reminder. We cannot verify if a compiled jar has not been tampered in any way
Kingaling
KingalingOP2y ago
oop

Did you find this page helpful?