Importation
To import a class, you can use the import("classpath")
statement at the beginning of your script. Let's consider this script as a reference:
Here's the explanation of how the import statement works:
Import Statement: The import("org.bukkit.Bukkit")
statement is used to import a class located at the specified "classpath". In this case, it imports the "Bukkit" class from the "org.bukkit" package.
Using the Imported Class: After importing the "Bukkit" class, you can access its methods and properties within your script. In the build
function, we use the line Bukkit.broadcastMessage("Hello World!")
to call the broadcastMessage
method provided by the "Bukkit" class. This method is used to send the "Hello World!" message to the server.
Last updated