diff --git a/sdk%2Fjs%2Fplayer%2Fquery.md b/sdk%2Fjs%2Fplayer%2Fquery.md index 7a90501..c2ebf88 100644 --- a/sdk%2Fjs%2Fplayer%2Fquery.md +++ b/sdk%2Fjs%2Fplayer%2Fquery.md @@ -5,6 +5,12 @@ import { CachedPlayer } from "restfulmc-lib"; import { getPlayer } from "restfulmc-lib"; -const player: CachedPlayer = await getPlayer("Username or UUID"); -console.log(`Hello ${player.username}, your UUID is ${player.uniqueId}!`); +try { + const player: CachedPlayer = await getPlayer("Rainnny"); + console.log(`Hello ${player.username}, your UUID is ${player.uniqueId}!`); +} catch (err) { + if ((err as ErrorResponse).code == 404) { + console.error("Player with UUID or username not found."); + } +} ``` \ No newline at end of file