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

denizen-reflect

Adds direct Java support to Denizen scripts.

Загрузки
2K
Подписчики
4
Обновлён
5 июля 2026 г.
Лицензия
Apache-2.0

Опубликован 23 сентября 2025 г.

Logo

Denizen-Reflect


Snippets Discord


denizen-reflect is an add-on for experienced scripters designed to combine the capabilities of Java directly within the Denizen development environment.

Supported Platforms


Features

  • 🔹 Importing classes
  • 🔹 Executing Java code (methods, fields, constructors)
  • 🔹 Creating your own placeholders (PlaceholderAPI)
  • 🔹 Creating custom Denizen commands & tags
  • 🔹 Renaming Denizen events
  • 🔹 Creating proxies
  • 🔹 Lambda expressions support
  • 🔹 And much more...

Example Usage

import:
    java.lang.System as test
    java.lang.String

task:
    type: task
    script:
    - define def <invoke[new String("123")]>
    - invoke player.sendMessage("321")
    - invoke test.out.println(def) 

Ченджлог

2.4.2Релиз26.1.1, 26.1.2, 26.2 · 5 июля 2026 г.

fix: resolve critical data loss and race conditions in proxy and section

2.4.1Релиз26.1.1, 26.1.2, 26.2 · 22 июня 2026 г.

fix: resolved class loading issues, allowing .dsc scripts to properly import and invoke custom Java classes.

2.4.0Релиз26.1, 26.1.1, 26.1.2 · 14 июня 2026 г.

denizen-reflect 2.4.0

Add:

  • Java Scripts (.java Script Support):

Write and execute native Java classes directly in your plugins/Denizen/scripts/ folder. They compile on-the-fly during "/ex reload" and run with 100% native Java performance.

The // @persistent State Control

Control the compilation lifecycle by adding a // @persistent comment at the very top of your .java file:

  • Volatile (Default - No comment): Recompiles from scratch on every "/ex reload". Best for active development and quick testing.
  • Persistent (Add // @persistent): Compiles only once and "freezes" in memory, protecting static variables from resetting. Use this when you have completely finished developing the class.

Architecture:

To prevent memory leaks during reloads, the system uses a strict classloader hierarchy. You must follow these visibility rules:

  • Volatile scripts CAN see and use Persistent classes.
  • Persistent classes CAN see and use other Persistent classes.
  • Persistent classes CANNOT reference Volatile scripts. Doing so will trap the old volatile script in memory and eventually crash the server with an OutOfMemoryError.

Lifecycle Methods:

You can optionally implement two static methods that the system invokes automatically:

  • public static void init(): Executed immediately after successful compilation.
  • public static void shutdown(): Executed right before the script is reloaded or deleted (used for cleanup).

For more information, visit the documentation website.

Java scripts

Fix:

  • TagCommand:

Fixed custom base tags not supporting sub-tags.

  • CustomCommand:

Fixed custom commands ignoring execution determinations.

2.3.2Релиз26.1, 26.1.1, 26.1.2 · 13 апреля 2026 г.

fix: resolve non-public class bypass to fix interface and deep discovery

2.3.1Релиз1.21.9, 1.21.10, 1.21.11 · 17 марта 2026 г.

Proxy handlers are forced to run in the main thread.

2.3.0Релиз1.21.9, 1.21.10, 1.21.11 · 6 марта 2026 г.

feat: add util.custom_commands tag

2.2.9Релиз1.21.9, 1.21.10, 1.21.11 · 5 марта 2026 г.

Optimization

Debugging disabled in executor: (PlaceholderCommand)

2.2.8Релиз1.21.9, 1.21.10, 1.21.11 · 21 февраля 2026 г.

feat: support dynamic tag-based executors for tags and placeholders

Комментарии

Загружаем…