#Why after the update this don't work??
1 messages · Page 1 of 1 (latest)
see events doc
i found this change ChatSendAfter & ChatSendBeforeEvent
Changed message and sender to read-only properties
Removed setTargets, getTargets, sendToTargetsand replaced with an optional player list property targets
the index is this
import { world } from '@minecraft/server'
import './cmd.js'
import './main.js'
import './chatspam.js'
whats at line 5 in cmd.ja
Minecraft.world.beforeEvents.chatSend.subscribe((data) => {
show top code also
import * as Minecraft from "@minecraft/server";
let prefix = "-";
Minecraft.world.beforeEvents.chatSend.subscribe((data) => {
if (data.message.toLowerCase().startsWith(${prefix}help)) {
data.cancel = true;
data.sender.runCommandAsync(function ZANGhelp);
}
});
weird
Do you have any packs for chat commands so I can try to compare them?
whats ur manifest
{
"format_version": 2,
"header": {
"description": "§l§2Angu§friac§4raft§3 security V3",
"name": "§l§2Angu§friac§4raft§3 security §6function e chatrank",
"uuid": "e66fcd27-4479-9d5f-a3f7-ee581e9c9d81",
"version": [
1,
1,
7
],
"min_engine_version": [
1,
19,
40
]
},
"modules": [
{
"description": "Example behavior pack module",
"type": "script",
"language": "javascript",
"uuid": "6c90f42f-5d7c-43c5-be22-248bafb097c0",
"version": [
0,
0,
1
],
"entry": "scripts/index.js"
}
],
"dependencies": [
{
"module_name": "@minecraft/server",
"version": "1.8.0"
},
{
"module_name": "@keen arrow",
"version": "1.2.0-beta"
}
]
}
i only changed 1.8.0-beta to 1.8.0
game version ?
1.20.60
yea seems like a game bug
same issue
@dire harness do
for (let i in world.beforeEvents) {
console.warn(i)
}
maybe it's still in beta?
this one says it's still in beta api :/
https://darkgameryt.github.io/ScriptAPI-Docs/versions/1.20.60/
Documentation for ScriptAPI - v1.20.60
i chaged the manifest into 1.9.0-beta and now it works
ye