#Can someone fix this?

1 messages · Page 1 of 1 (latest)

junior hollow
#

[Scripting][error]-Plugin [tele - 1.0.0] - [Main.js] ran with error: [SyntaxError: unexpected end of string at Main.js:7
]

[Scripting][error]-Unhandled promise rejection: Error: Failed to add objective 'chatsSent' as it is already being tracked

Script ```js
import {world} from 'mojang-minecraft'

world.events.beforeChat.subscribe((ev) => {
const player = ev.sender
const msg = ev.message

if(msg == "+teste){
player.runCommand("tp @s 120 34 56")
}
})

#

<@&1065713026369593434>

mortal herald
# junior hollow <@&1065713026369593434>

Hello, please do not ping mods. While it can be frustrating waiting to get help with your problem, other people will provide assistance. If you see anyone breaking the rules, feel free to ping us. Thanks 🙂

little skiff
#

This looks like an Outdated Script-API

#

i'll try

#
import {world} from 'mojang-minecraft'

world.events.beforeChat.subscribe((ev) => {
  const player = ev.sender
  const msg = ev.message
  
  if(msg == "+teste"){
    player.runCommand("tp @s 120 34 56")
  }
})
#

fixed "+teste into actual String "+teste"

junior hollow
#

what do I do?

little skiff
#

About this Promise rejection... of 'chatsSent'

I think you didn't fully show your code.

#

So, cant help with that

junior hollow
#

@little skiff gave the same error

#

Script ```js
import {world} from 'mojang-minecraft'

world.events.beforeChat.subscribe((ev) => {
const player = ev.sender
const msg = ev.message

if(msg == "+teste"){
player.runCommand("tp @s 120 34 56")
}
})

#

@little skiff

#

Wtf

little skiff
#

I don't know how to fix it unfortunately, you're using an older Minecraft version with an old Script API.

just wait for another person. But it is unlikely they know how to fix it either.
Just update your Minecraft version to the latest one

little skiff
little skiff
#

oh, in that case...

#
import {world, system} from '@minecraft/server'

world.beforeEvents.chatSend.subscribe((ev) => {
  const player = ev.sender
  const msg = ev.message
  
  if(msg === "+teste"){
  //hide the message from being show in chat
  ev.cancel = true
  //Privilage stuff
  system.run(()=>{
     player.runCommand("tp @s 120 34 56")
  })
  }
})
junior hollow
#

Error

little skiff
#

send error

junior hollow
#

gave the same error

little skiff
#

Do you have another pack active?

junior hollow
#

yes because i am creating a server

#

@little skiff

#

@little skiff

little skiff
little skiff
junior hollow
#

I don't already tried

#

did you get help?

little skiff
#

Idk how to help with this, sorry

little skiff
junior hollow
#

Yes

little skiff
#

yup, idk the problem. let's wait and see if someone saw this post

junior hollow
#

beauty

flat light
#

@junior hollow do u still need help?

cosmic dagger
elder jewel
#

hello

#

how to fix getComponent("inventory") hidden container

flat light
#

what?

#

u mean it doesnt show container method?

little skiff
#

container is a property

#

Also this is someone post

#

Make your own post

jagged narwhal
elder jewel
#

can you give me npm server script pls @jagged narwhal

little skiff
#

#1067535608660107284

elder jewel
junior hollow
#

@flat light

flat light
#

what do you need help with

junior hollow
#

my script is giving error

#

@flat light

#

import {world, system} from '@minecraft/server'

world.beforeEvents.chatSend.subscribe((ev) => {
const player = ev.sender
const msg = ev.message

if(msg === "+teste"){
//hide the message from being show in chat
ev.cancel = true
//Privilage stuff
system.run(()=>{
player.runCommand("tp @s 120 34 56")
})
}
})

#

it is giving error this script

#

Help Help

#

@flat light

junior hollow
#

😭😭😭😭😭😭

junior hollow
#

@flat light @flat light

cosmic dagger
#

@flat light

#

@flat light

flat light
junior hollow
#

[Scripting][error]-Plugin [tele - 1.0.0] - [Main.js] ran with error: [SyntaxError: unexpected end of string at Main.js:7
]

[Scripting][error]-Unhandled promise rejection: Error: Failed to add objective 'chatsSent' as it is already being tracked

#

@flat light

flat light
#

whats on line 7 in main.js

junior hollow
#

I didn't understand anything

flat light
#

Bruh

#

Send the code that is on line 7 in Main.js

junior hollow
junior hollow
#

no

flat light
#

console.warn(msg) before the if statement

junior hollow
#

I don't work bro

#

@flat light

flat light
#

bro what

junior hollow
#

did not work

junior hollow
#

@flat light

vale olive
#

try it on a new world, it seems like your scripts arent reloading properly

flat light
lusty flameBOT
#
angel136381

this works for me

kind marten
#
world.beforeEvents.chatSend.subscribe(ev=> {
    const player = ev.sender;
    const msg = ev.message;
    if (msg === '+teste') {
        ev.cancel = true;
        system.run(()=> {
            player.runCommandAsync('tp @s 120 34 56')
        })
    }
})
lusty flameBOT
#
_thiagoe

chatEnviar?

#
_thiagoe

I will forehead

flat light
flat light
kind marten
#

portugues

junior hollow
#

Yes

junior hollow
#

@kind marten

flat light
#

what does it say

kind marten
#

^

#

share your main.js

lusty flameBOT
#
_thiagoe

o que isso diz

#
_thiagoe

compartilhe seu main.js

junior hollow
# kind marten share your main.js

world.beforeEvents.chatSend.subscribe(ev=> {
const player = ev.sender;
const msg = ev.message;
if (msg === '+teste') {
ev.cancel = true;
system.run(()=> {
player.runCommandAsync('tp @s 120 34 56')
})
}
})

#

@kind marten

kind marten
#

ALL

#

envie seu main.js completo

junior hollow
#

Ta completo

kind marten
#

Imports?

flat light
#

I think this guy is borderline braindead

kind marten
#
import { world } from "@minecraft/server";

world.beforeEvents.chatSend.subscribe(ev=> {
    const player = ev.sender;
    const msg = ev.message;
    if (msg === '+teste') {
        ev.cancel = true;
        system.run(()=> {
            player.runCommandAsync('tp @s 120 34 56')
        })
    }
})
lusty flameBOT
#
_thiagoe

Importações?

#
_thiagoe

For me put this?

kind marten
#

yeah

junior hollow
#

Okay

lusty flameBOT
#
_thiagoe

did not work

junior hollow
#

@kind marten

#

@kind marten @kind marten

#

@kind marten @kind marten @kind marten

#

Kk

kind marten
#

Error?

#

Turn on beta apis

junior hollow
junior hollow
kind marten
#

What error?

little skiff
#

Conclusion:

  • The code itself works
  • The problem relies on the server/device.
junior hollow
# kind marten What error?

Scripting][error]-Plugin [tele - 1.0.0] - [Main.js] ran with error: [SyntaxError: unexpected end of string at Main.js:7

#

@kind marten

lusty flameBOT
#
_thiagoe

Conclusão:

  • O próprio código funciona
  • O problema depende do servidor/dispositivo
junior hollow
#

@kind marten @kind marten @kind marten @kind marten @kind marten @kind marten @kind marten @kind marten

kind marten
#

what is minecraft/server version?

lusty flameBOT
#
_thiagoe

qual é a versão do minecraft/servidor?

junior hollow
kind marten
#

minecraft/server not Minecraft

#

Manifest.json

little skiff
#

He's talking about the import version of @minecraft/server in manifest.json