SkriptLang / Skript

Skript is a Spigot plugin which allows server admins to customize their server easily, but without the hassle of programming a plugin or asking/paying someone to program a plugin for them.
https://docs.skriptlang.org
GNU General Public License v3.0
1.07k stars 371 forks source link

Cancelling `on swim toggle` does not work #7054

Closed mugu2006 closed 1 month ago

mugu2006 commented 1 month ago

Skript/Server Version

[19:26:06 INFO] [Skript] Skript's aliases can be found here: https://github.com/SkriptLang/skript-aliases

[19:26:06 INFO] [Skript] Skript's documentation can be found here: https://docs.skriptlang.org/

[19:26:06 INFO] [Skript] Skript's tutorials can be found here: https://docs.skriptlang.org/tutorials

[19:26:06 INFO] [Skript] Server Version: 1.21.1-65-21f125f (MC: 1.21.1)

[19:26:06 INFO] [Skript] Skript Version: 2.9.2 (skriptlang-github)

[19:26:06 INFO] [Skript] Installed Skript Addons:

[19:26:06 INFO] [Skript] - SkBee v3.6.1 (https://github.com/ShaneBeee/SkBee)

[19:26:06 INFO] [Skript] Installed dependencies:

[19:26:06 INFO] [Skript] - WorldGuard v7.0.11-beta1+a801a9d

Bug Description

Title explains it, cancelling the on swim toggle event does nothing, it is detected but not cancelled

Expected Behavior

I'd assume the swimming should have been cancelled and I would remain non-swimming

Steps to Reproduce


    cancel event```
 Use that code, go in water, try to start swimming

### Errors or Screenshots

-

### Other

-

### Agreement

- [X] I have read the guidelines above and affirm I am following them with this report.
mugu2006 commented 1 month ago

Breh, code I put in steps to reproduce didn't go in, here it is; on swim toggle: cancel event Yes, indents are correct, idk how to put them in on GitHub

mugu2006 commented 1 month ago

Just learned it can't be cancelled, even though the docs and example state it can.

Fusezion commented 1 month ago

It's not the fact it can't be cancelled just more so the fact it doesn't do much of anything this is taken from javadocs for the event

Deprecated. This does nothing, the server and the client doesn't work correctly when the server try to bypass this. A current workaround exists. If you want to cancel the switch from the ground state to the swimming state you need to disable the sprinting flag for the player after the cancel action.