Mechanics Overview
BTCMobs utilizes a high-performance Atomic Mechanic System. This architecture ensures that skills are executed with minimal overhead while providing deep customization through parameters.
Anatomy of a Mechanic
A mechanic is a single action executed by a caster on one or more targets. It follows this syntax:
mechanic{parameter=value;parameter=value} @targeter ~trigger
Components
- Mechanic Name — The internal ID of the action (e.g.,
damage,particle,message).- Parameters — Values enclosed in
{}that modify the behavior (e.g.,amount=10). - Targeter — Specified with
@, defines WHO or WHERE the action happens. - Trigger — Specified with
~, defines WHEN the skill executes.
- Parameters — Values enclosed in
Universal Attributes
Every mechanic supports these core attributes:
| Attribute | Alias | Description | Default |
|---|---|---|---|
cooldown | cd | Delay in seconds before reuse | 0 |
delay | d | Delay in ticks before execution | 0 |
chance | c | execution success probability (0.0 to 1.0) | 1.0 |
repeat | r | Number of times to repeat the action | 0 |
repeatInterval | ri | Ticks between repetitions | 0 |
Atomic Efficiency
Unlike traditional systems, BTCMobs mechanics are compiled into optimized bytecode sequences. This allows for:
- Zero-allocation target resolution where possible.
- Async-first processing for visual effects.
- Folia-native execution, automatically handling regional threading.
к сведению
Always prefer specific mechanics over generic ones for maximum performance. For example, use particleline instead of a loop of particle calls.