feat(cli): add command helpers and NotAPlayerError

This commit is contained in:
ForestOfLight
2026-05-19 17:28:58 -07:00
Unverified
parent 6fac0d953f
commit aae9fd2f4b
6 changed files with 44 additions and 1 deletions
@@ -0,0 +1,9 @@
import { CustomCommandStatus } from '@minecraft/server';
import { NotAPlayerError } from '../../Errors/NotAPlayerError';
export function commandError(source, err) {
if (err instanceof NotAPlayerError) {
return { status: CustomCommandStatus.Failure, message: 'construct.commands.error.notAPlayer' };
}
throw err;
}