Open piousdeer opened 6 years ago
have you tried it on vanilla?
you can also try this as a workaround
bot._client.write('update_sign', {
location: block.position,
text1: "Line",
text2: "Line",
text3: "Line",
text4: "Line",
})
https://github.com/PrismarineJS/mineflayer/blob/master/lib/plugins/blocks.js#L289-L295
vanilla requires text to be json indeed
I just tested that in vanilla 1.12.2 and got exactly the same behavior. The workaround works fine, though
ok we can just send string for version >= 1.9 then
mineflayer v2.7.2 (using 1.12.2, also can be reproduced with 1.8) playing on mc.randomcraft.ru (Spigot server, supports 1.8 to 1.13)
bot.updateSign(sign, 'Text')
throws an error:NodeError: Serialization error for play.toServer.update_sign.text2 : SizeOf error for params.update_sign.text2 : The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type undefined
bot.updateSign(sign, 'Line\nLine\nLine\nLine')
updates the sign, but adds unwanted quotes around the lines: