#[Scripting][error]-Plugin [test script - 1.0.0] - [main.js] ran with error: [TypeError: cannot read
1 messages · Page 1 of 1 (latest)
Show code
import { world } from '@minecraft/server';
import { ActionFormData } from '@minecraft/server-ui';
world.sendMessage("script work succefully")
world.beforeEvents.chatSend.subscribe((event) => {
const sender = data.sender
const message = data.message
if(message == ".home"){
//execute code
}
})
You're using data.sender instead event.sender
that not change any things
import { world } from '@minecraft/server';
import { ActionFormData } from '@minecraft/server-ui';
world.sendMessage("script work succefully")
world.beforeEvents.chatSend.subscribe((event) => {
const sender = event.sender
const message = event.message
if(message == ".home"){
//execute code
}
})```
Try with that, it didn't tell me there's errors
same error what version of api do you use ?
1.20.60
no the @minecraft/server what is your version ?