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,
});
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:This would return the
coins
field with the namekills
.For an example adding kills and deaths fields to Warlords,
processors/games/Battleground.js
file should be modified in the following way:Example (TKR stats)
Resources for stats to be added:
Progress: