Hey im brand new to java and bukkit. Im trying to convert a Player type variable to a String. I'm trying to put a player's username on a sign when they place it
getName() is always going to return a static name for the player. Display name will end up retrieving information from things such as nick-name plugins, so it can vary.
Code: public void onSignChange(SignChangeEvent event) { Player p = event.getPlayer(); event.setLine(0, "&4"+p.getName()); Thats what you're looking for. On setLine, change 0 to 1,2,3 for the 2nd 3rd and 4th line, and change &4 to another number to change colour. 4 is Red, just remove the number and & to remove colour changes.