I'm currently coding a Vanish plugin but since the newer versions have changed it with the hideplayer / showplayer, I currently have a problem so I don't know what to add that I go to the Vanish, I hope you could help somehow
I have the problem with:
for (Player all: Bukkit.getOnlinePlayers ()) {
all.showPlayer (plugin, player);
for (Player all: Bukkit.getOnlinePlayers ()) {
all.hidePlayer (plugin, player);
I think you have to do it now via the player interface.
The plugin needs to be your main class that inherits from JavaPlugin. The easiest way to get it is with Hauptklasse.getPlugin (Hauptklasse.class), you have to change the name of course.
The player is the player you want to hide or show, you have already saved it under the variable name "p" (which should be changed because it is not meaningful).
And how does it work exactly?
So have now packed it in the main class
you mean it right?
Unfortunately I can't see your change
I have inserted the code for the vanish command in the main, I have not done more
Screenshot 1:
Screenshot 2:
what do I have to change right now?
Replace player with p and write "this" instead of plugin (without quotation marks). I just don't know how you came up with it, because I didn't write that. Basically, you should divide different parts of the plugin into different classes.
Have now made the Vanish code into an extra class and changed it as you described it, but now I get an error message in the console when I run the code
Screenshot console:
Screenshot intellij
I also added the code
Plugins.getPlugin (Plugins.class);
now it looks exactly like this:
but the error message in the console is still displayed
Here is the new method: https://hub.spigotmc.org/...ty.Player)
The problem is I don't know how to use it, that's the problem
Instead of this "(Plugin) this" you should write "Plugins.getPlugin (Plugins.class)".
I say thank you for your help
Just download a plugin.