Lua Scripting: Enums & Values
This page links to Spigot value types used by EliteMobs Lua methods. Pass their constant names, such as "FLAME", "ZOMBIE" and "STONE", as strings in your Lua code. Use values available in your server's API version.
- 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; damage_equipment accepts only HAND, OFF_HAND, HEAD, CHEST, LEGS, FEET | EquipmentSlot |
FireworkEffect.Type | Firework shape | FireworkEffect.Type |
Material | Blocks and items | Material |
Particle | Particle effects | Particle. The legacy name conversions apply to EliteScript particle actions; native Lua particle helpers require current API names. |
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).
Both paths trim surrounding whitespace. A key without a namespace uses minecraft. Malformed keys are ignored; syntactically valid keys are sent to the client without checking whether the sound exists. A misspelled key or missing resource-pack sound may therefore play nothing.
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). These values are case-sensitive. Use lowercase for native shapes and uppercase for script utility shapes.
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. Values are case-insensitive; accepted aliases are listed below.
| 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 |
Unknown filters fall back to living, so a typo like "playr" includes all living entity types within the queried area. These native entity queries exclude the boss itself. Zone entity queries search the boss's world; box queries search the supplied center's world.
get_nearby_entities(radius, filter) uses a spherical distance check for living filters. With all or entities, it instead searches an axis-aligned box extending radius along each axis and returns entity-reference tables, including non-living entities. Other native queries treat those two filters as living.
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). Values are converted to uppercase, without trimming whitespace. An unknown value logs a warning and leaves the weather unchanged.
| Value | Effect |
|---|---|
CLEAR | Clear skies |
PRECIPITATION / RAIN | Rain |
THUNDER | Thunderstorm |
Target types
These are EliteScript target values. context.script:target() shares the resolver, but does not supply inherited action or landing data. Zone targets must come from a zone handle's full_target() or border_target().
| Value | Resolves to |
|---|---|
SELF | The boss entity |
SELF_SPAWN | The boss's spawn location when resolving locations; the boss itself when resolving entities |
DIRECT_TARGET | The current event's direct target; selects nothing when the event supplies none |
NEARBY_PLAYERS | Players in a box extending range along each axis from the boss |
NEARBY_MOBS | Non-player living entities in that box, excluding the boss |
NEARBY_ELITES | Elite mobs in that box, excluding the boss |
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 | Inherits the calling EliteScript's zone; current entity selection uses its border. See inherited-zone limitations. |
INHERIT_SCRIPT_ZONE_BORDER | On the border of the calling EliteScript's zone; see inherited-zone limitations for location resolution. |
Do not use LANDING_LOCATION, ACTION_TARGET or the three INHERIT_SCRIPT_* values with context.script:target(). The Lua handle has no corresponding action, inheritance or landing state; resolution can return no targets or fail. A bare ZONE_FULL or ZONE_BORDER spec also lacks a zone. See EliteScript Targets for the YAML action semantics.
