#script help

1 messages · Page 1 of 1 (latest)

fresh crow
#

help, How can I save what the player writes in a variable?

junior carbon
#

Wdym

#

what means of writes your said

#

@fresh crow

fresh crow
#

@junior carbon world.events.beforechat

That no longer exists, how would it be done now? that's my little problem

junior carbon
#

Just changed method

#

Wait i coding for u

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

world.beforeEvents.chatSend.subscribe((evd) => {
    const player = evd.sender;
    const msg = evd.message;
    switch (msg) {
    case 'hi':
    player.sendMessage('hi!!')
    break;
    default:
    }
});

@fresh crow

tight voidBOT
# junior carbon ```js import { world, system } from "@minecraft/server"; world.beforeEvents.cha...

Debug result for [code](#1307492901881778247 message)

Compiler Result

Compiler found 1 errors:

@minecraft/server.d.ts:24:44 - error TS2792: Cannot find module '@minecraft/vanilla-data'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option?

24 import type * as minecraftvanilladata from "@minecraft/vanilla-data";
                                              ~~~~~~~~~~~~~~~~~~~~~~~~~

Lint Result

ESLint results:

<REPL0>.js

1:17 error 'system' is defined but never used @typescript-eslint/no-unused-vars

fresh crow
junior carbon
#

Better to use beta module version

fresh crow
#

Which version do you recommend?

junior carbon
#

Exp 1.16.0-beta

#

I recommend U update Minecraft version

junior carbon
fresh crow
#

thanks

#

I'll check if it works