Skip to main content

Lua Scripting: Enums & Values

webapp_banner.jpg

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 nil or do nothing, and validated APIs may raise a Lua error

Enum Reference​

EnumUsed forJavadoc
BarColorBoss bar colorBarColor
BarStyleBoss bar styleBarStyle
DamageCauseDamage cause filteringEntityDamageEvent.DamageCause
EnderDragon.PhaseEnder dragon phase controlEnderDragon.Phase
EntityEffectEntity visual effectsEntityEffect
EntityTypeEntity spawningEntityType
EquipmentSlotEntity equipment slots; damage_equipment accepts only HAND, OFF_HAND, HEAD, CHEST, LEGS, FEETEquipmentSlot
FireworkEffect.TypeFirework shapeFireworkEffect.Type
MaterialBlocks and itemsMaterial
ParticleParticle effectsParticle. The legacy name conversions apply to EliteScript particle actions; native Lua particle helpers require current API names.
PotionEffectTypePotion effectsPotionEffectType
SoundSound playbackSound
Sounds accept two formats

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)
sphereSPHERE
domeDOME
cylinderCYLINDER
cuboidCUBOID
coneCONE
static_raySTATIC_RAY
rotating_rayROTATING_RAY
translating_rayTRANSLATING_RAY

Entity filters​

Used by context.zones and context.entities query options. Values are case-insensitive; accepted aliases are listed below.

FilterMatches
player / playersPlayers only
elite / elitesElite mobs only
mob / mobsNon-player living entities (this includes elites)
livingAll living entities, players included (default)
all / entitiesEvery 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.

ValueEffect
CLEARClear skies
PRECIPITATION / RAINRain
THUNDERThunderstorm

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().

ValueResolves to
SELFThe boss entity
SELF_SPAWNThe boss's spawn location when resolving locations; the boss itself when resolving entities
DIRECT_TARGETThe current event's direct target; selects nothing when the event supplies none
NEARBY_PLAYERSPlayers in a box extending range along each axis from the boss
NEARBY_MOBSNon-player living entities in that box, excluding the boss
NEARBY_ELITESElite mobs in that box, excluding the boss
ALL_PLAYERSAll online players
WORLD_PLAYERSAll players in the boss's world
ZONE_FULLEntities/locations inside a zone volume
ZONE_BORDEREntities/locations on a zone border
LOCATIONA specific location from the spec's location field
LOCATIONSSeveral specific locations from the spec's locations list
LANDING_LOCATIONWhere a falling block or summoned entity landed
ACTION_TARGETInherits the targets of the surrounding EliteScript action
INHERIT_SCRIPT_TARGETInherits the target of the calling EliteScript
INHERIT_SCRIPT_ZONE_FULLInherits the calling EliteScript's zone; current entity selection uses its border. See inherited-zone limitations.
INHERIT_SCRIPT_ZONE_BORDEROn 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.


Next Steps​