@Override public boolean init(final Expression<?>[] vars, final int matchedPattern, final Kleenean isDelayed, final SkriptParser.ParseResult parser) { if (!ScriptLoader.isCurrentEvent(CastEvent.class) && !ScriptLoader.isCurrentEvent(PreCastEvent.class)) { Skript.error("Cannot use 'caster' outside of a cast event", ErrorQuality.SEMANTIC_ERROR); return false; } return true; }
@SuppressWarnings("unchecked") public boolean init(Expression<?>[] expressions, int i, Kleenean kleenean, SkriptParser.ParseResult parseResult) { if (ScriptLoader.isCurrentEvent(FunctionEvent.class)) { this.n = (Expression<Number>) expressions[0]; return true; } Skript.error("Cannot use function argument outside of a function!", ErrorQuality.SEMANTIC_ERROR); return false; }
public boolean init(Expression<?>[] expressions, int i, Kleenean kleenean, SkriptParser.ParseResult parseResult) { if (!ScriptLoader.isCurrentEvent(PlayerMoveEvent.class)) { Skript.error("Cannot use function argument outside of a server list ping event!", ErrorQuality.SEMANTIC_ERROR); return false; } return true; }
@Override public boolean init(final Expression<?>[] vars, final int matchedPattern, final Kleenean isDelayed, final SkriptParser.ParseResult parser) { if (!ScriptLoader.isCurrentEvent(CastEvent.class)) { Skript.error("Cannot use 'targets' outside of a cast event", ErrorQuality.SEMANTIC_ERROR); return false; } return true; }
@SuppressWarnings("unchecked") public boolean init(Expression<?>[] expressions, int i, Kleenean kleenean, SkriptParser.ParseResult parseResult) { if (ScriptLoader.isCurrentEvent(FunctionEvent.class)) { this.result = (Expression<Object>) expressions[0]; return true; } Skript.error("Cannot use return effect outside of a function!", ErrorQuality.SEMANTIC_ERROR); return false; }
public boolean init(Expression<?>[] expressions, int i, Kleenean kleenean, SkriptParser.ParseResult parseResult) { if (ScriptLoader.isCurrentEvent(InventoryClickEvent.class)) { return true; } Skript.error("Cannot use slot expression outside of a inventory click event!", ErrorQuality.SEMANTIC_ERROR); return false; }
public boolean init(Expression<?>[] expressions, int i, Kleenean kleenean, SkriptParser.ParseResult parseResult) { if (ScriptLoader.isCurrentEvent(FunctionEvent.class)) { return true; } Skript.error("Cannot use function argument outside of a function!", ErrorQuality.SEMANTIC_ERROR); return false; }
public boolean init(Expression<?>[] expressions, int i, Kleenean kleenean, SkriptParser.ParseResult parseResult) { if (!ScriptLoader.isCurrentEvent(ServerListPingEvent.class)) { return true; } Skript.error("Cannot use function argument outside of a server list ping event!", ErrorQuality.SEMANTIC_ERROR); return false; }