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: dependencies.md
+11-18Lines changed: 11 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,36 +6,29 @@ order: 97
6
6
# Dependencies
7
7
LuaLink provides a way to access and use plugins' APIs in your scripts. This feature is very powerful and makes it easy to integrate scripts with other plugins. It must be noted this has not been thoroughly tested yet and some issues may arise. Please be cautious when using this feature.
8
8
9
-
!!! warning EXPERIMENTAL
10
-
Current implementation, despite being relatively simple and fully functional, is still marked as experimental.
11
-
We may introuduce breaking changes to the way dependencies are declared and exposed to scripts.
12
-
!!!
13
-
14
9
<br />
15
10
16
-
<!--
17
-
## Declaring Dependencies
18
-
To declare a dependency, you must create an `init.lua` file in your script's folder. In this example we will use **[PlaceholderAPI](https://www.spigotmc.org/resources/placeholderapi.19978/)**.
19
-
11
+
### Declaring Dependencies
12
+
Before we can start using any external API, we must declare a dependency. This ensures that script will **not be loaded** if dependency plugin is missing. To declare dependencies, you must create `init.lua` file in your script's folder.
In this example we will use **[PlaceholderAPI](https://www.spigotmc.org/resources/placeholderapi.19978/)** - a plugin you should already be familiar with.
25
21
26
-
**Why is that important?** Declaring dependency will ensure that script will not be loaded if **PlaceholderAPI** plugin is missing.
27
-
-->
28
-
29
-
## Using Dependencies
30
-
Importing any class that belongs to an installed plugin should work out of the box. In this example we will use **[PlaceholderAPI](https://www.spigotmc.org/resources/placeholderapi.19978/)**, a plugin you should be already familiar with.
22
+
<br />
31
23
32
-
Assuming the plugin is **installed** and **enabled** on the server, we should be able to call its API like any other function.
24
+
### Accessing Dependencies
25
+
Next, assuming the plugin is **installed** and **enabled** on the server, any import and call to its API should work as expected.
0 commit comments