Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • May 15 15:23
    andriycraft closed #999
  • May 15 14:06
    andriycraft opened #999
  • May 15 00:16
    Kashalls synchronize #998
  • May 14 23:26
    matthi4s synchronize #985
  • May 14 22:55
    rom1504 commented #993
  • May 14 22:51

    rom1504 on master

    allow false as beforePing callb… (compare)

  • May 14 22:51
    rom1504 closed #986
  • May 14 22:50
    rom1504 commented #998
  • May 14 22:41
    rom1504 commented #985
  • May 14 22:39

    rom1504 on master

    Fallback version for dynamic ve… (compare)

  • May 14 22:39
    rom1504 closed #983
  • May 13 22:49

    u9g on master

    Add motdMsg to createServer (#9… (compare)

  • May 13 22:49
    u9g closed #996
  • May 13 17:42
    u9g synchronize #996
  • May 13 03:12
    Kashalls synchronize #998
  • May 10 17:15

    u9g on npm_and_yarn

    (compare)

  • May 10 17:15

    u9g on master

    Bump standard from 16.0.4 to 17… (compare)

  • May 10 17:15
    u9g closed #990
  • May 10 17:05
    dependabot[bot] edited #990
  • May 10 17:04
    dependabot[bot] edited #990
rom1504bot
@rom1504bot
<extremeheat> Yeah if you have different systems that’s where the databases come into play
<Lucienn> Yes, if you sign up with redislab you can choose a free tier with 30mb
rom1504bot
@rom1504bot
<Kashall> I have my own infrastructure right now, trying not to add more servers already lol. I have three environments, my local one, and two "prods" and I kinda get tired of copying the caches back and forth xD
rom1504bot
@rom1504bot
<Kashall> @extremeheat Is p-auth 1.3.1 ready for prod?
<Kashall> Can we push 1.3.1 to nmp?
rom1504bot
@rom1504bot
<rom1504> isn't that in autoguess mode already?
<rom1504> is it even needed to specify microsoft?
<Kashall> https://github.com/PrismarineJS/node-minecraft-protocol/blob/master/src/createClient.js#L37 According to this line, if you want microsoft auth, you have to be specific.
<PrismarineJS> Showing lines 27 to 47 of master/src/createClient.js
 27   const mcData = require('minecraft-data')(optVersion)
 28   if (!mcData) throw new Error(`unsupported protocol version: ${optVersion}`)
 29   const version = mcData.version
 30   options.majorVersion = version.majorVersion
 31   options.protocolVersion = version.version
 32   const hideErrors = options.hideErrors || false
 33 
 34   const client = new Client(false, version.minecraftVersion, options.customPackets, hideErrors)
 35 
 36   tcpDns(client, options)
>37   if (options.auth === 'microsoft') {
 38     microsoftAuth.authenticate(client, options)
 39   } else {
 40     auth(client, options)
 41   }
 42   if (options.version === false) autoVersion(client, options)
 43   setProtocol(client, options)
 44   keepalive(client, options)
 45   encrypt(client, options)
 46   play(client, options)
 47   compress(client, options)
<rom1504> true
<rom1504> I think it should be quite doable
<rom1504> I think it should be transparent to the user
rom1504bot
@rom1504bot

<Kashall> @extremeheat Encountered a strange bug here with latest protocol: https://github.com/PrismarineJS/prismarine-auth/blob/0223a23039242068b11cd99a6ade184034d539d8/src/TokenManagers/LiveTokenManager.js#L160

|afk      | Error: Authentication failed, timed out
0|afk      |     at LiveTokenManager.authDeviceCode (/root/MinecraftAFKBot/node_modules/prismarine-auth/src/TokenManagers/LiveTokenManager.js:160:11)
0|afk      |     at runMicrotasks (<anonymous>)
0|afk      |     at processTicksAndRejections (internal/process/task_queues.js:95:5)
0|afk      |     at async MicrosoftAuthFlow.getMsaToken (/root/MinecraftAFKBot/node_modules/prismarine-auth/src/MicrosoftAuthFlow.js:90:19)
0|afk      |     at async retry.msa.forceRefresh (/root/MinecraftAFKBot/node_modules/prismarine-auth/src/MicrosoftAuthFlow.js:118:26)
0|afk      |     at async retry (/root/MinecraftAFKBot/node_modules/prismarine-auth/src/MicrosoftAuthFlow.js:22:14)
0|afk      |     at async MicrosoftAuthFlow.getXboxToken (/root/MinecraftAFKBot/node_modules/prismarine-auth/src/MicrosoftAuthFlow.js:117:14)
0|afk      |     at async retry.xbl.forceRefresh (/root/MinecraftAFKBot/node_modules/prismarine-auth/src/MicrosoftAuthFlow.js:144:22)
0|afk      |     at async retry (/root/MinecraftAFKBot/node_modules/prismarine-auth/src/MicrosoftAuthFlow.js:22:14)
0|afk      |     at async MicrosoftAuthFlow.getMinecraftJavaToken (/root/MinecraftAFKBot/node_modules/prismarine-auth/src/MicrosoftAuthFlow.js:143:7)

I know this is a catch all error but forsome reason it just instantly kicks me to this error for a specific account.

<Kashall> Oh, thats interesting. Seems to be a human error. Looks like if you just recently did a device code it just fails instantly.
rom1504bot
@rom1504bot
<extremeheat> That error means you did not sign in with the code in time
<extremeheat> The expire time in the code is conservative, it will force a failure on our side before it fails on the server side
<extremeheat> ~90% of all the auth problems are on the user side (at least when using proper oauth), there are a few edge cases but it’s just a matter of providing more detailed errors for people on what went wrong vs random request failure errors
rom1504bot
@rom1504bot
<Abulkhaiyr> Hi, can someone help me? I don't know how to make world appear on client connection. I have this code, and commented part is the part I can't figure out.

<Abulkhaiyr> `const mc = require("minecraft-protocol");
const World = require("prismarine-world")("1.16");
const Chunk = require("prismarine-chunk")("1.16");
const Anvil = require("prismarine-provider-anvil").Anvil("1.16");
const Vec3 = require("vec3");

const server = mc.createServer({
"online-mode": true,
encryption: true,
host: "localhost",
port: 25565,
version: "1.16",
});
const mcData = require("minecraft-data")(server.version);
const loginPacket = mcData.loginPacket;

function generateSimpleChunk(chunkX, chunkZ) {
const chunk = new Chunk();

for (let x = 0; x < 16; x++) {
for (let z = 0; z < 16; z++) {
chunk.setBlockType(new Vec3(x, 50, z), 2);
for (let y = 0; y < 256; y++) {
chunk.setSkyLight(new Vec3(x, y, z), 15);
}
}
}

return chunk;
}

const world = new World(generateSimpleChunk, new Anvil("./world"));

world.ch;

server.on("login", function (client) {
client.write("login", {
entityId: client.id,
isHardcore: false,
gameMode: 0,
previousGameMode: 1,
worldNames: loginPacket.worldNames,
dimensionCodec: loginPacket.dimensionCodec,
dimension: loginPacket.dimension,
worldName: "minecraft:overworld",
hashedSeed: [0, 0],
maxPlayers: server.maxPlayers,
viewDistance: 10,
reducedDebugInfo: false,
enableRespawnScreen: true,
isDebug: false,
isFlat: false,
});
// client.write("map_chunk", {
// x: 0,
// z: 0,
// groundUp: true,
// biomes: chunk.dumpBiomes !== undefined ? chunk.dumpBiomes() : undefined,
// heightmaps: {
// type: "compound",
// name: "",
// value: {}, // Client will accept fake heightmap
// },
// bitMap: chunk.getMask(),
// chunkData: chunk.dump(),
// blockEntities: [],
// });
client.write("position", {
x: 15,
y: 101,
z: 15,
yaw: 137,
pitch: 0,
flags: 0x00,
});
});`

This message was deleted

<Abulkhaiyr> ```const mc = require("minecraft-protocol");
const World = require("prismarine-world")("1.16");
const Chunk = require("prismarine-chunk")("1.16");
const Anvil = require("prismarine-provider-anvil").Anvil("1.16");
const Vec3 = require("vec3");

const server = mc.createServer({
"online-mode": true,
encryption: true,
host: "localhost",
port: 25565,
version: "1.16",
});
const mcData = require("minecraft-data")(server.version);
const loginPacket = mcData.loginPacket;

function generateSimpleChunk(chunkX, chunkZ) {
const chunk = new Chunk();

for (let x = 0; x < 16; x++) {
for (let z = 0; z < 16; z++) {
chunk.setBlockType(new Vec3(x, 50, z), 2);
for (let y = 0; y < 256; y++) {
chunk.setSkyLight(new Vec3(x, y, z), 15);
}
}
}

return chunk;
}

const world = new World(generateSimpleChunk, new Anvil("./world"));

world.ch;

server.on("login", function (client) {
client.write("login", {
entityId: client.id,
isHardcore: false,
gameMode: 0,
previousGameMode: 1,
worldNames: loginPacket.worldNames,
dimensionCodec: loginPacket.dimensionCodec,
dimension: loginPacket.dimension,
worldName: "minecraft:overworld",
hashedSeed: [0, 0],
maxPlayers: server.maxPlayers,
viewDistance: 10,
reducedDebugInfo: false,
enableRespawnScreen: true,
isDebug: false,
isFlat: false,
});
// client.write("map_chunk", {
// x: 0,
// z: 0,
// groundUp: true,
// biomes: chunk.dumpBiomes !== undefined ? chunk.dumpBiomes() : undefined,
// heightmaps: {
// type: "compound",
// name: "",
// value: {}, // Client will accept fake heightmap
// },
// bitMap: chunk.getMask(),
// chunkData: chunk.dump(),
// blockEntities: [],
// });
client.write("position", {
x: 15,
y: 101,
z: 15,
yaw: 137,
pitch: 0,
flags: 0x00,
});
});
```

<Abulkhaiyr> world.ch; is not supposed to be in there
rom1504bot
@rom1504bot
<tps> From what I can see, chunk needs to be defined in world.ch
rom1504bot
@rom1504bot
<rickyd> tried client.queue('player_action', let action = {action: 5, runtime_entity_id: client.uuid, position:0, face: 0})
then error:
        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)
