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.
- package/package.json +1 -1
- package/src/player.ts +5 -0
package/package.json
CHANGED
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
|
}
|