Play sound isn't working.

Discussion in 'Plugin Development' started by TGamingStudio, Sep 24, 2017.

Thread Status:
Not open for further replies.
  1. Hello i want to play sound after command .

    Code:
    Player p = (Player) sender;
    p.getWorld().playSound(p.getLocation(), Sound.GHAST_SCREAM, 1, 1);
    
    It does't work... i have looked a much threads and videos... but it doesn't work...

    It writes An iternal error ocurned...

    and to console :
    Code:
    rver command: /trash
    [16:23:02 ERROR]: null
    org.bukkit.command.CommandException: Unhandled exception executing command 'trash' in plugin TrashCan v1.0
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[craftbukkit.1.12.jar:git-Bukkit-9a1fc1e]
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:140) ~[craftbukkit.1.12.jar:git-Bukkit-9a1fc1e]
            at org.bukkit.craftbukkit.v1_12_R1.CraftServer.dispatchCommand(CraftServer.java:621) ~[craftbukkit.1.12.jar:git-Bukkit-9a1fc1e]
            at net.minecraft.server.v1_12_R1.PlayerConnection.handleCommand(PlayerConnection.java:1326) [craftbukkit.1.12.jar:git-Bukkit-9a1fc1e]
            at net.minecraft.server.v1_12_R1.PlayerConnection.a(PlayerConnection.java:1186) [craftbukkit.1.12.jar:git-Bukkit-9a1fc1e]
            at net.minecraft.server.v1_12_R1.PacketPlayInChat.a(SourceFile:37) [craftbukkit.1.12.jar:git-Bukkit-9a1fc1e]
            at net.minecraft.server.v1_12_R1.PacketPlayInChat.a(SourceFile:9) [craftbukkit.1.12.jar:git-Bukkit-9a1fc1e]
            at net.minecraft.server.v1_12_R1.PlayerConnectionUtils$1.run(SourceFile:13) [craftbukkit.1.12.jar:git-Bukkit-9a1fc1e]
            at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_144]
            at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_144]
            at net.minecraft.server.v1_12_R1.SystemUtils.a(SourceFile:46) [craftbukkit.1.12.jar:git-Bukkit-9a1fc1e]
            at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:695) [craftbukkit.1.12.jar:git-Bukkit-9a1fc1e]
            at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:370) [craftbukkit.1.12.jar:git-Bukkit-9a1fc1e]
            at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:650) [craftbukkit.1.12.jar:git-Bukkit-9a1fc1e]
            at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:554) [craftbukkit.1.12.jar:git-Bukkit-9a1fc1e]
            at java.lang.Thread.run(Unknown Source) [?:1.8.0_144]
    Caused by: java.lang.NoSuchFieldError: GHAST_SCREAM
            at me.TomasGamingStudio.Trash.Main.onCommand(Main.java:75) ~[?:?]
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[craftbukkit.1.12.jar:git-Bukkit-9a1fc1e]
            ... 15 more
     
  2. Offline

    Caderape2

  3. @Gaderape2
    Screenshot : https://ctrlv.cz/ZhS8
    no... it isnt blue .. :/ and its error

    @Gaderape2 it started to work with GHAST_SCREAM :eek: :D
    Its error with versions .. :/ its version 1.8.x and i've been used newest...
    http://docs.codelanx.com/Bukkit/1.8/org/bukkit/Sound.html

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    EDIT by Tomas Gaming Studio: ok
     
    Last edited: Sep 24, 2017
  4. Offline

    Caderape2

  5. @Caderape2 plugin is 1.8.x and i am testing all versions .. i had 1.12.x but when i swithced it it sterted to work...
     
  6. Offline

    Zombie_Striker

    @TGamingStudio
    As of 1.10, all sounds were changed. If you want your plugin to support 1.8 and 1.12, you will need to create a util to change the sound names depending on the version.
     
  7. @Zombie_Striker than there are only 1.8 and 1.12 isnt there changes in other versions ? (1.9 or 1.10...)
     
  8. Offline

    Zombie_Striker

    @TGamingStudio
    Besides the sound name changes, there are no real differences to the sound enum since 1.8. That was the only change (however, that is quit a big change).
     
Thread Status:
Not open for further replies.

Share This Page