EDIT: Think I figured out whats the problem, didn't check the event block *faceplam*, Ill try to fix it, meanwhile, other question anyone? EDIT 2: I Fixed it, I guess I just need help on the other question: how do I split messages from PlayerChatEvent for word after word?
@Tamir What have you tried so far? the structure is: A loop running through the word array from the message (See String class documentation for more)
@Tamir Each time the event runns, loop through the words in the message string (see String#split(String regex) and if the word matches whatever ypi want do any action
@mine-care Okay, learned a bit about splits, I have a string and its splited into it. but it got me only one string?
@mine-care Sure, and yea. Code: String cg = getConfig().getString(p.getName()); for(String split : cg.split(" ")){ p.sendMessage(split); } I want every word in a different color
Err you are spliting 2 spaces :/ (" ") instead of (" ") KaBoom! Now it should split spaces just fine :- )
@mine-care I know that, But its not my problem, I fixed it to one. You dont get it, I want to get any word in the spaces I want the chat to come out like this: This is how its supposed to be
So you want it to follow the zig zag patern; it is a matter of loop enchancement use a boolean turning true/false in every run of the loop if it is true get the word and add it to a string builder else do nothing but changing the Boolean to true :- ) Ik it sounds complex but asap I'll send an example sudo code