<rickyd> could someone tell me how to perform a "sleep" action correctly? Thanks 🙂
rom1504bot
@rom1504bot
<Mac> Is the bedrock protocol a way where you can return packets when you connect to a server?
rom1504bot
@rom1504bot
<U9G> On 1.12.2 I'm getting these, should I be worried? js PartialReadError: Read error for undefined : Missing characters in string, found size is 40799 expected size was 420740095 at new ExtendableError (C:\Users\Jason\Documents\js-projects\cosmic-lore-bot\node_modules\protodef\src\utils.js:63:13) at new PartialReadError (C:\Users\Jason\Documents\js-projects\cosmic-lore-bot\node_modules\protodef\src\utils.js:70:5) at Object.string (eval at compile (C:\Users\Jason\Documents\js-projects\cosmic-lore-bot\node_modules\protodef\src\compiler.js:258:12), <anonymous>:47:15) at eval (eval at compile (C:\Users\Jason\Documents\js-projects\cosmic-lore-bot\node_modules\protodef\src\compiler.js:258:12), <anonymous>:1837:69) at eval (eval at compile (C:\Users\Jason\Documents\js-projects\cosmic-lore-bot\node_modules\protodef\src\compiler.js:258:12), <anonymous>:1923:11) at Object.packet_declare_recipes (eval at compile (C:\Users\Jason\Documents\js-projects\cosmic-lore-bot\node_modules\protodef\src\compiler.js:258:12), <anonymous>:1928:9) at eval (eval at compile (C:\Users\Jason\Documents\js-projects\cosmic-lore-bot\node_modules\protodef\src\compiler.js:258:12), <anonymous>:2041:70) at packet (eval at compile (C:\Users\Jason\Documents\js-projects\cosmic-lore-bot\node_modules\protodef\src\compiler.js:258:12), <anonymous>:2046:9) at CompiledProtodef.read (C:\Users\Jason\Documents\js-projects\cosmic-lore-bot\node_modules\protodef\src\compiler.js:70:12) at e.message (C:\Users\Jason\Documents\js-projects\cosmic-lore-bot\node_modules\protodef\src\compiler.js:111:49)
<nickelpro> I don't think that's supposed to happen, no
rom1504bot
@rom1504bot
<carinya> is anyone working on 1.18?
rom1504bot
@rom1504bot
<rom1504> Yes u9g is finishing a PR on the topic
rom1504bot
@rom1504bot

