/warps dont play a sound why??

Discussion in 'Spigot Help' started by arthurmarotto, Apr 18, 2017.

  1. if(cmd.getName().equalsIgnoreCase("warps")){
    Player p = (Player)sender;
    if(p.hasPermission("a.warps")) {
    Inventory inv = (Bukkit.createInventory(null, 3*9, "§cWARPS"));
    ItemStack vidroazul = new ItemStack(Material.STAINED_GLASS_PANE);
    vidroazul.setData(new MaterialData((byte) 4));
    ItemMeta metavidroazul = vidroazul.getItemMeta();
    metavidroazul.setDisplayName(" ");
    vidroazul.setItemMeta( metavidroazul );
    inv.addItem(vidroazul);
    p.openInventory(inv);
    p.playSound(p.getLocation(), Sound.BLOCK_CHEST_OPEN, 10, 10);






    when i /warps it open my GUI but The sound dont go... why?? here is error

    org.bukkit.command.CommandException: Unhandled exception executing command 'warps' in plugin aBooster v0.1
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[spigot.jar:git-PaperSpigot-"8b18730"]
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:143) ~[spigot.jar:git-PaperSpigot-"8b18730"]
    at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchCommand(CraftServer.java:666) ~[spigot.jar:git-PaperSpigot-"8b18730"]
    at net.minecraft.server.v1_8_R3.PlayerConnection.handleCommand(PlayerConnection.java:1189) [spigot.jar:git-PaperSpigot-"8b18730"]
    at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:1001) [spigot.jar:git-PaperSpigot-"8b18730"]
    at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(PacketPlayInChat.java:45) [spigot.jar:git-PaperSpigot-"8b18730"]
    at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(PacketPlayInChat.java:1) [spigot.jar:git-PaperSpigot-"8b18730"]
    at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:13) [spigot.jar:git-PaperSpigot-"8b18730"]
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_121]
    at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_121]
    at net.minecraft.server.v1_8_R3.SystemUtils.a(SourceFile:44) [spigot.jar:git-PaperSpigot-"8b18730"]
    at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:774) [spigot.jar:git-PaperSpigot-"8b18730"]
    at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:378) [spigot.jar:git-PaperSpigot-"8b18730"]
    at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:713) [spigot.jar:git-PaperSpigot-"8b18730"]
    at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:616) [spigot.jar:git-PaperSpigot-"8b18730"]
    at java.lang.Thread.run(Unknown Source) [?:1.8.0_121]
    Caused by: java.lang.NoSuchFieldError: BLOCK_CHEST_OPEN
    at aBooster.GUI.onCommand(GUI.java:37) ~[?:?]
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[spigot.jar:git-PaperSpigot-"8b18730"]
    ... 15 more
    [11:31:12 INFO]: ArthurMarotto issued server command: /warps
    [11:31:12 ERROR]: null
    org.bukkit.command.CommandException: Unhandled exception executing command 'warps' in plugin aBooster v0.1
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[spigot.jar:git-PaperSpigot-"8b18730"]
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:143) ~[spigot.jar:git-PaperSpigot-"8b18730"]
    at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchCommand(CraftServer.java:666) ~[spigot.jar:git-PaperSpigot-"8b18730"]
    at net.minecraft.server.v1_8_R3.PlayerConnection.handleCommand(PlayerConnection.java:1189) [spigot.jar:git-PaperSpigot-"8b18730"]
    at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:1001) [spigot.jar:git-PaperSpigot-"8b18730"]
    at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(PacketPlayInChat.java:45) [spigot.jar:git-PaperSpigot-"8b18730"]
    at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(PacketPlayInChat.java:1) [spigot.jar:git-PaperSpigot-"8b18730"]
    at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:13) [spigot.jar:git-PaperSpigot-"8b18730"]
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_121]
    at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_121]
    at net.minecraft.server.v1_8_R3.SystemUtils.a(SourceFile:44) [spigot.jar:git-PaperSpigot-"8b18730"]
    at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:774) [spigot.jar:git-PaperSpigot-"8b18730"]
    at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:378) [spigot.jar:git-PaperSpigot-"8b18730"]
    at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:713) [spigot.jar:git-PaperSpigot-"8b18730"]
    at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:616) [spigot.jar:git-PaperSpigot-"8b18730"]
    at java.lang.Thread.run(Unknown Source) [?:1.8.0_121]
    Caused by: java.lang.NoSuchFieldError: BLOCK_CHEST_OPEN
    at aBooster.GUI.onCommand(GUI.java:37) ~[?:?]
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[spigot.jar:git-PaperSpigot-"8b18730"]
    ... 15 more
     
  2. try this: p.playSound(p.getLocation(), Sound.CHEST_OPEN, 10, 10);

    I don't know "Sound.BLOCK_CHEST_OPEN"