feat(cli): add command helpers and NotAPlayerError
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user