yeow-api 0.2.50 → 0.2.52

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yeow-api",
3
- "version": "0.2.50",
3
+ "version": "0.2.52",
4
4
  "description": "Yeow API",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
package/src/item.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export interface ItemStack {
2
2
  type: string;
3
- amount: number;
3
+ amount?: number;
4
4
  meta?: {
5
5
  displayName?: string;
6
6
  lore?: string[];
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
  }