▶️ ЗАБЕРИ СВОИ 8 ПОДАРКОВ 🎁 ПРИ СОЗДАНИИ СВОЕГО МАЙНКРАФТ СЕРВЕРА
Плагины/EliteEnchants
EliteEnchants

EliteEnchants

Create your own custom enchantments defined via JSON. The goal was to provide a solid amount of power and possibility. This is the first edition! It comes with some example custom enchants.

Оцените первым
74
1

!Splashv1

EliteEnchants

⚠ Alpha Release — Core systems are functional and stable. APIs and JSON schemas may change between versions. Test thoroughly before deploying on a live server.

EliteEnchants is a fully data-driven custom enchantment engine for Paper servers. Every enchant is defined entirely in a JSON file — no recompilation, no source edits, no restarts required to create new behavior. The engine evaluates a Trigger → Condition → Action pipeline at runtime, with a custom expression parser for dynamic numeric formulas and support for hooking into any Bukkit/Paper event.


Requirements

RequirementVersion
Server softwarePaper 1.21+
Java21+

How It Works

Each enchant is a single JSON file placed in plugins/EliteEnchants/enchants/. On load (or /ee reload), the engine parses every file and registers its triggers dynamically — no hardcoded listeners required.

The runtime pipeline for every player action looks like this:

Player Action / Event
        ↓
Trigger Dispatcher
        ↓
Condition Evaluation  (short-circuits on first failure)
        ↓
Expression Resolution (level, damage, health, random, ...)
        ↓
Action Execution

Enchant data is stored on items using the PersistentDataContainer (PDC) API, making it fully persistent across server restarts and compatible with vanilla item handling.


Getting Started

1. Install

Drop the .jar into your plugins/ folder and start the server. Six example enchants are written automatically to plugins/EliteEnchants/enchants/ on first launch.

2. Apply an Enchant to an Item

Use /ee book <id> <level> to receive an enchant book, then drag and drop it onto any compatible item in your inventory. The book is consumed on application.

3. Create Your Own Enchant

Create a new .json file in plugins/EliteEnchants/enchants/ and run /ee reload. No server restart needed.


Commands

CommandDescriptionPermission
/ee book <id> <level>Give yourself an enchant book(default: op)
/ee listList all loaded enchants
/ee info <id>Show details for a specific enchant
/ee reloadHot-reload all enchant JSON fileseliteenchants.admin
/ee stripRemove all custom enchants from held item

All subcommands support tab completion, including enchant IDs and valid level ranges.


Enchant File Structure

A minimal enchant file looks like this:

{
  "id": "LIFESTEAL",
  "display_name": "<red>Lifesteal",
  "description": ["Heal on hit. Chance and heal amount scale with level."],
  "max_level": 5,
  "applicable_to": ["SWORD", "AXE"],
  "conflicts_with": [],
  "triggers": [
    {
      "event": "ON_HIT",
      "cooldown": 0.5,
      "conditions": [
        { "type": "CHANCE", "value": "0.15 + (level * 0.1)" },
        { "type": "TARGET_IS", "value": "LIVING" }
      ],
      "actions": [
        { "type": "HEAL",           "target": "HOLDER", "amount": "level * 1.5" },
        { "type": "SEND_ACTION_BAR","target": "HOLDER", "message": "<red>❤ Lifesteal!" }
      ]
    }
  ]
}

display_name and message fields support full MiniMessage formatting (<red>, <bold>, <gradient:...>, etc.).


Expression Engine

Any numeric field in conditions or actions accepts a full math expression. Expressions are evaluated at runtime with per-context variable injection.

Example:

{ "type": "ADD_DAMAGE", "amount": "level * (1.0 - holder_health_pct) * 5" }

Available Variables

VariableDescription
levelCurrent enchant level
damageDamage value in the triggering event
holder_healthHolder's current HP
holder_max_healthHolder's maximum HP
holder_health_pctHolder's HP as a fraction (0.0–1.0)
target_healthTarget's current HP
target_max_healthTarget's maximum HP
target_health_pctTarget's HP as a fraction (0.0–1.0)
distanceDistance between holder and target
randomRandom decimal (0.0–1.0)

Supported Operators

+   -   *   /   %   ^
<   >   <=  >=  ==  !=
&&  ||  !

Built-In Functions

min() max() abs() floor() ceil() round() sqrt() pow() log() sin() cos() clamp() lerp() random()


Triggers

Standard Triggers

TriggerDescription
ON_HITHolder damages an entity
ON_TAKE_DAMAGEHolder receives damage
ON_KILLHolder kills an entity
ON_MINEHolder breaks a block
ON_SNEAKHolder begins sneaking
ON_SHOOTHolder launches a projectile
ON_ARROW_LANDProjectile hits a target
ON_RIGHT_CLICKHolder right-clicks
TICKFires every server tick (use cooldown to gate frequency)

Dynamic Event Triggers

Any Bukkit/Paper event can be registered at runtime using reflection-safe MethodHandle dispatch. Define the event class and the methods that resolve the holder and target:

{
  "eventClass": "org.bukkit.event.player.PlayerInteractEntityEvent",
  "holderMethod": "getPlayer",
  "targetMethod": "getRightClicked"
}

