Add more player stat fields
processPlayerData handles modifying the player object from Hypixel API to the wanted format.
The game specific objects are created using the functions processStats object. You can assign default values by adding an equal sign in object parameters e.g. coins = 0 defaults the coins value to 0. The return statement return the stats object for the minigame. If (and when) some field's name needs to be changed, it can be achieved as described below:
return {
kills: coins,
}
This would return the coins field with the name kills.
For an example adding kills and deaths fields to Warlords, processors/games/Battleground.js file should be modified in the following way:
module.exports = ({
// This part destructs the values from the game object returned by the Hypixel API
coins = 0,
kills = 0,
deaths = 0,
}) => ({
coins,
kills,
deaths,
});
Example (TKR stats)
Resources for stats to be added:
Progress:
- [x] Arena
- [x] Blitz
- [x] Turbo Kart racers
- [x] Paintball
- [x] Quake
- [x] Arcade - Missing advanced Zombies stats
- [ ] Warlords
- [x] Bedwars
- [x] Build Battle
- [x] Duels
- [x] Cops and Crims
- [ ] Murder Mystery
- [ ] SkyClash
- [x] SkyWars
- [x] Speed UHC
- [x] Smash Heroes - Partial progress
- [ ] TNT Games
- [ ] Crazy Walls
- [x] UHC
- [x] VampireZ
- [x] Walls
- [ ] MegaWalls
- [x] The Pit
- [x] SkyBlock - Partial progress
Working on Warlords.
More skywars stats added in #679