public static NonNullPair<SkriptEventInfo<?>, SkriptEvent> parseEvent(final String event, final String defaultError) {
final RetainingLogHandler log = SkriptLogger.startRetainingLog();
try {
final NonNullPair<SkriptEventInfo<?>, SkriptEvent> e = new SkriptParser(event, PARSE_LITERALS, ParseContext.EVENT).parseEvent();
if (e != null) {
log.printLog();
return e;
}
log.printErrors(defaultError);
return null;
} finally {