This commit is contained in:
parent
3e020337e3
commit
cbb534adf4
@ -13,10 +13,9 @@ npm install mcutils-library
|
|||||||
Get player:
|
Get player:
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
import { getPlayer } from "mcutils-library";
|
import { getPlayer, CachedPlayer } from "mcutils-library";
|
||||||
|
|
||||||
const cachedPlayer = await getPlayer(playerId);
|
const cachedPlayer = await getPlayer(playerId);
|
||||||
const { player } = cachedPlayer;
|
|
||||||
|
|
||||||
console.log(player);
|
console.log(player);
|
||||||
```
|
```
|
||||||
@ -24,11 +23,9 @@ console.log(player);
|
|||||||
Get Server:
|
Get Server:
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
import { getServer } from "mcutils-library";
|
import { getServer, CachedJavaMinecraftServer } from "mcutils-library";
|
||||||
import JavaMinecraftServer from "mcutils-library/dist/types/server/javaServer";
|
|
||||||
|
|
||||||
const cachedServer = await getServer(ServerPlatform.Java, "hypixel.net");
|
const cachedServer = await getServer(ServerPlatform.Java, "hypixel.net");
|
||||||
const { server } = cachedServer;
|
|
||||||
|
|
||||||
console.log(server);
|
console.log(server);
|
||||||
```
|
```
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
/**
|
||||||
|
* The base URL for the API.
|
||||||
|
*/
|
||||||
export const API_ENDPOINT = "https://api.mcutils.xyz";
|
export const API_ENDPOINT = "https://api.mcutils.xyz";
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
|
Loading…
Reference in New Issue
Block a user