import {system, world} from "@minecraft/server"
world.beforeEvents.chatSend.subscribe((event)=>{
const {message, sender, targets} = event
const msg = message.toLowerCase()
if(!msg.startsWith("!replay")) return
event.cancel = true
const participant = targets?[sender, ...targets]:[sender]
participant.forEach((p)=>{
console.warn(p.name , targets);
p.sendMessage("test message | §c" + sender.name + "§r invited you to a replay session")
})
})
when sending !replay @anotherPlayer
the other player never receive the message. isn't that what targets property for?
tried /whisperer @anotherPlayer and didn't work also. am i doing something wrong or what?