You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I've checked mineflayer, it's has a method bot.sleep using activateBlock to perform sleep action. But how to achieve this in bedrock?
I've check there is a datatype called Action which indicates that 5 is the action of sleeping, But when I used client.queue('player_action', {action: 5, runtime_entity_id: client.uuid, position:0, face: 0}) it goes wrong:
/mc/node_modules/protodef/src/compiler.js:99
throw e
^
TypeError: SizeOf error for undefined : Cannot read properties of undefined (reading 'valueOf')
at Object.sizeOfVarLong [as varint64] (/mc/node_modules/bedrock-protocol/src/datatypes/varlong.js:2:20)
at Object.packet_player_action (eval at compile (/mc/node_modules/protodef/src/compiler.js:258:12), <anonymous>:2466:29)
at eval (eval at compile (/mc/node_modules/protodef/src/compiler.js:258:12), <anonymous>:1686:66)
at mcpe_packet (eval at compile (/mc/node_modules/protodef/src/compiler.js:258:12), <anonymous>:1822:9)
at CompiledProtodef.sizeOf (/mc/node_modules/protodef/src/compiler.js:89:14)
at e.message (/mc/node_modules/protodef/src/compiler.js:96:40)
at tryCatch (/mc/node_modules/protodef/src/utils.js:50:16)
at CompiledProtodef.createPacketBuffer (/mc/node_modules/protodef/src/compiler.js:96:20)
at Serializer.createPacketBuffer (/mc/node_modules/protodef/src/serializer.js:12:23)
at Client.queue (/mc/node_modules/bedrock-protocol/src/connection.js:77:36)
If you could help me to solve this problem I will be appreciate. :)
The text was updated successfully, but these errors were encountered:
laikee99
changed the title
How to perform a "sleeping" action?
How to perform a "sleep" action?
Dec 8, 2021
please see https://github.com/PrismarineJS/bedrock-protocol/wiki/Using-bedrock-protocol, this is a protocol library and connects as a normal client does. Sending the correct packets to do the action you want is up to you, you can use the proxy example to see how something is done vanilla and then replicate it.
mineflayer for high level support is tracked in #116
Hi, I've checked mineflayer, it's has a method
bot.sleep
usingactivateBlock
to perform sleep action. But how to achieve this in bedrock?I've check there is a datatype called
Action
which indicates that5
is the action of sleeping, But when I usedclient.queue('player_action', {action: 5, runtime_entity_id: client.uuid, position:0, face: 0})
it goes wrong:If you could help me to solve this problem I will be appreciate. :)
The text was updated successfully, but these errors were encountered: