Hi, I am new to APIs, I would like to know if there is a way to execute two commands when doing a custom command
https://wiki.bedrock.dev/scripting/custom-command.html
#Custom command
1 messages · Page 1 of 1 (latest)
world.events.beforeChat.subscribe(async (eventData) => {
const player = eventData.sender;
switch (eventData.message) {
case '#kit':
eventData.cancel = true;
await player.runCommandAsync('give @p leather_helmet', 'give @p leather_chestplate');
break;
case '#lobby':
eventData.cancel = true;
await player.runCommandAsync('tp @p 100 100 100');
break;
default: break;
}
});
This was what I tried
use /function
Ok thanks, but is it not possible to execute two commands?
or
player.runCommandAsync('give @p leather_helmet');
player.runCommandAsync('give @p leather_chestplate');