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?
#How do I contextualize who is sending the command?
8 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
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
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
You can find most things through the autocompletions probejs provides.
thank you