OpenJS-docs
Download plugin
  • Overview
    • Welcome
  • Getting Started
    • Installing the plugin
    • Configuration file
    • Commands
    • Creating scripts
  • OpenJS Components
    • Feature Flags
    • Managing scripts within scripts
    • Sharing variables between scripts
    • Custom Commands
    • Using PlaceHolderApi
    • Listening and cancelling events
    • Custom events
    • Loading and saving data
    • Logging in console
    • Scheduling
    • Java imports
  • Example Scripts
    • spawn hit stand command
    • Knockbackstick command
    • No hit-cooldown script
    • NoBlockPlacing script
    • Saving Player data script
    • running code asynchronously
    • WhileTrue do script
Powered by GitBook
On this page
  1. OpenJS Components

Feature Flags

PreviousCreating scriptsNextManaging scripts within scripts

Last updated 16 hours ago

What is a feature flag?

With a feature flag, you can add special flags at the beginning of your script to enable features that may bypass certain safety restrictions provided by the plugin.

Example usage of a feature flag:
//!featureflagnamehere

Available feature flags:

//!loadmanually

With this feature flag placed at the top of your script, the script will not load automatically when the plugin starts or reloads. It will only be loaded if another script explicitly loads it, or if you load it manually using the load command.

//!waitForInit

With this feature flag placed at the top of your script, the script will yield (pause execution) until the plugin has been fully initialized. This should be used if you're calling the LoadScript(scriptName) function during plugin startup. In general, you should avoid manually loading scripts while the plugin is still starting or loading.

//!PlaceholderAPI

This feature flag indicates that the script will use PlaceholderAPI components, such as PlaceholderAPI.registerPlaceholder() and PlaceholderAPI.parseString(). In general, this allows the script loader to enable PlaceholderAPI support specifically for scripts that include this feature flag.

Feature flags will be ignored if they have been disabled in the

configuration file