Play sound at coordinates

Discussion in 'Archived: Plugin Requests' started by Byamarro, Aug 1, 2013.

  1. Offline

    Byamarro

    Plugin category: Sounds

    Suggested name: PlaySounds

    What I want: Plugin that be able to play sound at coordinates sent by command executer.


    Ideas for commands: /playsound <Sound ID> <volume> <pitch> <x> <y> <z> <world>

    Ideas for permissions: playsound

    When I'd like it by: ASAP
     
  2. Offline

    xxMOxMOxx

    I can make this for you. It should be ready in a couple hours.
     
  3. Offline

    Byamarro

    Thank You very much! :)
     
  4. Offline

    xxMOxMOxx

    Byamarro
    Before I start I just want to confirm that you know Minecraft already has a /playsound command that can play a sound at a players location so the purpose of this plugin is just to play it at coordinates instead?
     
  5. Offline

    clienthax

  6. Offline

    xxMOxMOxx

    I already called dibs lol.
     
  7. Offline

    clienthax

    done,
    http://uppit.com/ejemxwz860iz/PlaySounds.jar
    permission node
    playsound.playsound
    /playsound2 <Sound ID> <volume> <pitch> <x> <y> <z> <world>

    Sound ids can be found here
    http://jd.bukkit.org/rb/apidocs/org/bukkit/Sound.html

    xxMOxMOxx

    Code:java
    1. package clienthax.playSounds;
    2.  
    3.  
    4. import org.bukkit.Location;
    5. import org.bukkit.Sound;
    6. import org.bukkit.World;
    7. import org.bukkit.command.Command;
    8. import org.bukkit.command.CommandSender;
    9. import org.bukkit.event.Listener;
    10. import org.bukkit.plugin.java.JavaPlugin;
    11.  
    12. public class PlaySounds extends JavaPlugin implements Listener {
    13.  
    14. public void onEnable()
    15. {
    16. getServer().getPluginManager().registerEvents(this, this);
    17. }
    18.  
    19. public boolean onCommand(CommandSender sender, Command command, String label, String[] args)
    20. {
    21.  
    22. if(args.length != 7)
    23. {
    24. sender.sendMessage("/playsound2 <Sound ID> <volume> <pitch> <x> <y> <z> <world>");
    25. }
    26.  
    27. if(sender.hasPermission("playsound.playsound"))
    28. if(command.getName().equalsIgnoreCase("playsound2"))
    29. {
    30.  
    31. String soundID = args[0];
    32. Sound sound = Sound.valueOf(soundID);
    33. String worldName = args[6];
    34. int x = Integer.parseInt(args[3]);
    35. int y = Integer.parseInt(args[4]);
    36. int z = Integer.parseInt(args[5]);
    37. World world = getServer().getWorld(worldName);
    38. Location location = new Location(world, x, y, z);
    39.  
    40. float volume = Float.parseFloat(args[1]);
    41. float pitch = Float.parseFloat(args[2]);
    42. world.playSound(location, sound, volume, pitch);
    43.  
    44. return true;
    45. }
    46.  
    47. return false;
    48. }
    49.  
    50. }
    51.  


    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 3, 2016
  8. Offline

    Byamarro

    Before I start I just want to confirm that you know Minecraft already has a /playsound command that can play a sound at a players location so the purpose of this plugin is just to play it at coordinates instead?

    Didn't knew that. But I really need to play it at coordinates.


    Thanks for plugin! :) It will be really usefull.
     
  9. Offline

    finestizgood

    Welcome
    I would like to inquire about this plugin still available?
    If so I'd appreciate if I would get an upload link.
    thank you :)
     

Share This Page