can someone please make an example for a toggle command with which you can turn the join message on and off even if it's spoonfeeding. i just want an example Please accept that.
@AddventureTime We don't spoonfeed here. Make a boolean, have a command to change it. If you have issues then please share them.
@AddventureTime https://bukkit.gamepedia.com/Event_API_Reference That should be a good start. Event you want is the PlayerJoinEvent
That does not mean that I am scared of a virus, it means that I can't be bothered to download a zip. replaceAll does not take null as arguments -.-
I'd highly recommend you learn to read a stack trace. As timtower said, you can't use null there. The trace tells you specifically what is wrong and even where the problem is. Why are you implementing Listener in your command class (the JoinQuitToggle_command). You do not actually have a listener in there. Also why check if the sender is a Player? Nothing you do requires a Player. It's best to not arbitrarily restrict command usage. Further you should be using the ChatColor enum, not embedding the color character. The way you are using four static variables to handle two messages is also a little weird. It would make more sense to me if you are going to static the variables to one of those classes to attach it to the listener that actually uses it directly, but honestly I wouldn't do it that way either. Oh, one other thing I just saw. You don't need to check for wildcards when doing perm checks. That's the purview of the permissions manager, not you. Lastly I'd suggest you consider negative check and return instead of positive checks, it will reduce a lot of that indentation. Personally, I hate when code looks like a huge greater than symbol lol