This opens the door to entity interaction enchants, projectile logic, inventory triggers, movement systems, and anything else the Bukkit API exposes — without touching Java.


Conditions

All conditions in a trigger must pass before any actions execute. Evaluation short-circuits on the first failure.

ConditionDescription
CHANCEProbabilistic check — e.g. "0.05 * level"
HEALTH_ABOVE / HEALTH_BELOWHolder HP threshold
HEALTH_PERCENT_ABOVE / HEALTH_PERCENT_BELOWHolder HP as fraction
TARGET_HEALTH_ABOVE / TARGET_HEALTH_BELOWTarget HP threshold
IS_SNEAKING / IS_SPRINTING / IS_FLYINGMovement state
IS_ON_GROUND / IS_ON_FIRE / IS_FROZENPhysical state
TARGET_IS / TARGET_NOTEntity category (LIVING, UNDEAD, CREATURE, etc.)
DAMAGE_ABOVE / DAMAGE_BELOW / DAMAGE_CAUSEDamage event filtering
BIOME_IS / WORLD_IS / TIME_IS / WEATHER_ISEnvironmental checks
HAS_EFFECT / TARGET_HAS_EFFECTPotion effect checks
EXPR / EXPRESSIONArbitrary boolean expression

Actions

ActionDescription
HEALRestore HP to target
DAMAGEDeal damage to target
ADD_DAMAGEAdd flat bonus to current event damage
MULTIPLY_DAMAGEMultiply current event damage by a factor
SET_HEALTHSet target HP to a specific value
SET_ON_FIRE / EXTINGUISHIgnite or extinguish target
FREEZE / UNFREEZEApply or remove powder snow freeze
APPLY_POTION / REMOVE_POTION / CLEAR_POTIONSManage potion effects
PLAY_SOUNDPlay a sound at the target's location
SPAWN_PARTICLESpawn a particle effect
SEND_MESSAGE / SEND_ACTION_BAR / SEND_TITLESend text to the holder
STRIKE_LIGHTNING / STRIKE_LIGHTNING_EFFECTReal or visual lightning
TELEPORT / TELEPORT_BEHINDTeleport an entity
LAUNCH / KNOCKBACK / PULLApply velocity
EXPLOSIONCreate an explosion
BREAK_BLOCKBreak blocks in a radius
SPAWN_MOBSpawn an entity
GIVE_EXP / RESTORE_HUNGER / RESTORE_SATURATIONPlayer resource management
CANCEL_EVENTCancel the triggering Bukkit event
RUN_COMMANDExecute a console or player command

Dynamic Action Registry (Java API)

Addons and soft-dependencies can register entirely custom actions at runtime without modifying the plugin:

actionRegistry.put("SPAWN_EGG", (def, ctx) -> {
    if (ctx.target instanceof Creature creature) {
        ItemStack egg = new ItemStack(
            Material.valueOf(creature.getType().name() + "_SPAWN_EGG")
        );
        ctx.holder.getWorld().dropItemNaturally(ctx.holder.getLocation(), egg);
    }
});

Included Example Enchants

Six fully-configured enchants are written to disk on first launch as ready-to-use references:

IDSlotDescription
LIFESTEALSword, AxeHeals on hit; chance and amount scale with level
LIGHTNINGSword, Axe, TridentChance to strike lightning; adds bonus damage and slowness
BERSERKERSword, AxeBonus damage scales with missing health percentage
FEATHERFALL_ELITEBootsReduces fall damage by 25% per level; eliminated at max level
EXCAVATORPickaxe, ShovelArea block-break while sneaking; radius scales with level
FROSTBITESword, AxeFreezes and slows on hit; conflicts with LIGHTNING

Performance Notes

The engine is designed with throughput in mind:

  • Cached MethodHandles — dynamic event resolution avoids repeated reflection lookups
  • Cooldown gating — per-trigger, per-player cooldowns are checked before any evaluation
  • Short-circuit conditions — the condition chain aborts on the first failure; expensive checks should go last
  • Filtered dispatch — only enchants relevant to the triggered event and the holder's equipped items are evaluated

Advanced Example

{
  "id": "VOIDSTEP",
  "display_name": "<dark_purple>Voidstep",
  "description": ["Teleport behind your target on hit."],
  "max_level": 3,
  "applicable_to": ["SWORD"],
  "conflicts_with": [],
  "triggers": [
    {
      "event": "ON_HIT",
      "cooldown": 4.0,
      "conditions": [
        { "type": "CHANCE", "value": "0.08 * level" },
        { "type": "TARGET_IS", "value": "LIVING" }
      ],
      "actions": [
        { "type": "TELEPORT_BEHIND", "target": "TARGET" },
        { "type": "PLAY_SOUND", "target": "HOLDER", "sound": "ENTITY_ENDERMAN_TELEPORT" },
        { "type": "SPAWN_PARTICLE", "location": "TARGET", "particle": "PORTAL", "count": "20", "spread": "0.5" }
      ]
    }
  ]
}

Часто задаваемые вопросы

Совместимость

Minecraft: Java Edition

26.1.x1.21.x

Платформы

Поддерживаемые окружения

Сервер

Ссылки

Детали

Лицензия:
Опубликован:2 месяца назад
Обновлён:2 месяца назад
Главная