Page 1 of 1
Minecraft / Bukkit Plugin Tutorials
Posted: Wed Oct 05, 2011 1:50 am
by Samuel98
Content deleted.
Re: Minecraft / Bukkit Plugin Tutorials
Posted: Wed Oct 05, 2011 5:06 pm
by jacek
Getting the location would be possible from the IP, but it would not be that easy. The other things are pretty easy
You can use the PLAYER_JOIN event for when people join the server and the PLAYER_QUIT event for when the leave. Then all you need to know how to do is send a message to everyone on the server.
plugin.getServer().broardcastMessage("What you want to say.");
Re: Minecraft / Bukkit Plugin Tutorials
Posted: Wed Oct 05, 2011 5:47 pm
by Samuel98
Content Deleted
Re: Minecraft / Bukkit Plugin Tutorials
Posted: Wed Oct 05, 2011 7:16 pm
by jacek
Well you can get the IP if you have the player which you do from the event
Player player = event.getPlayer();
and then you can use getAddress() which will give you the IP, and the port I think.
Yo get the location you will then need some kind of geolocation database, I have used
this one before which seems to work nicely.
For the command
[syntax]/i ITEM-ID AMOUNT[/syntax]
The command is /i and the other bits are arguments, they are stored in the args[] parameter from the onCommand() method.
Oh, to get the list of online players you can do
Player[] players = plugin.getServer().getOnlinePlayers()
so to loop over all players and output the list as a list
for (Player player : plugin.getServer().getOnlinePlayers()){
plugin.getServer().broadcastMessage(player.getName());
}
Re: Minecraft / Bukkit Plugin Tutorials
Posted: Wed Oct 05, 2011 7:47 pm
by Samuel98
Content Deleted
Re: Minecraft / Bukkit Plugin Tutorials
Posted: Wed Oct 05, 2011 11:20 pm
by Samuel98
Content Deleted
Re: Minecraft / Bukkit Plugin Tutorials
Posted: Thu Oct 06, 2011 8:10 pm
by jacek
You can disable that somehow, the plugin Essentials does it somehow. Basically, I don't know. But look at the source of a plugin that does it already.
Re: Minecraft / Bukkit Plugin Tutorials
Posted: Thu Oct 06, 2011 8:38 pm
by Samuel98
Content Deleted
Re: Minecraft / Bukkit Plugin Tutorials
Posted: Fri Oct 07, 2011 1:04 am
by Samuel98
Content Deleted
Re: Minecraft / Bukkit Plugin Tutorials
Posted: Sun Oct 09, 2011 10:44 pm
by Samuel98
Content Deleted
Re: Minecraft / Bukkit Plugin Tutorials
Posted: Mon Oct 10, 2011 7:28 pm
by jacek
I don't know really, this page can do IP to country
http://www.ip2nation.com/ip2nation but I don't really know how best to do it in Java as a plugin.