#custom cmds not work

1 messages · Page 1 of 1 (latest)

jade mason
#

it works

#

this pack works

#

@thin crown

hexed marsh
#

hold on let me see the pack

jade mason
#

What?

#

minecraft hates you and me

#

i dont get that error

#

do you @hexed marsh

hexed marsh
#

oh

#

you should

#

it works now?

jade mason
#

the manifest has index not main

hexed marsh
#

try this then: ```json
{
"format_version": 2,
"header": {
"name": "Custom Commands",
"description": "Custom Commands using the Script API",
"uuid": "19f69978-1301-4527-84aa-a13e3f57571b",
"version": [0, 1, 0],
"min_engine_version": [1, 20, 0]
},
"modules": [
{
"description": "Script resources",
"language": "javascript",
"type": "script",
"uuid": "24b38a70-dffa-4d5e-b272-72f8435c1bc6",
"version": [0, 0, 1],
"entry": "scripts/main.js"
}
],
"dependencies": [
{

        "module_name": "@minecraft/server",
        "version": "1.4.0-beta"
    }

]
}```

jade mason
#

did it work

#

BRO

#

bro

hexed marsh
#

Bro is running gmc in gms

west sandalBOT
#
No Errors

No errors in [code](#1130145222463066183 message)

#
No Errors

No errors in [code](#1130145222463066183 message)

hexed marsh
#
import { world } from '@minecraft/server'
world.beforeEvents.chatSend.subscribe((eventData) => {
    const { message, sender } = eventData
    if (!message.startsWith('!')) return
    const args = message.slice(1)
    eventData.cancel = true
    switch (args) {
        case 'gmc':
            sender.runCommandAsync('gamemode c');
            sender.sendMessage(`§bChanged ${sender.name}'s gamemode to Survival`);
            break;
        case 'gms':
            sender.runCommandAsync('gamemode s');
            sender.sendMessage(`§bChanged ${sender.name}'s gamemode to Survival`);
            break;
        default:
            sender.sendMessage('§cUnknown command or insufficient permissions.');
            break;
    }
}); 
west sandalBOT
#
No Errors

No errors in [code](#1130145222463066183 message)

hexed marsh
#

you aren't using vscode aren't you

west rock
#

I can put it in scipt folder and can edit them more i think to add some

west rock
hexed marsh
west rock
#

Ah player.hasTag() ?

hexed marsh