-
-
Notifications
You must be signed in to change notification settings - Fork 939
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create README.md * Create chest_confirm.md * Create accept_texturepack.md
- Loading branch information
Showing
3 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Advanced examples | ||
|
||
These are examples that have a very specific use-case, and most people won't need. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Accept server's texturepack | ||
|
||
This code snippet tells the server that the client accepted a custom texture pack when the server sends a texture pack | ||
|
||
```js | ||
bot._client.on('resource_pack_send', (data) => { | ||
bot._client.write('resource_pack_receive', { | ||
result: 3 | ||
}) | ||
bot._client.write('resource_pack_receive', { | ||
result: 0 | ||
}) | ||
}) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Menual Chest Confirm | ||
|
||
This code snippet will tell the bot not to wait for chest confirmations that some spigot plugins will not send | ||
|
||
```js | ||
bot.on('windowOpen', async (window) => { | ||
window.requiresConfirmation = false // fix | ||
await bot.clickWindow(13, 0, 0) | ||
console.log(bot._events) // without the fix this code is unreachable, the promise never resolve | ||
}) | ||
bot.on('windowClose', () => { | ||
console.log(bot._events) // without the fix there is a confirmTransaction1 listener that is never removed | ||
}) | ||
``` |