Plugin Development

  • Views Views: 4,547
  • Last updated Last updated:
  • Sub-pages:



    Create a New Project

    1. Create a new Maven Project, click next until you get to the Archetype and Catalog screen.

    2. Click Configure.

    3. Add a remote catalog.

    4. Add the Catalog File URL Click Ok, then Apply and Close.

    5. Press Ok and select NukkitX from the Catalog.

    6. Uncheck "Show the last version of Archetype only" and select Version 1.0 to create a Nukkit 1.0 plugin.

    7. Fill in the Group Id and Artifact Id for your plugin. The Artifact Id is the name used for creating the final .JAR file.

    8. The project will now be created. It may take a few minutes for Maven to download and set everything up. The project package might be incorrect; if this is the case, mouse-over the package name and select the Move to package quick fix.. Add the following line of code to the onLoad() function:
    this.getLogger().info("MyFirstPlugin has loaded!");

    9. Next we need to create a new Run Configuration.

    10. Add "clean install" to the Goals field. Then click Workspace, select your plugin, and press OK. Now press Apply and then Run. Maven will now build the .JAR file. You must click on your project name in the Project Explorer on the left and press F5 to see the newly built .JAR file. Move this file to your NukkitX plugins folder to use it.

    To change the name of your plugin from MyPlugin, open the pom.xml file and change it in between the <name></name> tags. The version of your plugin can be changed in the <version></version> tags below the name.
  • Loading…
  • Loading…