2024-04-20 02:04:42 +01:00
|
|
|
---
|
|
|
|
title: Javascript Library
|
2024-04-20 22:16:30 +01:00
|
|
|
summary: The Javascript library for Minecraft Utilities is a simple way to interact with the API using Javascript!
|
2024-04-20 02:04:42 +01:00
|
|
|
---
|
|
|
|
|
|
|
|
# Javascript Library
|
|
|
|
|
|
|
|
This is the Javascript library for Minecraft Utilities.
|
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
|
|
|
To use the Javascript library, you can run the following command:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
npm install mcutils-library
|
|
|
|
```
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
This is a simple example of how to use the Javascript library to get a player's information.
|
|
|
|
|
|
|
|
```javascript
|
|
|
|
import { getPlayer, CachedPlayer } from "mcutils-library";
|
|
|
|
|
2024-04-21 02:44:47 +01:00
|
|
|
const cachedPlayer: CachedPlayer = await getPlayer(playerId);
|
2024-04-20 02:04:42 +01:00
|
|
|
|
|
|
|
console.log(player);
|
|
|
|
```
|