<TheGameSpider> Hello, I am trying to send custom_payload packet using

client.write("custom_payload", packet), and I am getting this error

Caught exception:  RangeError [ERR_INVALID_ARG_VALUE]: The argument 'size' is invalid. Received NaN
    at Function.allocUnsafe (node:buffer:371:3)
    at CompiledProtodef.createPacketBuffer (/home/ubuntu/mc/node_modules/protodef/src/compiler.js:101:27)
    at Serializer.createPacketBuffer (/home/ubuntu/mc/node_modules/protodef/src/serializer.js:12:23)
    at Serializer._transform (/home/ubuntu/mc/node_modules/protodef/src/serializer.js:18:18)
    at Serializer.Transform._read (/home/ubuntu/mc/node_modules/readable-stream/lib/_stream_transform.js:177:10)
    at Serializer.Transform._write (/home/ubuntu/mc/node_modules/readable-stream/lib/_stream_transform.js:164:83)
    at doWrite (/home/ubuntu/mc/node_modules/readable-stream/lib/_stream_writable.js:409:139)
    at writeOrBuffer (/home/ubuntu/mc/node_modules/readable-stream/lib/_stream_writable.js:398:5)
    at Serializer.Writable.write (/home/ubuntu/mc/node_modules/readable-stream/lib/_stream_writable.js:307:11)
    at Client.write (/home/ubuntu/mc/node_modules/minecraft-protocol/src/client.js:221:21) {
  code: 'ERR_INVALID_ARG_VALUE',
  field: 'play.toServer'
}
<TheGameSpider> Is there something I am doing wrong or is this a problem with the module
<U9G> what does packet look like?
rom1504bot
@rom1504bot
<TheGameSpider> { channel: "minecraft:register", data: { type: "Buffer", data: [ 102, 97, 98, 114, ... (82 bytes total) ] } }
rom1504bot
@rom1504bot
<U9G> it's not supposed to be an array for the data: []
<U9G> it should be data: Buffer.from([])
rom1504bot
@rom1504bot
<TheGameSpider> ERR_INVALID_ARG_VALUE
rom1504bot
@rom1504bot
<paradise> Error: No data available for version undefined does this mean it failed to detect the version?

<paradise> ```js
const mc = require('minecraft-protocol');

const handleServer = (server) => {
try {
var client = mc.createClient({
host: "localhost", // optional
port: 25565, // optional
username: "Symphony",
version: false
});

client.on('login', function(packet) {
  client.write('chat', {message: "xyz"});
  client.end();
});

} catch (e) { console.error(e); }
}
```

<paradise> oh I guess it does
<paradise> guess ill use another library to check it ty
rom1504bot
@rom1504bot
<paradise> is there any way to convert between protocol number to version?
rom1504bot
@rom1504bot
<rom1504> fixed now, just run npm update --depth 9999
<paradise> ty
rom1504bot
@rom1504bot
<! TheRed> hi
<! TheRed> so
<! TheRed> basically
<! TheRed> (it's kinda late for me rn, actually 1 AM)