Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Playsound isnt working on 1.18.2 #7158

Open
1 task done
RyuguDev opened this issue Oct 18, 2024 · 2 comments
Open
1 task done

Playsound isnt working on 1.18.2 #7158

RyuguDev opened this issue Oct 18, 2024 · 2 comments
Labels
cannot reproduce An issue that cannot be replicated.

Comments

@RyuguDev
Copy link

Skript/Server Version

[19:22:39] [Render thread/INFO]: [System] [CHAT] [Skript] Skript's aliases can be found here: https://github.com/SkriptLang/skript-aliases
[19:22:39] [Render thread/INFO]: [System] [CHAT] [Skript] Skript's documentation can be found here: https://docs.skriptlang.org/
[19:22:39] [Render thread/INFO]: [System] [CHAT] [Skript] Skript's tutorials can be found here: https://docs.skriptlang.org/tutorials
[19:22:39] [Render thread/INFO]: [System] [CHAT] [Skript] Server Version: git-Purpur-1632 (MC: 1.18.2)
[19:22:39] [Render thread/INFO]: [System] [CHAT] [Skript] Skript Version: 2.9.3 (skriptlang-github)
[19:22:39] [Render thread/INFO]: [System] [CHAT] [Skript] Installed Skript Addons: 
[19:22:39] [Render thread/INFO]: [System] [CHAT] [Skript]  - SkBee v3.6.1 (https://github.com/ShaneBeee/SkBee)
[19:22:39] [Render thread/INFO]: [System] [CHAT] [Skript] Installed dependencies: 
[19:22:39] [Render thread/INFO]: [System] [CHAT] [Skript]  - Vault v1.7.3-b131
[19:22:39] [Render thread/INFO]: [System] [CHAT] [Skript]  - WorldGuard v7.0.7+216b061

Bug Description

I encountered an error when a player joins the server, which seems to be related to the Adventure API's sound handling. The error prevents the normal execution of scripts that involve playing sounds.

Expected Behavior

The expected behavior is for players to join the server without any errors and for any associated sound effects to play correctly if defined in the scripts.

Steps to Reproduce

Start the server with Skript v2.9.3 on Purpur 1.18.2.
Create a Skript that plays a sound when a player joins the server.
Have a player join the server.
Observe the console for errors.

Errors or Screenshots

[19:20:21 ERROR]: Could not pass event PlayerJoinEvent to Skript v2.9.3
java.lang.NoSuchMethodError: 'net.kyori.adventure.sound.Sound$Builder net.kyori.adventure.sound.Sound.sound()'
at ch.njol.skript.bukkitutil.sounds.AdventureSoundUtils.getAdventureSound(AdventureSoundUtils.java:16) ~[Skript.jar:?]
at ch.njol.skript.bukkitutil.sounds.AdventureSoundUtils.playSound(AdventureSoundUtils.java:43) ~[Skript.jar:?]
at ch.njol.skript.bukkitutil.sounds.SoundReceiver$PlayerSoundReceiver.playSound(SoundReceiver.java:46) ~[Skript.jar:?]
at ch.njol.skript.effects.EffPlaySound.execute(EffPlaySound.java:190) ~[Skript.jar:?]
at ch.njol.skript.lang.Effect.run(Effect.java:49) ~[Skript.jar:?]
at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:61) ~[Skript.jar:?]
at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:88) ~[Skript.jar:?]
at ch.njol.skript.lang.Trigger.execute(Trigger.java:52) ~[Skript.jar:?]
at ch.njol.skript.SkriptEventHandler.lambda$execute$2(SkriptEventHandler.java:183) ~[Skript.jar:?]
at ch.njol.skript.SkriptEventHandler.lambda$execute$3(SkriptEventHandler.java:194) ~[Skript.jar:?]
at ch.njol.skript.util.Task.callSync(Task.java:164) ~[Skript.jar:?]
at ch.njol.skript.util.Task.callSync(Task.java:148) ~[Skript.jar:?]
at ch.njol.skript.SkriptEventHandler.execute(SkriptEventHandler.java:192) ~[Skript.jar:?]
at ch.njol.skript.SkriptEventHandler.check(SkriptEventHandler.java:138) ~[Skript.jar:?]
at ch.njol.skript.SkriptEventHandler$PriorityListener.lambda$new$0(SkriptEventHandler.java:64) ~[Skript.jar:?]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:76) ~[purpur-api-1.18.2-R0.1-SNAPSHOT.jar:git-Purpur-1632]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[purpur-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:671) ~[purpur-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at net.minecraft.server.players.PlayerList.postChunkLoadJoin(PlayerList.java:363) ~[purpur-1.18.2.jar:git-Purpur-1632]
at net.minecraft.server.players.PlayerList.lambda$placeNewPlayer$1(PlayerList.java:305) ~[purpur-1.18.2.jar:git-Purpur-1632]
at net.minecraft.server.network.ServerGamePacketListenerImpl.tick(ServerGamePacketListenerImpl.java:320) ~[?:?]
at net.minecraft.network.Connection.tick(Connection.java:576) ~[?:?]
at net.minecraft.server.network.ServerConnectionListener.tick(ServerConnectionListener.java:231) ~[?:?]
at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1651) ~[purpur-1.18.2.jar:git-Purpur-1632]
at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:522) ~[purpur-1.18.2.jar:git-Purpur-1632]
at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1483) ~[purpur-1.18.2.jar:git-Purpur-1632]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1247) ~[purpur-1.18.2.jar:git-Purpur-1632]
at net.minecraft.server.MinecraftServer.lambda$spin$1(MinecraftServer.java:321) ~[purpur-1.18.2.jar:git-Purpur-1632]
at java.lang.Thread.run(Thread.java:1570) ~[?:?]

Other

No response

Agreement

  • I have read the guidelines above and affirm I am following them with this report.
@erenkarakal
Copy link
Member

Likely due to Purpur 1.18.2 running Adventure 4.11 or lower

@erenkarakal erenkarakal added the bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. label Oct 18, 2024
@erenkarakal
Copy link
Member

erenkarakal commented Nov 8, 2024

After going through the code I couldn't find the issue so I ran a clean 1.18.2 server setup (with only Skript 2.9.4 and ViaVersion installed) to test it for myself. I couldn't reproduce this issue both with Paper (git-Paper-388) and Pufferfish (git-Pufferfish-72). Perhaps your 1.18.2 builds are old?
This is the code I used:

on join:
  play sound "minecraft:ui.button.click" to player

@erenkarakal erenkarakal added cannot reproduce An issue that cannot be replicated. and removed bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. labels Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cannot reproduce An issue that cannot be replicated.
Projects
None yet
Development

No branches or pull requests

2 participants