update readme
Some checks failed
Publish Package / build (push) Has been cancelled

This commit is contained in:
Lee 2024-04-15 09:02:07 +01:00
parent 516c3a373d
commit dcf147167d
2 changed files with 22 additions and 3 deletions

View File

@ -2,6 +2,11 @@ name: Publish Package
on:
push:
branches: [master]
paths-ignore:
- .gitignore
- README.md
- LICENSE
jobs:
build:
runs-on: ubuntu-latest

View File

@ -10,11 +10,25 @@ Install the package using npm:
npm install mcutils-library
```
Fetch data from a player:
Get player:
```javascript
import mcUtils from "mcutils-library";
import { getPlayer } from "mcutils-library";
const cachedPlayer = await getPlayer(playerId);
const { player } = cachedPlayer;
const { player } = await mcUtils.player.getPlayer("Notch");
console.log(player);
```
Get Server:
```javascript
import { getServer } from "mcutils-library";
import JavaMinecraftServer from "mcutils-library/dist/types/server/javaServer";
const cachedServer = await getServer(ServerPlatform.Java, "hypixel.net");
const { server } = cachedServer;
console.log(server);
```