scriptserver icon indicating copy to clipboard operation
scriptserver copied to clipboard

getLocation regex erorr

Open matvejs16 opened this issue 4 years ago • 7 comments

Node script crashes when using server.rconConnection.util.getLocation(event.player) image

matvejs16 avatar Dec 24 '21 17:12 matvejs16

Same problem and same error with server.rconConnection.util.getEntityData()

matvejs16 avatar Dec 24 '21 17:12 matvejs16

Forgot, minecraft version: 1.12.2 Forge 1.12.2 Server

matvejs16 avatar Dec 24 '21 17:12 matvejs16

Well for one the node process shouldn’t crash from invalid regex, so I’ll need to debug and fix that one,

but I’m assuming the regex will also need to be altered from the default to accommodate for it being forge, I’ll try and respond with a fix tonight or tomorrow

garrettjoecox avatar Dec 25 '21 21:12 garrettjoecox

The problem is with /data command, that command added to minecraft in 1.13 version

matvejs16 avatar Dec 25 '21 21:12 matvejs16

Ah right, there was a way to obtain xyz coords before 1.13, I’ll have to check the git history

garrettjoecox avatar Dec 25 '21 22:12 garrettjoecox

Don't forget about server.rconConnection.util.getEntityData() That uses /data command too

matvejs16 avatar Dec 25 '21 22:12 matvejs16

I have somewhat the same problem with vanilla 1.18.2 Trying to get playerData aaaand... crash:

2022-04-27 13:29:13 error: uncaughtException: Cannot read properties of null (reading '2') TypeError: Cannot read properties of null (reading '2') at Object. (/Users/j/Developer/Production/creaft3/node_modules/@scriptserver/util/src/useUtil.ts:72:89) at Generator.next () at fulfilled (/Users/j/Developer/Production/creaft3/node_modules/@scriptserver/util/dist/useUtil.js:5:58) at processTicksAndRejections (node:internal/process/task_queues:96:5)

using:

server.rconConnection.util.getEntityData(event.player).then(entityData => {
  console.log(entityData);
});

iojanis avatar Apr 27 '22 11:04 iojanis