Перейти к содержимому
Mineforgian

OpenJavascript

Create custom menus, commands, plugins, systems, basically anything with scripts in Javascript! With multithreading and Folia support! Everything is fully documented in the documentation!

Загрузки
2K
Подписчики
24
Обновлён
31 марта 2026 г.
Лицензия
AGPL-3.0-only

Опубликован 27 января 2025 г.

OpenJS Banner

Ever wanted to make features for your Minecraft server, but writing full Java plugins is hard and painful?
OpenJS lets you build powerful server logic using JavaScript. No compiling. No restarts. Just code, save, and run.


Endpoint Badge Players Servers

Why OpenJS?

  • Folia support
  • Create custom Menus with scripts
  • Create custom commands with scripts
  • Reload scripts instantly without restarting the Server
  • Simplified custom APIs to make scripting easier
  • Easy to read Documentation
  • Plugin support: ProtocolLib & PlaceholderApi
  • VS-Code Autocomplete Extension!

Hot-reloading a script while server runs. Hot-reload in action

Even AI can generate working scripts with OpenJS! Click here for a tutorial AI-powered script creation


Get Started


Full Documentation

Everything and more is covered, from the basics to advanced patterns.
Check out the docs.

Need help?

Join the Discord for support, tips, and community-made scripts!

Ченджлог

1.4.0Релиз1.21.10, 1.21.11, 26.1 · 31 марта 2026 г.

updateThumbnail

General Fixes & Improvements

  • Scripts run more than 2.5 times faster than in previous versions now! No changes needed, just update!
  • You can convert scripts (scriptPacks) into plugins now!
  • Added support for minecraft version 26.1
  • Reviewed and fixed numerous bugs across the entire codebase.
  • Added a debug mode boolean to the config for easier troubleshooting.
  • Fixed a bug where reloading with the reload command would not update the debug mode boolean until a full restart.
  • Fixed an issue where deleting folders inside the script folder was not possible due to the file watcher locking them.
  • Removed all deprecated code and cleaned up a large portion of the codebase.

Dialog API

  • Created a new DialogApi for managing in-game graphical dialogs.

Task API

  • Tasks are now shared across all scripts, meaning they can be cancelled from external scripts using setShared and getShared.
  • Added task.latch() which returns an object with the following thread-safe methods: .destroy(), .connect(function), .wait(), .invoke(), .fire(), and .invoked.
  • Added task.threadType() which returns a string indicating the thread type (main, async, or sync).
  • Enhanced thread safety in DelayTask by properly handling thread interruptions.

FileManager API

  • Added FileManager.getPath(File), which returns the relative path of a file based on the script's folder.
  • Added support for ZIP files: any .zip file containing an info.json will automatically be extracted into a folder named after the zip file.
  • Fixed a bug where the file watcher could receive null paths, causing errors.
  • Improved watcher robustness by handling OVERFLOW events and adding a null check for the watch service when clearing listeners. This fixed many errors with the file listener, its more reliable now

ProtocolLib Integration

  • Added the following new ProtocolLib methods:
    • broadcastServerPacket(packet, source, broadcastRange) broadcasts a packet to nearby players.
    • sendServerPacket(player, packet) sends a packet directly to a specific player.
    • createPacket(packetTypePath) creates a packet by type path.

PlaceholderAPI

  • Fixed parseString not working correctly when passing an offline player as the target.

Inventory API

  • Added the following new methods:
    • getSlot(slot) retrieves the item in a given slot.
    • setItemLore(slot, lore) sets the lore of an item in a slot.
    • setItemName(slot, name) sets the display name of an item in a slot.
  • Fixed colors not being applied correctly in item lore.
  • Added backwards compatibility for Inventory.setTitle via ProtocolLib.

Service Objects & Internal Refactoring

  • Refactored Folia support initialisation for improved performance, including a centralised init() method and pre-cached scheduler.
  • Refactored setShared() & getShared() , replacing complex lock logic with a simpler and safer wait()/notifyAll() approach.
  • Optimised script preprocessing to read from CODE_CACHE first, avoiding unnecessary disk reads.
  • Switched import ID generation in importJavaToJsGC from random strings to an AtomicLong counter (__import_0, __import_1, ...) for better performance.
  • Added player permission verification (openjs.use) at the start of onCommand to prevent unauthorised command execution.
  • Added Array.from() support.
  • Created custom mappings to support Minecraft 1.13 through the current version.
  • Fixed importClass() it now correctly translates Java classes into Javascript objects
  • Fixed Java.type() it can now correctly read and translate external plugin classes too! This is huge, trust me :)

Thank you, guys, for downloading this plugin. I’ve poured my heart and a lot of passion into this project 💚

1.4.0aАльфа1.21.9, 1.21.10, 1.21.11 · 22 марта 2026 г.

Alpha Build - Use at your own risk! Full release soon!

Changelog

General Fixes & Improvements

  • Reviewed and fixed numerous bugs across the entire codebase.
  • Added a debug mode boolean to the config for easier troubleshooting.
  • Fixed a bug where reloading with the reload command would not update the debug mode boolean until a full restart.
  • Fixed an issue where deleting folders inside the script folder was not possible due to the file watcher locking them.
  • Removed all deprecated code and cleaned up a large portion of the codebase.

Dialog API

  • Created a new DialogService for managing in-game graphical dialogs.
  • Added NMS support for the Dialog API.
  • Added backwards compatibility for Inventory.setTitle via ProtocolLib.

Task API

  • Tasks are now shared across all scripts, meaning they can be cancelled from external scripts using setShared and getShared.
  • Added task.latch() which returns an object with the following thread-safe methods: .destroy(), .connect(function), .wait(), .invoke(), .fire(), and .Fired.
  • Added task.threadType() which returns a string indicating the thread type (main, async, or sync).
  • Enhanced thread safety in DelayTask by properly handling thread interruptions.

FileManager API

  • Added FileManager.getPath(File), which returns the relative path of a file based on the script's folder.
  • Added support for ZIP files: any .zip file containing an info.json will automatically be extracted into a folder named after the zip file.
  • Fixed a bug where the file watcher could receive null paths, causing errors.
  • Improved watcher robustness by handling OVERFLOW events and adding a null check for the watch service when clearing listeners. This fixed many errors with the file listener, its more reliable now

ProtocolLib Integration

  • Added the following new ProtocolLib methods:
    • broadcastServerPacket(packet, source, broadcastRange) — broadcasts a packet to nearby players.
    • sendServerPacket(player, packet) — sends a packet directly to a specific player.
    • createPacket(packetTypePath) — creates a packet by type path.

PlaceholderAPI

  • Fixed parseString not working correctly when passing an offline player as the target.

Inventory API

  • Added the following new methods:
    • getSlot(slot) retrieves the item in a given slot.
    • setItemLore(slot, lore) sets the lore of an item in a slot.
    • setItemName(slot, name) sets the display name of an item in a slot.
  • Fixed colors not being applied correctly in item lore.

Service Objects & Internal Refactoring

  • Refactored Folia support initialisation for improved performance, including a centralised init() method and pre-cached scheduler.
  • Refactored PublicVarManager's waiting mechanism, replacing complex lock logic with a simpler and safer wait()/notifyAll() approach.
  • Optimised script preprocessing to read from CODE_CACHE first, avoiding unnecessary disk reads.
  • Switched import ID generation in importJavaToJsGC from random strings to an AtomicLong counter (__import_0, __import_1, ...) for better performance.
  • Added player permission verification (openjs.use) at the start of onCommand to prevent unauthorised command execution.
  • Added Array.from() support.
  • Created custom mappings to support Minecraft 1.13 through the current version.
  • Fixed importClass() it now correctly translates Java classes into Javascript objects
  • Fixed Java.type() it can now correctly read and translate external plugin classes too! This is huge, trust me :)
1.3.2Релиз1.21.9, 1.21.10, 1.21.11 · 30 января 2026 г.

This release is just a hotfix, containing crucial fixes and new features.

General Fixes & Improvements

  • Migrated from Nashorn 15.6 to 15.7 for better JavaScript compatibility and performance.
  • Reduced plugin file size by ~1,000KB through code cleanup and a complete rewrite of the UpdateChecker.
  • Fixed an error where task.bindToUnload would crash because the plugin attempted to schedule tasks during the shutdown sequence.
  • Resolved a ConcurrentModificationException that occurred when destroying an inventory immediately upon a player closing it.

Custom-Menus Api Updates

FileManager Api Updates

The FileManager service has received a few new methods

New Methods:

  • getFile(path): Retrieves a specific file.
  • removeFile(path): Deletes a file.
  • getFolder(path): Retrieves a directory.
  • removeFolder(path): Deletes a directory and its contents.
  • getFiles(path): Returns an array of all files within the specified folder.

FileManager path prefixes for easier navigation:

  • .. (Parent Directory): Jump up one level out of the current folder.
  • / (Script Root): Quickly reference the directory where your script is currently located.
  • Example: FileManager.getFiles("/"); returns everything in the script's local folder.
