Play Custom Resourcepack Sound

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the community!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

RaikaS

Active Member
Apr 6, 2018
53
1
0
Skript Version (do not put latest): 2.2 (dev36)
Skript Author: Bensku
Minecraft Version: 1.12.2
---
Full Code:
code_language.skript:
command /soitaääni [<text>]:
  trigger:
    play raw sound arg-1 at player with pitch 1 volume 10
    send "Yritetään soittaa ääni %arg-1%"

My sound file:
code_language.skript:
{
  "kuolemanloukku.sähköisku": {
    "category": "neutral",
    "sounds": [
      "kuolemanloukku/sahkoisku1",
      "kuolemanloukku/sahkoisku2",
      "kuolemanloukku/sahkoisku3",
      "kuolemanloukku/sahkoisku4"
    ]
  },
  "kuolemanloukku.pieru": {
    "category": "neutral",
    "sounds": [
      "kuolemanloukku/pieru1",
      "kuolemanloukku/pieru2",
      "kuolemanloukku/pieru3"
    ]
  },
  "kuolemanloukku.taputa": {
    "category": "neutral",
    "sounds": [
      "kuolemanloukku/taputus1",
      "kuolemanloukku/taputus2",
      "kuolemanloukku/taputus3",
      "kuolemanloukku/taputus4",
      "kuolemanloukku/taputus5",
      
    ]
  },
  "kuolemanloukku.tuuli": {
    "category": "neutral",
    "sounds": [
      "kuolemanloukku/tuuli1",
      "kuolemanloukku/tuuli2",
      "kuolemanloukku/tuuli3",
      "kuolemanloukku/tuuli4",
      "kuolemanloukku/tuuli5",
      "kuolemanloukku/tuuli6",
      "kuolemanloukku/tuuli7",
      "kuolemanloukku/tuuli8",
      "kuolemanloukku/tuuli9",
      "kuolemanloukku/tuuli10",
      
    ]
  }
}
Errors on Reload:

No errors.
Command does not play sound when i do /soitaääni kuolemanloukku.pieru
Console Errors:
JustRaikas [7aba2df4-bde5-4ed4-91ba-246379f78ecd]: /soitaääni kuolemanloukku.pieru
[14:23:03] [Server thread/WARN]: java.lang.NoSuchMethodException: net.minecraft.server.v1_12_R1.WorldServer.makeSound(double, double, double, java.lang.String, float, float)
[14:23:03] [Server thread/WARN]: at java.lang.Class.getMethod(Class.java:1786)
[14:23:03] [Server thread/WARN]: at com.w00tmast3r.skquery.elements.effects.EffCustomSound.execute(EffCustomSound.java:38)
[14:23:03] [Server thread/WARN]: at ch.njol.skript.lang.Effect.run(Effect.java:52)
[14:23:03] [Server thread/WARN]: at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:61)
[14:23:03] [Server thread/WARN]: at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:89)
[14:23:03] [Server thread/WARN]: at ch.njol.skript.lang.Trigger.execute(Trigger.java:55)
[14:23:03] [Server thread/WARN]: at ch.njol.skript.command.ScriptCommand.execute2(ScriptCommand.java:285)
[14:23:03] [Server thread/WARN]: at ch.njol.skript.command.ScriptCommand.execute(ScriptCommand.java:242)
[14:23:03] [Server thread/WARN]: at ch.njol.skript.command.Commands.handleCommand(Commands.java:257)
[14:23:03] [Server thread/WARN]: at ch.njol.skript.command.Commands$1.onPlayerCommand(Commands.java:172)
[14:23:03] [Server thread/WARN]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[14:23:03] [Server thread/WARN]: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[14:23:03] [Server thread/WARN]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[14:23:03] [Server thread/WARN]: at java.lang.reflect.Method.invoke(Method.java:498)
[14:23:03] [Server thread/WARN]: at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:302)
[14:23:03] [Server thread/WARN]: at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
[14:23:03] [Server thread/WARN]: at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:500)
[14:23:03] [Server thread/WARN]: at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:485)
[14:23:03] [Server thread/WARN]: at net.minecraft.server.v1_12_R1.PlayerConnection.handleCommand(PlayerConnection.java:1389)
[14:23:03] [Server thread/WARN]: at net.minecraft.server.v1_12_R1.PlayerConnection.a(PlayerConnection.java:1232)
[14:23:03] [Server thread/WARN]: at net.minecraft.server.v1_12_R1.PacketPlayInChat.a(PacketPlayInChat.java:45)
[14:23:03] [Server thread/WARN]: at net.minecraft.server.v1_12_R1.PacketPlayInChat.a(PacketPlayInChat.java:1)
[14:23:03] [Server thread/WARN]: at net.minecraft.server.v1_12_R1.PlayerConnectionUtils$1.run(SourceFile:13)
[14:23:03] [Server thread/WARN]: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[14:23:03] [Server thread/WARN]: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[14:23:03] [Server thread/WARN]: at net.minecraft.server.v1_12_R1.SystemUtils.a(SourceFile:46)
[14:23:03] [Server thread/WARN]: at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:748)
[14:23:03] [Server thread/WARN]: at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:406)
[14:23:03] [Server thread/WARN]: at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:679)
[14:23:03] [Server thread/WARN]: at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:577)
[14:23:03] [Server thread/WARN]: at java.lang.Thread.run(Thread.java:748)

:emoji_grinning:
 
Both didn't work.
I dont have error to send (on mobile) now, but the resourcepack is not server-resourcepack on server.properties.
 
Both didn't work.
I dont have error to send (on mobile) now, but the resourcepack is not server-resourcepack on server.properties.
Thats odd it didnt work for you
I have it working just fine.
Here is a sample code of how I would use it
code_language.skript:
play sound "cricket" with volume 1 and pitch 1 at location of player for player
And here is a sample of how it loops in my resource pack's sound.json file
code_language.skript:
{
  "cricket": {
    "sounds": [
         "cricket1",
        "cricket2",
        "cricket3",
        "cricket4"
    ]
  },
    "frog": {
    "sounds": [
         "frog1"
    ]
  }
}
 
Status
Not open for further replies.