#How do I contextualize who is sending the command?

8 messages · Page 1 of 1 (latest)

glacial burrow
#
    const { commands: Commands, arguments: Arguments } = event;
    
    event.register(
        Commands.literal('pegar_missao')
            .executes(context => {
                jogador = context.sender //that doesn't exist
                let procurados = event.server.players.filter(player => player.persistentData.pk > 1);
                let alvo = procurados[Math.floor    (Math.random() * procurados.length)];
                jogador.tell(`Você recebeu a missão de eliminar ${alvo.name}.`);
                jogador.tell(`As coordenadas de seu alvo são: X=${alvo.x}, Y=${alvo.y}, Z=${alvo.z}.`);
                })
        )
    })```
Exists any doc about predefined variables like this?
heavy baneBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

outer garden
#

it should be context.source.player or context.source.entity, though you should probably check context.source.isPlayer() first in case the command is ran from a command block or through /execute as

#

as for the second question:

#

??addon ProbeJS

glacial loomBOT
# outer garden ??addon ProbeJS

ProbeJS is an addon mod for KubeJS that generates typings files for VSCode, allowing VSCode to offer autocompletions for a ton of things!

Mod by @vital carbon

outer garden
#

You can find most things through the autocompletions probejs provides.

glacial burrow
#

thank you