Player locking handler and API 1.0.0

Used by my plugins (or yours!) to lock players in place

  1. HopperElec
    Native Minecraft Version:
    1.16
    Tested Minecraft Versions:
    • 1.16
    Source Code:
    https://github.com/HopperElec/Stunner
    If you're here and a server administrator, you've most likely came from another resource that has said you need this plugin for it to work. Simply add this plugin to your plugins folder and you're off! You can then use /stun or /unstun to manually manage the stunning of players

    If you're a developer and wish to use this plugin's API for your project, you must use Maven. This is obvious for most, but if you're not using it, I highly recommend you start doing so! (and if you use Gradle... I'm sorry for you)

    In the <repositories> tag in the pom.xml, add this code:
    Code (Text):

    <repository>
      <id>stunner</id>
      <url>https://github.com/HopperElec/Stunner</url>
    </repository>
    And in the <dependencies> tag, add this code:
    Code (Text):
    <dependency>
      <groupId>uk.co.hopperelec.mc</groupId>
      <artifactId>stunner</artifactId>
      <version>1.0.0</version>
    </dependency>
    Once you've added it through Maven and refreshed it, you then need to add it as a dependency in the plugin.yml. To do this, simply add this:
    Code (YAML):
    depend: [Stunner]
    Now you should be good to go!

    To access the plugin, use this code:
    Code (Java):
    Bukkit.getPluginManager().getPlugin("HopperParty");
    And cast it to (HopperParty). I recommend, as a safety precaution, to makes sure the plugin isn't null, though. So you should end up with code looking like this:
    Code (Java):
    final Plugin stunPlugin = Bukkit.getPluginManager().getPlugin("Stunner");
    if (partyPlugin == null) {
      System.out.println("Failed to get stunner plugin class! Cancelling start-up of the plugin!");
      setEnabled(false); return;
    }
    HopperParty stunClass = (Stunner) stunPlugin;
    From there, your IDE should be able to guide you after typing stunClass then a dot somewhere in your code! Have fun :D