Javascript-Library/README.md

32 lines
546 B
Markdown
Raw Normal View History

2024-04-14 20:14:42 +00:00
# Minecraft Utilities - Javascript Library
2024-04-14 20:11:04 +00:00
2024-04-14 20:14:42 +00:00
The JavaScript library for the Minecraft Utilities API.
## Usage
Install the package using npm:
```bash
npm install mcutils-library
```
2024-04-15 08:02:07 +00:00
Get player:
2024-04-14 20:14:42 +00:00
```javascript
2024-04-17 16:51:39 +00:00
import { getPlayer, CachedPlayer } from "mcutils-library";
2024-04-15 08:02:07 +00:00
const cachedPlayer = await getPlayer(playerId);
2024-04-14 20:14:42 +00:00
console.log(player);
```
2024-04-15 08:02:07 +00:00
Get Server:
```javascript
2024-04-17 16:51:39 +00:00
import { getServer, CachedJavaMinecraftServer } from "mcutils-library";
2024-04-15 08:02:07 +00:00
const cachedServer = await getServer(ServerPlatform.Java, "hypixel.net");
console.log(server);
```