diff --git a/.gitea/workflows/publish.yml b/.gitea/workflows/publish.yml index 942fa4b..888ee51 100644 --- a/.gitea/workflows/publish.yml +++ b/.gitea/workflows/publish.yml @@ -2,6 +2,11 @@ name: Publish Package on: push: branches: [master] + paths-ignore: + - .gitignore + - README.md + - LICENSE + jobs: build: runs-on: ubuntu-latest diff --git a/README.md b/README.md index 23b6ba2..2d5afe3 100644 --- a/README.md +++ b/README.md @@ -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); +```