EffPlaySound fails on Spigot server when another plugin implements AdventureAPI #7261
Open
1 task done
Labels
bug
An issue that needs to be fixed. Alternatively, a PR fixing an issue.
completed
The issue has been fully resolved and the change will be in the next Skript update.
feature-ready
A PR/issue that has been approved, tested and can be merged/closed in the next feature version.
Skript/Server Version
Bug Description
When running a Spigot server, the adventure API is obviously missing.
Some plugins will implement the AdventureAPI, which can cause some issues.
For example, in
ch.njol.skript.bukkitutil.sounds.SoundReceiver
there is this field:boolean ADVENTURE_API = Skript.classExists("net.kyori.adventure.sound.Sound$Builder");
If another plugin has implemented AdventureAPI, this will result in this field being true.
But when running the play sound effect, we get the following error:
IncompatibleClassChangeError: Class org.bukkit.SoundCategory does not implement the requested interface net.kyori.adventure.sound.Sound$Source$Provider
That is because the Bukkit class doesn't implement the adventure class (that paper does)
Expected Behavior
For the error to not happen, and the sound to play!
Steps to Reproduce
play sound "test"
Errors or Screenshots
Longer version of the error:
Other
No response
Agreement
The text was updated successfully, but these errors were encountered: