Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prismarine-physics: Cannot convert undefined or null to object #3530

Open
Udyz opened this issue Dec 20, 2024 · 0 comments · May be fixed by PrismarineJS/prismarine-physics#120
Open

prismarine-physics: Cannot convert undefined or null to object #3530

Udyz opened this issue Dec 20, 2024 · 0 comments · May be fixed by PrismarineJS/prismarine-physics#120
Labels
possible bug Stage1 just created by someone new to the project, we don't know yet if it deserves an implementation / a f

Comments

@Udyz
Copy link

Udyz commented Dec 20, 2024

Versions

  • mineflayer: 4.20.1
  • server: XCORD
  • node: 18.5.0

Your current code

const mineflayer = require('mineflayer');
async function loginSequence() {
  bot.chat('/menu');
  await delay(2000);
  bot.clickWindow(14, 0, 0);
  await delay(1000);
}
function createBot() {
  bot = mineflayer.createBot({
    host: 'xxx',
    port: 25565,
    username: 'test',
    version: '1.12.2'
  });
  bot.once('login', () => {
    setTimeout(async () => {
      await loginSequence();
    }, 2000);
  });
  bot.on('message', (jsonMsg) => {
     console.log(jsonMsg.toAnsi());
   });
}

Detailed problem:

after clickWindow and connecting to the server this happens

> C:\snapshot\node\node_modules\prismarine-block\index.js:266
      return Object.assign(this._properties, this.computedStates)
                    ^

TypeError: Cannot convert undefined or null to object
    at Function.assign (<anonymous>)
    at Block.getProperties (C:\snapshot\node\node_modules\prismarine-block\index.js:266:21)
    at getWaterInBB (C:\snapshot\node\node_modules\prismarine-physics\index.js:643:93)
    at isInWaterApplyCurrent (C:\snapshot\node\node_modules\prismarine-physics\index.js:655:25)
    at Object.simulatePlayer (C:\snapshot\node\node_modules\prismarine-physics\index.js:678:24)
    at tickPhysics (C:\snapshot\node\node_modules\mineflayer\lib\plugins\physics.js:80:15)
    at Timeout.doPhysics [as _onTimeout] (C:\snapshot\node\node_modules\mineflayer\lib\plugins\physics.js:70:7)
    at listOnTimeout (node:internal/timers:564:17)
    at process.processTimers (node:internal/timers:507:7)

Node.js v18.5.0
@Udyz Udyz added possible bug Stage1 just created by someone new to the project, we don't know yet if it deserves an implementation / a f labels Dec 20, 2024
@extremeheat extremeheat changed the title Cannot convert undefined or null to object prismarine-physics: Cannot convert undefined or null to object Dec 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
possible bug Stage1 just created by someone new to the project, we don't know yet if it deserves an implementation / a f
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant