Skip to content

Commit

Permalink
fix not returning false
Browse files Browse the repository at this point in the history
  • Loading branch information
Efnilite committed Oct 1, 2024
1 parent 30df668 commit 1b07749
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/ch/njol/skript/effects/EffCancelEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,10 @@ public boolean init(Expression<?>[] expressions, int matchedPattern,
if (currentEvents == null)
return false;

if (cancel && getParser().isCurrentEvent(EntityToggleSwimEvent.class))
if (cancel && getParser().isCurrentEvent(EntityToggleSwimEvent.class)) {
Skript.error("Cancelling a toggle swim event has no effect");
return false;
}

for (Class<? extends Event> event : currentEvents) {
if (Cancellable.class.isAssignableFrom(event) || BlockCanBuildEvent.class.isAssignableFrom(event))
Expand Down

0 comments on commit 1b07749

Please sign in to comment.