1

Modders, I need haylp!

Rawstrus's Avatar Rawstrus12/22/13 6:08 pm
1 emeralds 167 3
12/24/2013 10:52 am
Rawstrus's Avatar Rawstrus
OK, so I am making a plugin for my friend, it's quite simple.
I just don't understand how this is not working... It only sends the sound to one online player instead of everyone..

Here's my code:

for (Player pl : Bukkit.getServer().getOnlinePlayers()) {
pl.playSound(pl.getLocation(), configSound, 1, 1);
}
return true;


This is in an onCommand btw.
I hope someone can help explain why this isn't working, thanks

-XtremeGamer572
Posted by Rawstrus's Avatar
Rawstrus
Level 40 : Master Nerd
28

Create an account or sign in to comment.

3

12/24/2013 10:44 am
This reply was removed by the poster or a moderator.
1
12/24/2013 10:52 am
Level 40 : Master Nerd
Rawstrus
Rawstrus's Avatar
I shouldn't think so, otherwise I would get errors, or no one would be able to hear the sound. Only one person on the server can hear it, or maybe one person on the server cannot hear it, not sure, but when someone dies, the player that it chooses to send the sound to changes, even though I have nothing in a onDeathEvent event.

Bukkit seems to hate me.. xD
1
12/22/2013 6:27 pm
Level 51 : Grandmaster Narwhal
Giraffestock
Giraffestock's Avatar
What are the parameters of playSound in Player? You could be sending to just one person. (Not very experienced with Bukkit)
1
12/24/2013 10:36 am
Level 40 : Master Nerd
Rawstrus
Rawstrus's Avatar
for (Player pl : Bukkit.getServer().getOnlinePlayers()) {
That right there is making pl (Players) be equal to all online players. I am really confused, because I used the exact same code as in my other plugin, which works perfectly.
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome