@flymeth/datapackjs
Version:
A great library to create your own minecraft datapack with javascript!
15 lines (14 loc) • 489 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
function executeCmd(executor, command) {
if (executor.endsWith('run'))
return `execute ${executor} ${command}`;
if (command.startsWith('execute '))
return `execute ${executor} ${command.replace('execute ', '')}`;
if (!executor)
return command;
if (!command)
return "";
return `execute ${executor} run ${command}`;
}
exports.default = executeCmd;