<inputtype="search" name="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
<p>Formally, the CommandAPI <strong>does not</strong> support plugin reloading. This includes, but is not limited to:</p>
<ul>
<li>The <code>/reload</code> command which reloads all plugins on the server</li>
<li>Plugin reloading plugins, such as <ahref="https://dev.bukkit.org/projects/plugman">PlugMan</a></li>
<li>Any form of plugin enabling/disabling process for plugins which register commands via the CommandAPI</li>
</ul>
<p>Despite this, there is one way to get reloading to work using the <code>onDisable()</code> method in your plugin. If you register a command in your <code>onLoad()</code> or <code>onEnable()</code> method, by unregistering the command in your <code>onDisable()</code> method, this allows the CommandAPI to properly register the command again when the server reloads.</p>
<divclass="warning">
<p><strong>Developer's Note:</strong></p>
<p>Despite the fact that you can do this, I cannot stress enough that <strong>this is not recommended</strong>, due to the fact that <strong>functions/tags in datapacks do not work with <code>/reload</code>, even if you unregister the command</strong>.</p>
</div>
<divclass="example">
<h3id="example---allowing-a-command-to-work-with-reload"><aclass="header" href="#example---allowing-a-command-to-work-with-reload">Example - Allowing a command to work with /reload</a></h3>
<p>In this example, we add support for reloading the server via <code>/reload</code> by unregistering the command in the <code>onDisable()</code> method. Note that force-unregistering is not required for this:</p>
<pre><codeclass="language-java">public class MyPlugin extends JavaPlugin {