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. Getting Started

Creating scripts

PreviousCommandsNextFeature Flags

Last updated 17 hours ago

To create a script or JavaScript file, go to the plugin's script folder (plugins/OpenJS/scripts), create a .js file (e.g., file.js), and start coding. I recommend using a code editor like Notepad++ or Visual Studio Code. Make sure your script is loaded and enabled, if you're not sure how to check this, refer to the section.

As the file type suggests, scripts are written in JavaScript (specifically ) While this version of JavaScript is somewhat outdated, it's very simple and easy to use.

Here’s an example script that will log 'Hello World!' to your console:

HelloWorld.js
log.info("Hello World!")

Many modern JavaScript features (such as let, const, arrow functions, classes, promises, modules, etc.) are either not fully supported or completely missing in ECMAScript 5.1

available commands
ECMAScript 5.1