Last active
August 29, 2015 14:07
-
-
Save Signifies/b570d0d6b1af26683b60 to your computer and use it in GitHub Desktop.
Custom Player Message Method
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Allows you to use basic Methods in the Player class in your message | |
* without having to concatenate in Java. | |
* | |
* */ | |
static public void informPlayer(String msg, Player val) { | |
msg = msg.replaceAll("[playername]",val.getName()); | |
msg = msg.replaceAll("[displayname]",val.getDisplayName()); | |
msg = msg.replaceAll("[playerlistname]",val.getPlayerListName()); | |
msg = msg.replaceAll("[worldname]",val.getWorld().getName()); | |
msg = msg.replaceAll("[IP]","" +val.getAddress()); | |
val.sendMessage(ChatColor.translateAlternateColorCodes('&',msg)); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment