import org.bukkit.ChatColor; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.player.AsyncPlayerChatEvent; import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.server.ServerListPingEvent; import org.bukkit.plugin.java.JavaPlugin; public class Combo extends JavaPlugin implements Listener { public void onEnable() { getServer().getPluginManager().registerEvents(this, this); } public void onPlayerJoin(PlayerJoinEvent event) { Player player = event.getPlayer(); // Whenever a player joins the server, set/reset the player's // flying and walking speeds to their default values; note // that for walking, a speed of 0.1 is the "sneaking" speed player.setFlySpeed(0.1F); player.setWalkSpeed(0.2F); } public void onplayerChat(AsyncPlayerChatEvent event) { // Change the appearance (formatting and colors) of the player // names and messages in the 'chat' area; note that the first // occurrence of "%s" refers to the player's name, and the // second occurrence of "%s" refers to the player's message event.setFormat(ChatColor.GREEN + "%s" + ChatColor.YELLOW + ChatColor.BOLD + " > " + ChatColor.WHITE + "%s"); } public void onServerListPing(ServerListPingEvent event) { // This line doesn't affect the actual number of users who // can be connected to the server at any one time, but it // does cause the value to be displayed in the multiplayer // server list of each user's client program event.setMaxPlayers(25); // This section controls what is displayed on line #2 and // line #3 for each server in the multiplayer server list // of each user's client program; it overrides the "MOTD" // field in the 'server.properties' file String motdPart1 = "\u00a7cRedwood High School\u00a7f, \u00a79Larkspur, California\n"; String motdPart2 = "\u21e8\u21e8\u00a7l \u00a7r"; String motdPart3 = "\u00a77A Whitelist Server for RHS Students"; String motdPart4 = "\u00a7l \u00a7r\u00a7c\u21e6\u21e6"; event.setMotd(motdPart1 + motdPart2 + motdPart3 + motdPart4); } }