garrettjoecox / scriptserver

A Minecraft server wrapper, allows for simple plugins in vanilla
GNU General Public License v3.0
68 stars 10 forks source link

getLocation regex erorr #42

Open matvejs16 opened 2 years ago

matvejs16 commented 2 years ago

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

matvejs16 commented 2 years ago

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

matvejs16 commented 2 years ago

Forgot, minecraft version: 1.12.2 Forge 1.12.2 Server

garrettjoecox commented 2 years ago

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

matvejs16 commented 2 years ago

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

garrettjoecox commented 2 years ago

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

matvejs16 commented 2 years ago

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

iojanis commented 2 years ago

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);
});