I'm making a PvP server with player classes and money, and I want to award players money based on the class of the player they killed. (Both are scores.)
Minecraft – Change score based on score of killed player
minecraft-commandsminecraft-java-edition
Best Answer
Note: this only works by using colored nametags and teams. If you cannot allow those, or are already using them, this solution will not work
These examples use two classes, but they are rather tesselable:
Create the teams:
Create the scoreboard variables:
At the end of the game, run these commands in order to update the money: