You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/tutorials/create_your_first_plugin.md
+34-11Lines changed: 34 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,34 +1,51 @@
1
1
# Create Your First Plugin
2
2
3
-
> This guide serves to demonstrate the very simple and straight forward process to creating your first plugin - as well as some best practices when thinking about what to make and how to do it. Experience using JavaScript previously is recommended, but not required. JavaScript is a very beginner friendly language, so don't get overwhelmed!
3
+
> This guide serves to demonstrate the very simple and straight forward process to creating your first plugin - as well
4
+
> as some best practices when thinking about what to make and how to do it. Experience using JavaScript previously is
5
+
> recommended, but not required. JavaScript is a very beginner friendly language, so don't get overwhelmed!
4
6
5
7
## Prerequisites
6
8
7
-
Before developing your first plugin, we will need to set up your developer environment (IDE). The choice of software you use to program is yours, but trusted and reliable software is recommended. [Atom](https://atom.io/) is lightweight editor that works well for this tutorial, otherwise [VSCode](https://code.visualstudio.com/) is also a widely used editor with a lot of powerful features.
9
+
Before developing your first plugin, we will need to set up your developer environment (IDE). The choice of software you
10
+
use to program is yours, but trusted and reliable software is recommended. [Atom](https://atom.io/) is lightweight
11
+
editor that works well for this tutorial, otherwise [VSCode](https://code.visualstudio.com/) is also a widely used
12
+
editor with a lot of powerful features.
8
13
9
-
You will also need to set up a clean LeviLamina installation, details on how to install LeviLamina can be found [here](https://levilamina.liteldev.com/install/). This server will be used to test your plugin.
14
+
You will also need to set up a clean LeviLamina installation, details on how to install LeviLamina can be
15
+
found [here](https://levilamina.liteldev.com/install/). This server will be used to test your plugin.
10
16
11
17
With your IDE in hand, and the server installation complete, you are ready to begin!
12
18
13
19
## What Do I Do Now?
14
20
15
-
Developing a LLSE Plugin begins with creating your plugin's file. This file should be named "LLMyPlugin.js", replacing "MyPlugin" with what you would like to call your plugin. It should be placed in the plugins folder of your server installation. Some IDEs will allow you to create a new file and choose a location, while others will allow you to choose only after hitting "Save As".
21
+
Developing a LLSE Plugin begins with creating your plugin's file. This file should be named "LLMyPlugin.js", replacing "
22
+
MyPlugin" with what you would like to call your plugin. It should be placed in the plugins folder of your server
23
+
installation. Some IDEs will allow you to create a new file and choose a location, while others will allow you to choose
24
+
only after hitting "Save As".
16
25
17
-
This might confuse some developers, as `ll` should be undefined. However, this file is going to be utilized by the LeviLamina ScriptX Engine. `ll` will be automatically included during the script's runtime. This is the same with any other variables/classes you see referenced without a definition.
18
-
19
-
Now that we have created our .js file, and registered the plugin, all we have to do from here is create an event listener. We do that by utilizing `mc`.
26
+
This might confuse some developers, as `ll` should be undefined. However, this file is going to be utilized by the
27
+
LeviLamina ScriptX Engine. `ll` will be automatically included during the script's runtime. This is the same with any
28
+
other variables/classes you see referenced without a definition.
20
29
30
+
Now that we have created our .js file, and registered the plugin, all we have to do from here is create an event
In order to test your plugin, simply start the server and the server should be able to identify your plugin and successfully load it. LeviLamina console will log any logs you create, as well as any errors if your plugin, or the API fails. Iteration while developing is important. Test frequently and each step of the way to ensure that when an issue does pop up, you know exactly what you changed and can come up with a solution to fix it.
41
+
In order to test your plugin, simply start the server and the server should be able to identify your plugin and
42
+
successfully load it. LeviLamina console will log any logs you create, as well as any errors if your plugin, or the API
43
+
fails. Iteration while developing is important. Test frequently and each step of the way to ensure that when an issue
44
+
does pop up, you know exactly what you changed and can come up with a solution to fix it.
30
45
31
-
You can reference the `mc` class as well as other special classes and constructors. The `mc` class is the bread and butter of your plugin and will allow you to do a lot of cool things. The Game Content interface has all the methods and properties available to you.
46
+
You can reference the `mc` class as well as other special classes and constructors. The `mc` class is the bread and
47
+
butter of your plugin and will allow you to do a lot of cool things. The Game Content interface has all the methods and
48
+
properties available to you.
32
49
> Reference: [Game Element Interface Documentation](../apis/GameAPI/Basic.md)
33
50
34
51
For example, we can use the player object and directly act on it to send information/manipulate a Player.
This brings us to the final considerations. When making plugins, try to think of something simple and self-enclosing. Every developer wants to build a massive plugin with a ton of features, but such projects are prone to abandonment as they never truly get finished. Make a series of small plugins that have specific purpose. Add features to those plugins to enable configuration and customization. Find features or things you wish the game had and use the methods available in LeviLamina to make them happen. There are truly unlimited possibilities with LeviLamina's API.
71
+
This brings us to the final considerations. When making plugins, try to think of something simple and self-enclosing.
72
+
Every developer wants to build a massive plugin with a ton of features, but such projects are prone to abandonment as
73
+
they never truly get finished. Make a series of small plugins that have specific purpose. Add features to those plugins
74
+
to enable configuration and customization. Find features or things you wish the game had and use the methods available
75
+
in LeviLamina to make them happen. There are truly unlimited possibilities with LeviLamina's API.
55
76
56
-
If you run into any issues while developing, questions, comments or concerns can be answered by joining the [Telegram](https://t.me/LiteLoader)/[Discord](https://discord.gg/5HU3cJsVZ5) - or by opening an issue on the LeviLamina Github Repo.
77
+
If you run into any issues while developing, questions, comments or concerns can be answered by
78
+
joining [LeviLamina](https://github.com/LiteLDev/LeviLamina)‘s Groups or by opening an issue on the LegacyScriptEngine
0 commit comments