Skip to content

Repository files navigation

CyberEventEngine

CyberEventEngine (CEV) is the small BitAspire event-expression runtime used by Cyber plugins that only need the CyberLevels-compatible event surface.

The public API lives under com.bitaspire.cev. The main entry point is com.bitaspire.cev.EventEngine.

CEV is intentionally limited. It keeps the shared expression engine, recurring routine support, criteria matching, and the 23 base events needed by CLV-style consumers, but it omits the advanced catalog, custom event loader, and expanded third-party integration surface.

When To Use CEV

Use CEV when a plugin needs:

  • a lightweight event engine with stable CLV-compatible behavior;
  • the 23 base event IDs and aliases;
  • expression parsing and criteria evaluation;
  • recurring/timed routines;
  • no dependency on any advanced event layer.

Use a higher-level event engine when a plugin needs advanced built-in events, public dynamic event binding, custom events loaded from configuration files, or the expanded Ax/Rival integration surface.

Runtime Surface

CEV exposes these core pieces:

  • EventEngine: starts and stops Bukkit event listeners, dispatches event expressions, and owns the criteria/routine registries.
  • EventType: typed event IDs with aliases and count policies.
  • CriteriaRegistry and Criterion: argument matching for expressions such as block types, entity names, permissions, item types, and numeric ranges.
  • Dispatcher: evaluates a captured event against registered expressions.
  • recurring.Routines: recurring execution helpers for timed event sources.

The dynamic reflection binding layer exists inside CEV so the runtime can bind optional integrations safely, but it is not part of the intended public CEV extension API.

Basic Usage

importcom.bitaspire.cev.EventEngine;
importorg.bukkit.plugin.Plugin;
publicfinalclassMyPlugin {
privatefinalEventEngineengine;
publicMyPlugin(Pluginplugin) {
this.engine = newEventEngine(plugin);
}
publicvoidenable() {
engine.start();
}
publicvoiddisable() {
engine.close();
}
}

Expressions use the event ID first, then an optional criterion:

KILL_MONSTER:TYPE_EXACT=ZOMBIE
BREAK_BLOCK:TYPE_CONTAINS=ORE
TIMED_EXP:PERMISSION=myplugin.reward
EXP_GAIN:EXP=10-100

Bracket counts are supported for events whose count policy allows explicit amounts:

KILL_MONSTER[5]
BREAK_BLOCK:GROUP=ORES[32]

Supported Events

CEV contains exactly these 23 event IDs:

EventPurpose
TIMED_EXPRecurring/timed reward source.
DYINGPlayer death.
DAMAGE_PLAYERPlayer damages another player.
DAMAGE_ANIMALPlayer damages a passive animal.
DAMAGE_MONSTERPlayer damages a monster.
KILL_PLAYERPlayer kills another player.
KILL_ANIMALPlayer kills a passive animal.
KILL_MONSTERPlayer kills a monster.
PLACE_BLOCKPlayer places a block.
BREAK_BLOCKPlayer breaks a block.
CONSUMEPlayer consumes an item.
MOVEPlayer changes block position in the same world.
CRAFTPlayer crafts an item.
BREWBrewing stand completes a brew action.
ENCHANTPlayer enchants an item.
FISHPlayer fishes an item/entity.
BREEDEntity breeding event where the breeder can be resolved.
CHATPlayer chat message.
EXP_GAINPlayer receives vanilla experience.
RIVAL_HARVESTER_HOES_BLOCK_BREAKRivalHarvesterHoes block break event when available.
RIVAL_PICKAXES_BLOCK_BREAKRivalPickaxes block break event when available.
AX_HOES_BLOCK_BREAKAxHoes player XP gain/block break compatible event when available.
AX_PICKAXES_BLOCK_BREAKAxPickaxes player XP gain/block break compatible event when available.

UNKNOWN exists as an internal fallback value, but it is not part of the supported configurable event surface.

Aliases

CEV accepts the legacy CLV names used by older configurations. Common aliases include:

AliasEvent
timed-giving, TIMED_GIVINGTIMED_EXP
damaging-playersDAMAGE_PLAYER
damaging-animalsDAMAGE_ANIMAL
damaging-monstersDAMAGE_MONSTER
killing-playersKILL_PLAYER
killing-animalsKILL_ANIMAL
killing-monstersKILL_MONSTER
vanilla-exp-gain, VANILLA_XPEXP_GAIN
rivalhh-breakingRIVAL_HARVESTER_HOES_BLOCK_BREAK
rivalpick-breakingRIVAL_PICKAXES_BLOCK_BREAK
axhoes-breakingAX_HOES_BLOCK_BREAK
axpick-breakingAX_PICKAXES_BLOCK_BREAK

Limitations By Design

CEV does not include:

  • advanced event IDs such as SMELT, DROP_ITEM, LEVEL_UP, JUMP, RUN_COMMAND, JOIN, or WORLD_CHANGE;
  • the custom event file loader;
  • public dynamic event registration methods;
  • the expanded AxBoosters, RivalFishingRods, RivalMobSwords, or extended AxHoes/AxPickaxes event set.

Build

./gradlew clean build

The main artifact is:

build/libs/CyberEventEngine-0.1.1.jar

The project is compiled for Java 8 bytecode compatibility.

About

BitAspire event-expression runtime used by Cyber plugins that only need the CyberLevels-compatible event surface

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages