Lua Scripting: Enums & Values
This page links to the Spigot Javadocs for every enum type used by EliteMobs Lua methods. Use the exact enum constant name (e.g., "FLAME", "ZOMBIE", "STONE") as a string in your Lua code.
- Spelling must match the enum constant name exactly
- Case is usually normalized internally, but match the Javadoc spelling to be safe
- Invalid-value handling depends on the method: some log a warning, some return
nilor do nothing, and validated APIs may raise a Lua error
Enum Reference
| Enum | Used for | Javadoc |
|---|---|---|
BarColor | Boss bar color | BarColor |
BarStyle | Boss bar style | BarStyle |
DamageCause | Damage cause filtering | EntityDamageEvent.DamageCause |
EnderDragon.Phase | Ender dragon phase control | EnderDragon.Phase |
EntityEffect | Entity visual effects | EntityEffect |
EntityType | Entity spawning | EntityType |
EquipmentSlot | Entity equipment slots | EquipmentSlot |
FireworkEffect.Type | Firework shape | FireworkEffect.Type |
Material | Blocks and items | Material |
Particle | Particle effects | Particle -- also see the valid particles list for legacy name conversions |
PotionEffectType | Potion effects | PotionEffectType |
Sound | Sound playback | Sound |
Every Lua sound helper (boss:play_sound_at_self, entity:play_sound_at_entity, world:play_sound_at_location) resolves the string in two steps: first it tries the Spigot Sound enum name (uppercased, so "entity_blaze_shoot" works), and if that fails it treats the string as a namespaced sound key (lowercased, so "entity.blaze.shoot" and your own resource-pack key "mypack:boss.roar" both work).
That means you no longer have to pick a format -- but a typo in either form is silently ignored, because the fallback path cannot tell a bad enum name from a custom pack sound that is simply not installed.
Non-Spigot Values
These values are EliteMobs-specific and not in the Spigot Javadocs:
Zone shapes
Used by native zone definitions (kind field) and script utility zone specs (shape field).
Native (kind) | Script Utility (shape) |
|---|---|
sphere | SPHERE |
dome | DOME |
cylinder | CYLINDER |
cuboid | CUBOID |
cone | CONE |
static_ray | STATIC_RAY |
rotating_ray | ROTATING_RAY |
translating_ray | TRANSLATING_RAY |
Entity filters
Used by context.zones and context.entities query options. Case-insensitive, and each has a plural alias.
| Filter | Matches |
|---|---|
player / players | Players only |
elite / elites | Elite mobs only |
mob / mobs | Non-player living entities (this includes elites) |
living | All living entities, players included (default) |
all / entities | Every entity including non-living ones. Only recognised by context.entities:get_nearby_entities |
Anything that is not one of these strings falls through to the living behaviour rather than erroring, so a typo like "playr" silently returns every living entity.
context.script:zone({...}) uses a different, uppercase filter set (PLAYER, ELITE, LIVING) because it runs the EliteScript engine.
Weather values
Used by context.world:set_world_weather(weather).
| Value | Effect |
|---|---|
CLEAR | Clear skies |
PRECIPITATION / RAIN | Rain |
THUNDER | Thunderstorm |
Target types
Used by context.script:target() specs.
| Value | Resolves to |
|---|---|
SELF | The boss entity |
SELF_SPAWN | The boss's spawn location |
DIRECT_TARGET | The entity involved in the current event |
NEARBY_PLAYERS | Players within range of the boss |
NEARBY_MOBS | Non-player mobs within range |
NEARBY_ELITES | Elite mobs within range |
ALL_PLAYERS | All online players |
WORLD_PLAYERS | All players in the boss's world |
ZONE_FULL | Entities/locations inside a zone volume |
ZONE_BORDER | Entities/locations on a zone border |
LOCATION | A specific location from the spec's location field |
LOCATIONS | Several specific locations from the spec's locations list |
LANDING_LOCATION | Where a falling block or summoned entity landed |
ACTION_TARGET | Inherits the targets of the surrounding EliteScript action |
INHERIT_SCRIPT_TARGET | Inherits the target of the calling EliteScript |
INHERIT_SCRIPT_ZONE_FULL | Inside the calling EliteScript's zone |
INHERIT_SCRIPT_ZONE_BORDER | On the border of the calling EliteScript's zone |
The last four only resolve when there is a surrounding EliteScript to inherit from, so from Lua they are of little practical use. See EliteScript Targets for the full semantics -- context.script uses that exact implementation.
