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
Code (Java):
import
com.bitaspire.cev.EventEngine
;
import
org.bukkit.plugin.Plugin
;
public
final
class MyPlugin
{
private
final EventEngine engine
;
public MyPlugin
(Plugin plugin
)
{
this.
engine
=
new EventEngine
(plugin
)
;
}
public
void enable
(
)
{
engine.
start
(
)
;
}
public
void disable
(
)
{
engine.
close
(
)
;
}
}
Expressions use the event ID first, then an optional criterion:
Code (Text):
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:
Code (Text):
KILL_MONSTER[5]
BREAK_BLOCK:GROUP=ORES[32]
Supported Events
CEV contains exactly these 23 event IDs:
- TIMED_EXP: Recurring/timed reward source.
- DYING: Player death.
- DAMAGE_PLAYER: Player damages another player.
- DAMAGE_ANIMAL: Player damages a passive animal.
- DAMAGE_MONSTER: Player damages a monster.
- KILL_PLAYER: Player kills another player.
- KILL_ANIMAL: Player kills a passive animal.
- KILL_MONSTER: Player kills a monster.
- PLACE_BLOCK: Player places a block.
- BREAK_BLOCK: Player breaks a block.
- CONSUME: Player consumes an item.
- MOVE: Player changes block position in the same world.
- CRAFT: Player crafts an item.
- BREW: Brewing stand completes a brew action.
- ENCHANT: Player enchants an item.
- FISH: Player fishes an item/entity.
- BREED: Entity breeding event where the breeder can be resolved.
- CHAT: Player chat message.
- EXP_GAIN: Player receives vanilla experience.
- RIVAL_HARVESTER_HOES_BLOCK_BREAK: RivalHarvesterHoes block break event when available.
- RIVAL_PICKAXES_BLOCK_BREAK: RivalPickaxes block break event when available.
- AX_HOES_BLOCK_BREAK: AxHoes player XP gain/block break compatible event when available.
- AX_PICKAXES_BLOCK_BREAK: AxPickaxes 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:
- timed-giving, TIMED_GIVING: TIMED_EXP
- damaging-players: DAMAGE_PLAYER
- damaging-animals: DAMAGE_ANIMAL
- damaging-monsters: DAMAGE_MONSTER
- killing-players: KILL_PLAYER
- killing-animals: KILL_ANIMAL
- killing-monsters: KILL_MONSTER
- vanilla-exp-gain, VANILLA_XP: EXP_GAIN
- rivalhh-breaking: RIVAL_HARVESTER_HOES_BLOCK_BREAK
- rivalpick-breaking: RIVAL_PICKAXES_BLOCK_BREAK
- axhoes-breaking: AX_HOES_BLOCK_BREAK
- axpick-breaking: AX_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
Code (Bash):
.
/gradlew clean build
The main artifact is:
Code (Text):
build/libs/CyberEventEngine-0.1.1.jar
The project is compiled for Java 8 bytecode compatibility.