Basic Commands


import

  • Name: import

  • Syntax: import [<class_name>] [constructor:[<param>|...]] (as:<definition_name>)

  • Description: Creates a new Java object instance or gets a static class reference. Use the constructor argument to create a new instance. Omit it to get a static reference.

  • Usage:

  # Get a static reference to the Bukkit class
  - import org.bukkit.Bukkit
  # Create a new ArrayList instance
  - import java.util.ArrayList constructor as:my_list

invoke

  • Name: invoke

  • Syntax: invoke [<java_expression>]

  • Description: Executes a full Java expression string. This is for advanced use cases or actions that don't return a value.

  • Usage:

  # Call a static method to log a message to console
  - invoke 'org.bukkit.Bukkit.getLogger().info("Hello from Denizen!")'

Last updated