i would like to know how to get the player who used a commands display name and store it as a string, getDisplayname(); does not work for me, i would also like to know how to send messgaes to that player and how to send them to the whole server thank you
Use Code: player.getName() If you assigned player like this: Code: Player player = event.getPlayer(); Correct me if I'm wrong,
you did but it didnt work. also is there a way to check if a message contains a certain word and change just that word? Iknow how to get and set player messages but i was to check the message for certain words and just replace that word
This forum is for support developing plugins, not learning basic Java. A quick visit to your favourite search engine will yield the answers you are looking for.
Code: String name = "derpderpderp"; if (name.indexOf("derp") != -1) { System.out.println("Herp derp?"); } else { System.out.println("Cannae find derp"); } I also gave you the way to do it. I gave you "broadcastMessage(string);". It works perfectly, you just need to know how to use it.