One of the most common problems beginners run into is that of /reload. New server owners will use the command thinking that it will simply reload all of their plugins, cleanly and nicely. The lure of /reload is enticing – it offers to reload plugins without having to restart the server. Particularly on servers with long startup times, reloading with /reload appears a useful shortcut.
But it is actually one of the most dangerous commands known to Minecraft.
A user on discord, jiggey, once came to me on a support channel for a plugin I was helping out with. The exception jiggey received was very fascinating. It basically summed down to:
java.lang.ClassCastException: com.pablo67340.guishop.commands.GuishopUserCommand cannot be cast to com.pablo67340.guishop.commands.GuishopUserCommand
Extraordinary! The JVM said that a class cannot be cast to its very own self. For the non-developers, this basically means that the class is not equal to itself, that a class is not compatible with its self. A class is a component of a Java program.
jiggey reported using the /reload command. It was then that I realised the further implications of /reload. You see, /reload unloads and reloads a plugin entirely. When it does this, it also unloads and reloads the plugin classloader. So, your server re-defines the classes in a plugin, creating duplicate definitions of each class.
This is catastrophic. When the new version of the plugin uses something defined using the old class, everything completely breaks, since the plugin expects its own classes to truly be its own classes.
Since jiggey, other users have had the same error, with the same cause. The problems of /reload are not one-time.
Many, many plugins will tell you NOT to use /reload, because it breaks plugins. Sometimes, it is because these plugins do hacky things like inject channel handlers.
But as demonstrated, even simple plugins can break entirely due to /reload. This is because /reload does something that is really not supposed to happen in Java. Normally, the program starts up as usual, and all the required classes are loaded at startup. Classes are not unloaded and re-defined during the server's operation, but if they are, references to them are cleared first, so none of the old objects persist. Basically, a plugin has to be explicitly coded to support /reload if you want to be sure it is safe.
If you don't take my word for it, listen to all the others who understand how problematic /reload is.
yeah everytime i used to /reload before i was informed to not do so, it always crashed worldedit and guard and many others
-– AmpExxtreme, discord
/reload was almost removed from PaperMC. You can see here: PaperMC/Paper#3000
PlugMan is no different from /reload. It "reloads" plugins in the exact same way. So don't even think about it. Either restart your server, or use a plugin-provided reload command. Most plugins will provide a /pluginname reload
command which is a SAFE reload.
In fact, PlugMan might be worse than /reload! There are some technical things it doesn't do which /reload does.