Hello Guys.. again I try so set a kick/ban reason but 1 arg is only 1 word soo.. how can i set a banreason like "You are banned" with spaces between the words ? Thx
Go learn Java. Also, your code should look like this. Code (Java): player.kickPlayer("You have been kicked");
No, i dont want a finished message, i want to make one ingame /kick <Player> <Reason> BUT the <Reason> has more than 1 Word at the moment when i kick a player i only can write 1 word for the reason
Your arguments array will contain all the words in the command. So if I type /kick AvroVulcan Using fly hacks My arguments array will look something like this: ["AvroVulcan", "Using", "fly", "hacks"] So, you need to get all arguments beyond the name of the player and get them all into a single string. To do this you can use a String Builder or just basic string concatenation.
You'll need to join your arguments, which can be done easily with String.join " " is the delimiter, meaning each element will be separated with a space Code (Java): String reason = String.join(" ", args); Assuming you need different arguments than just the ban reason though, you can use Arrays.copyOfRange to get only a certain range of elements from a different array, i.e.: your args array, from the index of the start of the reason to the end of the array