Skip to main content

Lua Scripting: Enums & Values

webapp_banner.jpg

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 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 slotsEquipmentSlot
FireworkEffect.TypeFirework shapeFireworkEffect.Type
MaterialBlocks and itemsMaterial
ParticleParticle effectsParticle -- also see the valid particles list for legacy name conversions
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).

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)
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. Case-insensitive, and each has a plural alias.

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

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

ValueEffect
CLEARClear skies
PRECIPITATION / RAINRain
THUNDERThunderstorm

Target types

Used by context.script:target() specs.

ValueResolves to
SELFThe boss entity
SELF_SPAWNThe boss's spawn location
DIRECT_TARGETThe entity involved in the current event
NEARBY_PLAYERSPlayers within range of the boss
NEARBY_MOBSNon-player mobs within range
NEARBY_ELITESElite mobs within range
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_FULLInside the calling EliteScript's zone
INHERIT_SCRIPT_ZONE_BORDEROn 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.


Next Steps