Create Plugin Tutorial?

  • Does anybody have a video tutorial regarding scripting new plugins? Nobody seems to show how to make plugins, only how to install plugins they downloaded. I've read both Getting Started and the Create a Plugin threads, and while they may make sense to someone experienced with Java tools, it seems as though I'm doing something wrong. It would help to see somebody set up a project from scratch, so a novice can see how to properly package a plugin. I recreated one of the scripts from the Create a Plugin thread to see if I can even load a plugin, but I'm not sure it's being compiled correctly. I'm using IntelliJ IDEA. My code is as follows:


    When I build the solution, it creates an output folder structured as follows:


    I'm guessing everything in the production is compiled into the loose JAR file, but when I put it in the Plugins folder for the New Version, nothing happens. I don't know it I set the Module up incorrectly or if it has something to do with the fact IntelliJ isn't recognizing the @Override lines. Any thoughts?

  • The code above looks fine (except the "1 usage" and "no usage" in lines 7 and 17, but that doesn't seem to be part of the code?).

    According to the folder structure, you will find the built plugin in the "artifacts" folder. Basically you just need the "TestPlugin.jar" file (unless you're using external assets like images or models, but that's a different story). Just move the "TestPlugin.jar" file into a separate folder in the "Plugins" dir, so it could look like this:

    Code
    Rising World
    |__ Plugins
    |__ TestPlugin
    |__ TestPlugin.jar


    When launching the game and loading a world, you should see the "Server name:" and "World Name:" output in the console/log. If that doesn't work, do you mind uploading the TestPlugin.jar here, so I can take a closer look at it? :)


    I've read both Getting Started and the Create a Plugin threads, and while they may make sense to someone experienced with Java tools, it seems as though I'm doing something wrong. It would help to see somebody set up a project from scratch, so a novice can see how to properly package a plugin

    Unfortunately the "Getting Started" and the "Create a Plugin" threads are a bit outdated... the content is still mostly valid for the new version, but we definitely want to rework them soon. We'll do that after the store page update ^^

  • The code above looks fine (except the "1 usage" and "no usage" in lines 7 and 17, but that doesn't seem to be part of the code?).

    You're correct. The "usage" lines are an internal feature of the IDE. I added it for illustration. I'm not sure why it says that when I can clearly see that there's logic in the method. I don't run into this very often when using C# in VisualStudio.

    When launching the game and loading a world, you should see the "Server name:" and "World Name:" output in the console/log. If that doesn't work, do you mind uploading the TestPlugin.jar here, so I can take a closer look at it? :)

    Absolutely, thank you. I'll attach the file. I added the JAR file with exactly the folder structure you mentioned. Although, when I went into the game and opened the console with the Tilde (~) key, the logs were empty. To make sure I was in the right log, I type in some console commands, looking for things that referenced System, Print, Plugin. The console seemed to be in working order, so I assumed it was my script.

    I converted the JAR to ZIP, inspected the folder structure, and it seemed fine. The yml file, class file, and manifest were all there. I don't know what the issue is. This is the first time I'm using an API, so I'm still figuring out how to hook into the methods and events. This is the reason I tried starting with some simple print strings before tackling more complex stuff like adding "modifiers," or so-called stats, to some of the clothes. I like some of the hats, but at the moment, the mining helmet is reasonably the most functional option. Haha once I understood importing and hooking, I thought I'd try making the chef hat reduce cooking time, the bear mask affecting the bear's aggression, or the camo hat affecting how close I can get to deer before they run off. That sort of thing.

    TestPlugin.jar

  • println will print to the games console not the console with the tilda key.



    begin with something like this


    this will send "test text" to the chat window for the player running the command (/test)


    ive been thinking of puting together a small discord for plugin development. let me know if you would be interested.

Participate now!

Don’t have an account yet? Create a new account now and be part of our community!