Hello guys. I have decided to develop my own plugin, but the sound doesn't work through the java methods. I have this code(it works if I use minecraft sounds): Code: @EventHandler public void join(PlayerJoinEvent e) { Player p = e.getPlayer(); p.sendMessage("Hello, " + p.getDisplayName()); p.playSound(p.getLocation(), "prayer.after_praying", 1.0f, 1.0f); } I have structure of my server resourcepack: Structure (Move your mouse to reveal the content) Structure (open) Structure (close) Resourcepack's sounds.json: sounds.json (Move your mouse to reveal the content) sounds.json (open) sounds.json (close) Code: { "prayer.after_praying": { "category": "master", "sounds": [ { "name": "prayer/after_praying", "stream": true } ] } } 1. If I play the embedded sounds it works great. 2. If I use /playsound command it works too. 3. If I use playSound method with custom sound it doesn't work
As far as I know, you cannot add new sounds to minecraft without using a modified game (mods). You will have to override existing sounds in minecraft with your own.
@MrDaniel - I believe it is possible to do. Also @Idol did mention that it worked through commands but not in methods so that means it does work as it work go either way. So you can add new sounds. Makes no sense if it works through commands but not through a plugin. If what I am getting from Idol is correct.
playSound method will only let you play a sound from here: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Sound.html