1.3.0Релиз1.21.9, 1.21.10, 1.21.11 · 11 января 2026 г.

Improvements

  • Fixed DiskApi issues that caused unexpected behavior
  • DiskApi now removes datastore entries when values are NULL
  • DiskApi now persists active files on script reload
  • Fixed rare ConcurrentModificationException issues when:
    • Registering commands
    • Syncing commands
  • Improved error handling: script exceptions now log as ERROR instead of WARN
  • All scripts now unload before any other shutdown logic
  • Scripts unload asynchronously on the main thread, allowing tasks to finish safely

Additions

  • Completely rewritten script management & I/O system
    • Significantly reduces unnecessary disk operations
  • Added official folder support for scripts
  • Scripts are automatically loaded when added while the server is running
  • Added requireScript
  • Introduced global [script] class
  • Fixed scripts failing to load via command due to parsing errors
  • Added task.bindToUnload(function) to register unload handlers
  • Yielding operations now block unload until execution completes
  • Cache behavior improved:
    • Cache drops only after I/O operations complete
    • Fully handled automatically by scripts

APIs & Services improvements

Commands & Runtime fixes

Deprecations

  • Added importClass() for runtime class importing
  • Deprecated //!import xxx.xxx in favor of importClass()
  • Deprecated feature flags / service flags

Configuration & Automation

  • Added autoReloadScripts config option
    • Toggle automatic reload when scripts change or are added

Threading & more Folia Support

  • Added task.thread(function) for parallel execution
    • This means you can multithread scripts on non-Folia servers now
  • Services and PlaceholderAPI are now fully thread-safe

Documentation

  • Added "Advanced Guides" section that also explains how to use the new folder support
  • Reconstructed everything to find APIs and Methods faster
  • Added 3 new example scripts: Food Bait, Nuke Menu and Spawn Menu
  • All old example scripts have been updated to use the latest non deprecated methods
1.2.0Релиз1.21.6, 1.21.7, 1.21.8 · 31 июля 2025 г.

OpenJS v1.2.0

Major Changes

Fixes

  • Commands now properly unregister
  • Fixed placeholders being unregistered after PlaceholderAPI reload
  • Fixed nullFailed to unregister all script commands error
  • Fixed missing script source name in rare ghost error cases
  • Fixed missing tab-completion for the version command

Optimizations

  • Minimized IO operations during script loading
  • Improved error catching to prevent script freezing
  • Removed feature flag limitations

Additions

Documentation


Sorry for the update delay, I'm currently working on my driving license.
Thanks for your patience and enjoy the update.

1.1.0Релиз1.21.4, 1.21.5, 1.21.6 · 28 июня 2025 г.

Update Log

  • Rewritten the async system for full Folia compatibility
  • Now finally stable on Folia, a major milestone
  • Introduced a new task library: simpler, more intuitive, and fully cross-platform compatible
  • Added support for loading .jar files directly into scripts
  • Upgraded from ECMAScript 5.1 to ECMAScript 6.0
    (Modern JavaScript features are now available in OpenJS)
  • Implemented script security enforcement
  • Completed documentation for all previously half-documented components
  • added new example script that runs a local ai with the new features
  • registerEvent can now take functions directly instead of having to put them in a array

We also have a dedicated server now

Need help or want to share your scripts?
Join our Discord for support and discussion

Discord Server

1.0.7Релиз1.21.3, 1.21.4, 1.21.5 · 28 мая 2025 г.

Small patch with new additions

  • Fixed Schedules not unregistering on Folia Servers

  • Fixed Plugin breaking if PlaceholderApi is not installed

  • Fixed /oj reload command on Folia servers

  • Added Bstats opt-out option in the configuration file

  • Fixed a few weird errors that only occurred on Folia servers

  • Fixed the no hit cooldown example script causing errors

  • Added 2 new example scripts: hitstand script & Knockback-stick script to the documentation

  • Fixed Bstats silently failing to load on Folia servers

1.0.6Релиз1.21.3, 1.21.4, 1.21.5 · 25 мая 2025 г.

OpenJS Update 1.0.6

  • A Wiki for OpenJS has been created. Everything is documented from the ground up, although it is not yet fully complete.

  • Added official PlaceholderAPI support.

  • Introduced a new DiskAPI system for loading and saving files.

  • Added a permission system for custom commands.

  • Fixed an issue where custom commands were not appearing.

  • Fixed scheduling not working correctly.

  • Deprecated getVar and setVar due to a memory leak, in favor of the new DiskAPI.

Комментарии

Загружаем…