Solved Send packet with custom sound from resourcepack

Discussion in 'Plugin Development' started by PDKnight, Mar 24, 2015.

Thread Status:
Not open for further replies.
  1. Offline


    Hi Bukkit (Again),
    I have another question, if is there a way, how to send a sound packet for player with the sound from resourcepack? I have DMR.ogg in /sounds directory in RP, for example. I've been finding the solution for hours, but I didn't find a great one, but only this site ( should be helpful. But okay, I know, which parameters I should use, but I don't know how :(. So if is there any example how to do it, can you please paste it there?
  2. Offline


    You can't use playSound(loc, sound, int, int); ?
  3. Offline


    I can, but what to type in sound property?
  4. Offline


  5. Offline


    @sgavster It doesn't work. I've tried 6 variations of the property: Sounds.DMR.ogg, Sounds.DMR, Sound.DMR.ogg, Sound.DMR, sound.DMR.ogg, sound.DMR...
    My code:
    2. @SuppressWarnings("deprecation")
    3. public boolean onCommand(final CommandSender sender, final Command cmd, final String commandLabel, final String[] args) {
    4. if(sender instanceof Player) {
    5. Player player = (Player) sender;
    6. if(commandLabel.equalsIgnoreCase("csd")) { //CraftSounds play DMR
    7. Location l = player.getLocation();
    8. player.playSound(l, "sound.DMR.ogg", 1F, 1F);
    9. player.sendMessage("Playing sound...");
    10. }
    11. }
    12. return false;
    13. }
  6. Offline


    PDKnight likes this.
  7. Offline


    @xTigerRebornx OH GOOOOOOOOODDDDDDD It works perfectly!!! Many thanks dude!
  8. Offline


    @PDKnight Please mark your thread as solved! See this for more info.
Thread Status:
Not open for further replies.

Share This Page