yeow-api 0.2.50 → 0.2.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/player.ts +5 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yeow-api",
3
- "version": "0.2.50",
3
+ "version": "0.2.51",
4
4
  "description": "Yeow API",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
package/src/player.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { call, post } from './task.js';
2
2
  import { Location, LocationData } from './location.js';
3
+ import type { ItemStack } from './item.js';
3
4
 
4
5
  interface PlayerData {
5
6
  uuid: string;
@@ -132,4 +133,8 @@ export class Player {
132
133
  sendResourcePack(url: string, hash?: string, prompt?: string, force?: boolean): Promise<void> {
133
134
  return post('player.sendResourcePack', { uuid: this.uuid, url, hash, prompt, force });
134
135
  }
136
+ getItemInMainHand(): Promise<ItemStack | null> { return post<ItemStack | null>('player.getItemInMainHand', { uuid: this.uuid }); }
137
+ getItemInMainHandSync(): ItemStack | null { return call<ItemStack | null>('player.getItemInMainHand', { uuid: this.uuid }); }
138
+ getItemInOffHand(): Promise<ItemStack | null> { return post<ItemStack | null>('player.getItemInOffHand', { uuid: this.uuid }); }
139
+ getItemInOffHandSync(): ItemStack | null { return call<ItemStack | null>('player.getItemInOffHand', { uuid: this.uuid }); }
135
140
  }