Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kokiriglade/mcchampionship
Minecraft Championship Event API Wrapper
https://github.com/kokiriglade/mcchampionship
event mc-championship mcc mcchampionship minecraft
Last synced: 9 days ago
JSON representation
Minecraft Championship Event API Wrapper
- Host: GitHub
- URL: https://github.com/kokiriglade/mcchampionship
- Owner: kokiriglade
- Created: 2023-10-20T22:28:39.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-24T11:31:24.000Z (about 1 year ago)
- Last Synced: 2024-12-21T13:05:39.752Z (15 days ago)
- Topics: event, mc-championship, mcc, mcchampionship, minecraft
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/mcchampionship
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# mcchampionship
MCC [API v1(.3.2)](https://api.mcchampionship.com/docs#/v1) wrapper with no runtime dependencies. Built with [Bun](https://bun.sh).
Runs on Node.js v18+.
## Examples
```js
import { v1 } from 'mcchampionship';// Get the current event cycle's information
// https://api.mcchampionship.com/docs#/v1/AppController_getEventInformation
v1.getCurrentEventCycle().then((event) => {
console.log(`the next event (${event.data.event}) starts at ${event.data.date}, here's the update video: ${event.data.updateVideo}`);
});// Get the rundown of the most recent event
// https://api.mcchampionship.com/docs#/v1/AppController_getRundown
v1.getRecentEventRundown().then((rundown) => {
console.log(`the creators in aqua team for the most recent event were ${rundown.data.creators.AQUA.join(", ")}`);
});// Get the rundown of an event. Updates at the end of each event
// https://api.mcchampionship.com/docs#/v1/AppController_getEventRundown
v1.getEventRundown("1").then((rundown) => {
console.log(`JackSucksAtMC's score in MCC1 was ${rundown.data.individualScores["JackSucksAtMC"]}`);
});// Get a list of all participants in this event cycle
// https://api.mcchampionship.com/docs#/v1/AppController_getParticipants
v1.getParticipants().then((participants) => {
let totalParticipants = 0;
Object.keys(participants.data).forEach((team) => {
totalParticipants += participants.data[team].length;
});
console.log(`there are ${totalParticipants} participants in this event cycle (including spectators)`);
});// Get a list of all participants in the given team in this event cycle
// https://api.mcchampionship.com/docs#/v1/AppController_getParticipantsByTeam
v1.getParticipantsOfTeam(v1.Team.AQUA).then((participants) => {
console.log(`the participants in the aqua team are ${participants.data.map((participant) => participant.username).join(", ")}`);
});// (Deprecated) Get the entire Legacy Hall of Fame
// https://api.mcchampionship.com/docs#/%5BDeprecated%5D%20v1/AppController_getHallOfFame
v1.getHallOfFame().then((hallOfFame) => {
// do something with the hall of fame data
});// (Deprecated) Get all statistics in the legacy Hall of Fame for the given game
// https://api.mcchampionship.com/docs#/%5BDeprecated%5D%20v1/AppController_getHallOfFameByGame
v1.getHallOfFameGame(v1.HOFGame.MG_ACE_RACE).then((game) => {
// do something with the game data
});
```## Development
1. Install [Bun](https://bun.sh)
2. Install dependencies:```bash
bun install
```To run tests:
```bash
bun test
```