Skip to main content

Lua API Reference

This reference describes the MagmaCore, FreeMinecraftModels, and EliteMobs Lua table builders and runtime contexts. Shared tables and EliteMobs boss-power tables have different contracts; use the section for the script you are writing.

Most table methods accept both table.method(...) and table:method(...). Global em.create_*, em.zone.create_*, and em.location.* functions require dot syntax, as do the boss-event damage setters identified below. Shared live fields are lazy lookups: read them again to refresh their value, and avoid assigning to them because that shadows the lookup. A location or other snapshot already stored in a Lua variable does not update itself.

Methods described as color-processed use the shared color-code syntax, including chat, titles, bars, custom names, and prop inventory titles.

Entity Table​

The MagmaCore entity table is the base for generic entity values; Living Entity, Player, and FreeMinecraftModels Prop tables inherit it.

Properties​

FieldTypeDescription
uuidstringEntity UUID.
entity_typestringLowercase Bukkit entity type.
is_validboolLive validity value.
is_deadboolLive dead state.
current_locationtable/nilLive {x, y, z, yaw, pitch, world} location.
worldstring/nilLive world name.
is_playerboolWhether the entity is a player.
is_hostileboolWhether the entity implements Bukkit Monster.
is_passiveboolWhether the entity implements Bukkit Animals.
is_on_groundboolLive ground state.
is_flyingboolLive player flight state; false for other entity types.
in_blockboolArrow-only live embedded state.
attachment_locationtable/nilCenter of the block containing an embedded arrow's current location; nil when the arrow is not in a block.
attachment_blocktable/nilCenter of the actual block hit by an arrow owned by an active enchantment action. Returns nil without a valid recorded embedded hit, or after the arrow moves away, changes world, or its action ends. Identifies the struck block; it does not provide a collision-safe movement destination.

Methods​

MethodArgsReturnsDescription
teleport(location)tablenilTeleport to a location table.
remove()—nilRemove the entity if it is still valid.
set_silent(enabled)boolnilSet the silent state.
set_invulnerable(enabled)boolnilSet the invulnerable state.
set_gravity(enabled)boolnilSet the gravity state.
set_glowing(enabled)boolnilSet the glowing state.
set_velocity(x, y, z)number, number, numbernilReplace velocity; components must be finite.
set_fall_distance(distance)numbernilSet a finite, nonnegative fall distance.
set_shooter(uuid)stringboolProjectile-only method; assign a resolved entity that implements Bukkit ProjectileSource.
set_direction(x, y, z)number, number, numbernilFireball-only method; set a finite, nonzero flight direction.
set_pickup(status)stringnilArrow-only method; ALLOWED, DISALLOWED, or CREATIVE_ONLY.
can_receive_hostile_effect(actor_uuid)stringboolCheck whether the target can receive a hostile effect from the online player. Providers can apply their own combat restrictions.
has_clear_movement_path(location)tableboolPreflight a same-world pull against collision, world bounds, and loaded chunks. Non-player entities also reject protected regions. Does not move the entity.
movement_path_status(location)tablestringReturn clear, blocked, protected, or unavailable; protected applies to non-player entities. Collision checks conservatively sweep the entity's bounding box.

Shared location arguments require x, y, and z. An omitted world uses the entity's world; an unresolved world name also retains that fallback. The separate em.location.* queries require a loaded world and default missing coordinates to zero. Neither movement preflight nor can_receive_hostile_effect is automatically applied to direct teleport, velocity, or damage calls.

A clear player path does not authorize entry or combat. Actual player movement remains subject to native movement listeners, including region entry restrictions; ordinary build protection alone does not prevent player travel.

can_receive_hostile_effect requires a valid online player actor and a valid, living, same-world nonplayer target. It rejects armor stands, invulnerable entities, NPC-tagged entities, and tamed animals. EliteMobs can add combat authorization restrictions. Invalid UUID strings can raise errors in set_shooter and set_owner; invalid pickup enum names also raise errors.

Entity Table: EliteMobs Enrichment​

The EliteMobs enricher adds these values to MagmaCore entity tables. Tracking flags and the presence of elite are determined when the table is built; only fields identified as live refresh on access. FreeMinecraftModels's optional EliteMobs adapter adds elite information but does not add elite_player.

Properties​

FieldTypeDescription
is_eliteboolWhether EliteMobs tracked the entity when the table was built.
is_custom_bossboolWhether the tracked elite is a custom boss.
is_significant_bossboolWhether it is a custom boss with a health multiplier above 1.
elitetable/nilNested EliteMobs data, present only for a resolved elite.
elite.levelintElite level snapshot.
elite.namestring/nilElite display name snapshot.
elite.healthnumberLive health.
elite.max_healthnumberLive maximum health.
elite.is_custom_bossboolWhether the elite is a custom boss.
elite.health_multipliernumberConfigured health multiplier snapshot.
elite.damage_multipliernumberConfigured damage multiplier snapshot.
elite_playertable/nilPlayer-only table, resolved lazily when EliteMobs player data exists.
elite_player.tiernumberPlayer combat tier calculated from skill XP without refreshing enchantment queries.

Methods​

MethodArgsReturnsDescription
elite.remove()—nilRemove the elite through the EliteMobs removal pipeline.

Entity Table: FreeMinecraftModels Enrichment​

The FreeMinecraftModels enricher adds these snapshot values; model exists only when is_modeled is true when the table is built. Player-only values appear only on player tables. Model and permission methods query the underlying objects when called. In EliteMobs scripts, EliteMobs's optional FreeMinecraftModels adapter adds is_modeled, is_prop, and model, but not is_op or has_permission.

Properties​

FieldTypeDescription
is_modeledboolWhether FreeMinecraftModels resolves a modeled entity.
is_propboolWhether the entity is an armor-stand-backed FreeMinecraftModels prop.
modeltable/nilNested model data, present only for a modeled entity.
model.model_idstring/nilModel blueprint identifier.
model.is_dynamicboolWhether the modeled entity is dynamic.
is_opboolPlayer-only server-operator state snapshot.

Methods​

MethodArgsReturnsDescription
model.play_animation(name, blend?=false, loop?=false)string, bool?=false, bool?=falseboolReturn whether playback was accepted, including queued or suppressed attack requests; terminal death rejects playback.
model.stop_animations()—nilClear queued playback and return to idle when available; terminal death is unaffected.
model.remove()—nilRemove the modeled entity.
has_permission(node)stringboolPlayer-only permission check.

Living Entity Table​

The MagmaCore living entity table inherits every Entity Table property and method.

Properties​

FieldTypeDescription
healthnumberLive health.
maximum_healthnumberLive maximum health.
namestring/nilLive Bukkit entity name.
is_aliveboolLive inverse of Bukkit's dead state.

Methods​

MethodArgsReturnsDescription
damage(amount)numbernilDeal Bukkit damage.
push(x, y, z)number, number, numbernilImmediately add a vector to the current velocity.
set_facing(x, y, z)number, number, numbernilTeleport in place with the supplied facing direction.
add_potion_effect(type, duration, amplifier)string (PotionEffectType), int, intnilAdd a potion effect when the type resolves.
remove_potion_effect(type)string (PotionEffectType)nilRemove a potion effect when the type resolves.
get_scale()—numberReturn the effective scale attribute including modifiers, or 1.0 when unavailable.
set_scale(value)numbernilSet the scale attribute's base value when supported by the server.
set_ai(enabled)boolnilEnable or disable living-entity AI.
set_owner(player_uuid)stringboolTame a tameable entity for an online player; also clear wolf anger. False for unsupported entities or unavailable players.
has_potion_effect(type)stringboolCheck a Bukkit potion-effect name; false when the name does not resolve.

Player Table​

The MagmaCore player table inherits every Living Entity Table property and method.

In FMM scripts, the player table also exposes is_holding_elitemobs_item(filename). It checks the main-hand item's EliteMobs filename tag, independent of its display name or translation, and returns false for an empty hand, a different item, or an unavailable EliteMobs integration. Pass the custom-item filename including .yml, for example player:is_holding_elitemobs_item("shroomwhispers_shears.yml").

Properties​

FieldTypeDescription
game_modestringLowercase Bukkit game mode snapshot.

Methods​

MethodArgsReturnsDescription
send_message(text)stringnilSend text processed by MagmaCore's color parser.
chat(text)stringnilMake the player chat through Bukkit, including executing slash-prefixed commands as that player. Text passes through the color parser.
get_held_item()—table/nilReturn a {type, amount, display_name} snapshot for the main-hand item, or nil for an empty hand. type is uppercase; an unnamed item's display name falls back to its material name.
consume_held_item(amount?=1)int?=1nilQueue reducing whichever stack is in the main hand when the task runs; does not return a payment result or retain the checked item. Supply a positive amount; negative values are not rejected.
has_item(material, amount?=1)string (Material), int?=1boolTest whether the inventory contains the requested amount.
get_target_entity(range?=50)number?=50table/nilTrace from the eye against blocks and entities, excluding the player, with entity ray size 0.5; ignore fluids and passable blocks.
get_eye_location()—tableReturn the eye location.
get_look_direction()—tableReturn a unit {x, y, z} direction.
send_block_change(x, y, z, material, ticks?=-1)int, int, int, string (Material), int?=-1boolQueue a client-only block and optionally reset it after positive ticks; invalid or non-block materials return false. True means queued.
reset_block(x, y, z)int, int, intboolQueue restoring the real block for this player.
sleep(x, y, z)number, number, numbernilQueue placing a real white bed and attempting sleep; after waking or disconnecting, restore the original BlockData. Block-entity contents are not restored.
wake_up()—nilQueue waking the player when sleeping.
show_boss_bar(text, color?=WHITE, progress, ticks?=-1)string, string (BarColor)?=WHITE, number, int?=-1nilReplace the player's active solid boss bar; clamp progress to 0..1, use white for an invalid color, and optionally hide after positive ticks. Pass nil for the color to supply progress in its required third position.
hide_boss_bar()—nilRemove the player's active Lua boss bar.
show_action_bar(text, ticks?=-1)string, int?=-1nilSend once, or repeat every 40 ticks until a positive duration ends.
show_title(title, subtitle?="", fade_in, stay, fade_out)string, string?="", int, int, intnilShow a title with color-processed title and subtitle text.

Shared bars belong to the player within the host plugin's MagmaCore copy. They are not isolated by script: a new show_boss_bar replaces the player's current bar, and a new show_action_bar cancels the current repeating action bar. An expiry timer removes only the bar or action bar that started it, so an older expiry no longer clears a newer one. These UI timers and queued block changes are not owned by context.scheduler. Block changes and resets read the player's world when their tasks execute; do not depend on them restoring the intended block after a world change. Sleep cleanup first checks after 20 ticks, then every 10 ticks.

World Table​

The MagmaCore world table is exposed as context.world and captures its world when built. EliteMobs boss powers inherit it and apply the overrides documented later. Nearby queries return one-based arrays using axis-aligned boxes with radius as each half-extent; they do not exclude the script owner or filter player game modes.

Properties​

FieldTypeDescription
namestringWorld name snapshot.

Methods​

MethodArgsReturnsDescription
get_block_at(x, y, z)int, int, intstringReturn a lowercase Material name, or air without loading an unloaded chunk.
set_block_at(x, y, z, material)int, int, int, string (Material)boolQueue block placement; invalid materials return false and unloaded chunks are skipped by the queued task.
get_highest_block_y(x, z)int, intintReturn the highest block Y.
spawn_particle(particle, x, y, z, count?=1, dx?=0, dy?=0, dz?=0, speed?=0)string (Particle), number, number, number, int?=1, number?=0, number?=0, number?=0, number?=0nilSpawn a particle; invalid names do nothing.
play_sound(sound, x, y, z, volume?=1, pitch?=1)string (Sound), number, number, number, number?=1, number?=1nilPlay a registered sound or lowercase namespaced resource-pack sound key.
strike_lightning(x, y, z)number, number, numbernilStrike lightning.
get_time()—intReturn world time in ticks.
set_time(ticks)intnilSet world time.
get_nearby_entities(x, y, z, radius)number, number, number, numbertableReturn nearby Entity or Living Entity tables.
get_nearby_players(x, y, z, radius)number, number, number, numbertableReturn nearby Player tables.
spawn_entity(type, x, y, z)string (EntityType), number, number, numbertable/nilSpawn a vanilla entity; unknown enum names return nil, but valid nonspawnable types can raise errors.
raycast(from_x, from_y, from_z, dir_x, dir_y, dir_z, max_distance?=50, fluid_mode?=NEVER, blocks_only?=false, loaded_only?=false)six numbers, number?, string?, bool?, bool?table/nilReturn hit_entity, hit_location, and hit_block; fluid modes are NEVER, SOURCE_ONLY, ALWAYS. With loaded_only, refuse unloaded chunks in the ray's bounding rectangle and return nil.
place_temporary_block(x, y, z, material, ticks?=0, require_air?=false)int, int, int, string (Material), int?=0, bool?=falseboolPlace a temporary block; invalid materials or unloaded chunks return false.
drop_item(x, y, z, material, amount?=1)number, number, number, string (Material), int?=1table/nilDrop an item naturally and return its Entity Table; invalid materials return nil.
spawn_firework(x, y, z, colors, type?=BALL, power?=1)number, number, number, table, string (FireworkEffect.Type)?=BALL, int?=1nilQueue a firework using Bukkit Color constant names, defaulting to white when none resolve.
strike_lightning_at_location(location)tablenilStrike lightning in the location table's world.
play_sound_at_location(location, sound, volume?=1, pitch?=1)table, string (Sound), number?=1, number?=1nilPlay a registered sound or lowercase namespaced resource-pack sound key.
spawn_particle_at_location(location, particle, count?=1, dx?=0, dy?=0, dz?=0, speed?=0)table, string (Particle), int?=1, number?=0, number?=0, number?=0, number?=0nilSpawn through this world table. Supply a location in the same world.
get_block_at_location(location)tablestringReturn a lowercase material name, or air for an invalid location or unloaded chunk.
set_block_at_location(location, material)table, string (Material)boolQueue block placement in the location table's world.
place_temporary_block_at_location(location, material, ticks?=0, require_air?=false)table, string (Material), int?=0, bool?=falseboolPlace a temporary block in the location table's world.
get_highest_block_y_at_location(location)tableint/nilReturn the highest block Y, or nil for an invalid location.
terrain_impact_at_location(location, options?)table, table?table/nilShow a temporary visual terrain impact; options: radius=4.5 (0.5–6), intensity=1 (0–1), duration_ticks=35 (1–200), view_range=48 (1–96), seed; returns a handle or nil.
terrain_impact(x, y, z, options?)number, number, number, table?table/nilShow the same visual impact at coordinates in this world.
impact.is_active()—boolCheck whether the terrain-impact handle is active; impact.id is its string identifier.
impact.remove()—boolRemove an active impact; false if already inactive or removal fails.
get_entity(uuid)stringtable/nilResolve a valid entity in this world's loaded entity registry. Use a valid UUID string.
block_is_passable(x, y, z)int, int, intbool/nilReturn block passability, or nil for unloaded chunks or out-of-height coordinates.
location_is_protected(location)tableboolQuery registered protection providers, defaulting an omitted world to this world.
spawn_dust(location, count, red, green, blue)table, int, int, int, intnilSpawn fixed-size DUST with RGB components from 0 to 255, spread 0.1 per axis; skips unloaded chunks. Use a location in this world.

A raycast that hits nothing returns an empty table with nil hit fields. A block hit includes hit_block = {x, y, z, material} with lowercase material. The combined trace uses entity ray size 0.5 and no entity filter. loaded_only=true checks the whole bounding rectangle and can refuse a ray even when the unloaded chunk is away from its exact path. Invalid fluid names raise errors.

Shared particle names are uppercased before lookup. These positional particle methods have no data argument, so particles requiring data can raise errors; use spawn_dust for shared RGB dust. Highest-block queries and spawning methods have no general loaded-chunk guard. Block placement methods do not automatically check region protection. A true placement result is not proof that a queued edit or a require_air check succeeded.

Temporary blocks with positive ticks save the original BlockData and restore it when the timer ends, when the chunk or world unloads, or when the plugin shuts down. Restoration happens only while the block still holds the temporary block, so a later edit is not overwritten. Placing a temporary block again on a block that still holds one restarts its timer and keeps the first saved original. Blocks with block entities, such as chests and signs, unloaded chunks, and blocks already held by another temporary-block owner are skipped. Breaking a temporary block drops nothing and ends tracking without restoring; placing a block there also ends tracking. Nonpositive ticks place the block permanently without tracking. These operations are not a script-scoped rollback system.

Shared EliteMobs world additions​

EliteMobs registers these helpers on its shared world tables, including NPC scripts. They require the destination chunk to be loaded. The shared spawn_boss_at_location signature requires both a location and level; boss powers override it with the optional-argument form listed later.

MethodArgsReturnsDescription
lightning_effect_at_location(location)tablenilShow lightning without its normal damage, using the EliteMobs lightning-spawn bypass.
spawn_npc_at_location(file, location)string, tabletable/nilSpawn a configured NPC and return a handle with remove(), or nil if spawning is invalid.
spawn_boss_at_location(file, location, level)string, table, inttable/nilSpawn a configured custom boss and return a shared Living Entity Table, or nil if unavailable.

context.world: FreeMinecraftModels Additions​

FreeMinecraftModels registers these on its own MagmaCore world table, so they appear on context.world in FreeMinecraftModels prop scripts. Every method returns false when EliteMobs is not enabled or the player does not resolve. The loot helpers fall back to the player's location when their location argument is missing or unusable.

Methods​

MethodArgsReturnsDescription
start_elitemobs_transport(player, route_id)player, stringboolStart a saved EliteMobs transport route for a same-world player; false when the player or integration is unavailable.
drop_elitemobs_procedural_loot(player, level, location?)table/string, int, table?boolDrop one procedurally generated EliteMobs item for the player; returns false when procedural item drops are disabled.
drop_elitemobs_random_loot(player, level, location?)table/string, int, table?boolRoll the EliteMobs loot tables for the player at the given level.
drop_elitemobs_custom_loot(player, file, level, location?)table/string, string, int, table?boolDrop a specific EliteMobs custom item file for the player; returns false when the file does not resolve.

The player argument accepts a player table, a UUID string, or an exact player name. The location argument accepts a location table or an entity table carrying current_location. Procedural loot follows EliteMobs's direct-inventory setting, including dropping overflow at the player; it is not always dropped at the requested location.

em Helper Table​

MagmaCore exposes this table globally before any script hook runs. Its constructors create data only; they do not register a watch, load a world, or validate a complete shape. Use dot syntax for the global functions. Returned location and zone methods also accept colon syntax, mutate their table, and return that same table. Zone setters retain the supplied location table by reference.

Properties​

The helper constructors return the compact data tables below.

FieldTypeDescription
location.xnumberX coordinate returned by em.create_location.
location.ynumberY coordinate returned by em.create_location.
location.znumberZ coordinate returned by em.create_location.
location.worldstring/nilWorld name when supplied to em.create_location.
location.yawnumber/nilYaw when supplied to em.create_location.
location.pitchnumber/nilPitch when supplied to em.create_location.
vector.xnumberX component returned by em.create_vector.
vector.ynumberY component returned by em.create_vector.
vector.znumberZ component returned by em.create_vector.
zone.kindstringsphere, dome, cylinder, cuboid, cone, static_ray, rotating_ray, or translating_ray.
zone.radiusnumber/nilSphere, dome, cylinder, or cone radius.
zone.heightnumber/nilCylinder height.
zone.xnumber/nilCuboid X size.
zone.ynumber/nilCuboid Y size.
zone.znumber/nilCuboid Z size.
zone.lengthnumber/nilCone or ray length.
zone.thicknessnumber/nilStatic-ray thickness.
zone.point_radiusnumber/nilRotating- or translating-ray point radius.
zone.animation_durationnumber/nilRotating- or translating-ray animation duration.
zone.origintable/nilLocation set by set_center or set_origin.
zone.destinationtable/nilLocation set by set_destination.

Methods​

MethodArgsReturnsDescription
em.create_location(x, y, z, world?, yaw?, pitch?)number, number, number, string?, number?, number?tableReturn a location table.
em.create_vector(x, y, z)number, number, numbertableReturn an {x, y, z} vector table.
location.add(dx?=0, dy?=0, dz?=0)number?=0, number?=0, number?=0tableAdd in place and return the same location table.
em.zone.create_sphere_zone(radius)numbertableReturn a sphere definition with set_center(location).
em.zone.create_dome_zone(radius)numbertableReturn a dome definition with set_center(location).
em.zone.create_cylinder_zone(radius, height)number, numbertableReturn a cylinder definition with set_center(location).
em.zone.create_cuboid_zone(x, y, z)number, number, numbertableReturn a cuboid definition with set_center(location).
em.zone.create_cone_zone(length, radius)number, numbertableReturn a cone definition with set_origin(location) and set_destination(location).
em.zone.create_static_ray_zone(length, thickness)number, numbertableReturn a static-ray definition with origin and destination setters.
em.zone.create_rotating_ray_zone(length, point_radius, animation_duration)number, number, numbertableReturn a rotating-ray definition with origin and destination setters.
em.zone.create_translating_ray_zone(length, point_radius, animation_duration)number, number, numbertableReturn a translating-ray definition with origin and destination setters.
zone.set_center(location)tabletableSet the center as zone.origin and return the same zone table.
zone.set_origin(location)tabletableSet the origin and return the same zone table.
zone.set_destination(location)tabletableSet the destination and return the same zone table.
em.location.is_in_dungeon(location)tableboolTest registered dungeon regions and owners reporting the dungeon kind.
em.location.is_protected(location)tableboolTest built-in WorldGuard/GriefPrevention adapters and plugin-registered protection owners.
em.location.owned_by(location, namespace)table, stringboolTest ownership by a plugin namespace.
em.location.owners(location)tabletableReturn an array of owner namespace strings.
em.location.kinds_at(location)tabletableReturn an array of ownership kind strings.
em.location.has_kind(location, kind)table, stringboolTest an ownership kind.

For em.location.*, world must be a loaded-world name or a table with name; there is no owner-world fallback. Missing or unresolved worlds return false or an empty array, and missing coordinates default to zero. Ownership namespaces are case-sensitive; kind tags are case-insensitive. Ownership alone implies neither dungeon membership nor protection. Queries reflect registered providers, not every possible protection plugin; a failing registered region adapter reports protected. Owner and kind arrays have no guaranteed order.

Mind program context​

Native Mind callbacks use this context instead of the ordinary power/NPC context. File-backed behavior programs also load from plugins/EliteMobs/behaviors/; see boss behavior configuration. EliteMobs integrations register ai.program and ai.module definitions through EliteMindService; placing these definitions in the ordinary powers directory does not register a Mind program.

FieldTypeDescription
tick, generationnumberCurrent game tick and runtime generation.
entitytableShared Living Entity Table for the actor.
memory, perception, actuator, actionstableCallback-scoped services below.
MethodArgsReturnsDescription
memory.get(key)stringvalue/nilRead a declared memory key.
memory.set(key, value, ttl_ticks?)string, value, int?nilSet a declared memory using its configured type, optionally with an expiry.
memory.forget(key)stringnilRemove a declared memory.
memory.contains(key)stringboolCheck for a declared memory value.
perception.current_target()—table/nilReturn the current target as a shared Living Entity Table.
perception.nearest_player(radius)numbertable/nilReturn the nearest player in range.
perception.can_see(entity_or_uuid)table/stringboolCheck line of sight to a living entity.
perception.navigation()—tableReturn destination_active, navigation_in_progress, consecutive_stuck_ticks, optional destination, and optional last_progress with tick and position.
actuator.move_to(location, speed?=1)table, number?=1boolRequest navigation to a same-world location with a finite, positive speed; false when pathfinding did not start.
actuator.stop_moving()—nilStop navigation.
actuator.look_at(location)tablenilLook toward a location.
actuator.jump()—nilRequest a jump.
actuator.set_target(entity_or_uuid)table/stringboolSet a living target; false if it cannot be resolved.
actuator.clear_target()—nilClear the target.
actuator.attack(entity_or_uuid)table/stringboolRequest an attack; false if the target cannot be resolved.
actuator.stop_all()—nilStop the movement, target, and attack that this behavior's held controls cover.
actions.request(identifier, payload?)string, table?stringRequest a semantic action and return its lowercase result; payload values support scalars, entity UUID tables, and world/x/y/z position tables.

Each callback builds service sections on first access and reuses them within that callback. Memory keys must be declared; undeclared keys raise an error. A successful actuator.set_target or actuator.attack return means that a living target resolved and the request was forwarded, not that navigation or an attack completed. Action payloads accept the supported scalar or entity/position values, not arbitrary nested Lua tables. Action identifiers must be lowercase namespaced keys of at most 128 characters; payloads hold at most 16 entries with lowercase keys of at most 64 characters, and string values are limited to 256 characters. Every actuator method except stop_all, and actions.request, raises an error unless the calling behavior holds the matching control. Sensors cannot use the actuator or actions at all. Lua-authored behavior programs are described in Behavior Programs.

ai global​

MagmaCore installs this global in every Lua environment. The constructors only tag the table they receive; EliteMobs compiles the tagged tables from behavior program files.

FieldTypeDescription
ai.controls.move, look, jump, target, attack, use_item, actionstringControl names for a behavior's controls array; use_item has no Lua actuator method.
MethodArgsReturnsDescription
ai.program(definition)tabletableTag a program definition with id, revision, optional modules, memories, sensors, behaviors, budget, and runaway.
ai.module(definition)tabletableTag a module definition with id, revision, optional dependencies, memories, sensors, and behaviors.
ai.sensor(definition)tabletableTag a sensor with id, interval?=1, and sense(c).
ai.behavior(definition)tabletableTag a behavior with id, priority?=0, controls, can_start, can_continue, start, tick, and stop(c, reason).

context.mind_action: EliteMobs Power Hook​

Available during on_mind_action(context). The hook returns "accepted", "deferred", or "rejected"; attached powers are visited in attachment order until one accepts.

FieldTypeDescription
keystringNamespaced semantic action identifier.
payloadtableLua copy of the action payload; editing it does not change the original request. UUID values are strings and positions are {world, x, y, z} tables.
game_tick, generationnumberAction tick and runtime generation.

context.state​

Every MagmaCore script instance receives a plain Lua table that persists for that instance's lifetime. Use it for counters, flags, task IDs, and values shared between hooks.

context.state.counter = (context.state.counter or 0) + 1

context.log​

MagmaCore, FreeMinecraftModels, and EliteMobs NPC Methods​

MethodArgsReturnsDescription
info(message)stringnilLog an informational message with the shared Lua prefix.
warn(message)stringnilLog a warning.
error(message)stringnilLog through the shared warning channel.

EliteMobs Boss-Power Methods​

MethodArgsReturnsDescription
info(message)stringnilLog an informational boss-power message.
warn(message)stringnilLog a warning.
debug(message)stringnilLog an informational message with the Lua-power debug prefix.

context.scheduler​

Scheduled tasks belong to the script instance and are cancelled when it shuts down. Both naming families below are available on shared MagmaCore surfaces and EliteMobs boss powers.

Callbacks receive a fresh context, normally without event or a triggering player. Capture needed values or UUIDs before scheduling, then resolve the current entity. Retaining the original context does not safely retain its lazily resolved event. While paused, due one-shot tasks wait and repeating tasks skip runs without replaying them. Callback errors close the script. Shutdown cancels owned tasks and watches; it does not undo arbitrary entity/world edits or cancel every helper's independent timer.

MethodArgsReturnsDescription
run_later(ticks, callback)int, functionintRun once after the delay and return the Bukkit task ID.
run_repeating(delay, interval, callback)int, int, functionintRun repeatedly after an initial delay and return the task ID.
cancel(task_id)intnilCancel an owned task.
run_after(ticks, callback)int, functionintAlias for run_later.
run_every(interval, callback)int, functionintRun repeatedly with no initial delay and return the task ID.
cancel_task(task_id)intnilAlias for cancel.

context.cooldowns​

Omitting a local key uses __lua: followed by the script filename. Explicit keys are used exactly as supplied. Shared MagmaCore local stores belong to the script's owner adapter: FMM creates a separate adapter per prop script, while all scripts on one EliteMobs NPC share an adapter and can collide on an explicit local key. FMM global cooldowns are shared across scripts on the same prop; NPC global cooldowns are shared on that NPC adapter.

EliteMobs boss powers use the boss's shared store for local keys and its built-in power cooldown for global state. Local timers, plus shared MagmaCore global timers, measure real elapsed time at 50 ms per tick, including pauses and low server TPS. Boss global cooldowns count server ticks and keep the later expiry: a shorter set_global never shortens an active global cooldown, and a non-positive duration does nothing. Checking or setting a local cooldown does not check or set the global cooldown automatically.

MethodArgsReturnsDescription
local_ready(key?)string?boolTest whether the keyed local cooldown is ready.
local_remaining(key?)string?intReturn remaining ticks, or 0 when ready.
check_local(key, duration)string/nil, intboolIf ready, start the cooldown and return true. Pass nil for the default key.
set_local(duration, key?)int, string?nilSet or clear the local cooldown; a non-positive duration clears it.
global_ready()—boolTest whether the owner's global cooldown is ready.
set_global(duration)intnilSet the global cooldown in ticks. On shared MagmaCore surfaces, a non-positive duration clears it.

context.zones: Shared MagmaCore Surface​

FreeMinecraftModels scripts, EliteMobs NPC scripts, and other default MagmaCore consumers receive integer zone handles in the current script owner's world.

MethodArgsReturnsDescription
create_sphere(x, y, z, radius)number, number, number, numberint/nilRegister a sphere and return its handle, or nil when the owner has no world.
create_cylinder(x, y, z, radius, height)number, number, number, number, numberint/nilRegister a cylinder and return its handle, or nil when the owner has no world.
create_cuboid(x, y, z, x_size, y_size, z_size)number, number, number, number, number, numberint/nilRegister a cuboid and return its handle, or nil when the owner has no world.
watch(handle, on_enter?, on_leave?)int, function?, function?bool/nilEnable boundary tracking for a known handle. Function presence enables the corresponding on_zone_enter or on_zone_leave hook; the supplied function body is not called directly.
unwatch(handle)intnilStop tracking and remove the handle.

Generic watches test player location points. Cuboid sizes are half-extents in this path (zero Z substitutes nonzero X); this does not establish the same volume as EliteMobs entity-overlap or sampled-location queries. Zones retain their creation coordinates and world while each tick scans players in the owner's current world. Generic zone hooks expose the crossing player through context.player and context.event.player.

Creation starts membership tracking immediately, before watch installs hook dispatchers. Installing a watcher later does not emit an entry for a player already tracked inside. Omitting a callback in a second watch call does not clear a previously installed dispatcher. Disconnects and unwatch do not guarantee a leave hook. Zone checks run before on_game_tick.

context.event: Shared MagmaCore Surface​

This table exists while a shared hook has a current Bukkit event or actor. It is absent from scheduled callbacks and hooks without either value.

Field or MethodTypeDescription
is_cancelledboolCancellation state captured when the event subtable was first resolved; calling cancel() or uncancel() does not refresh this field.
cancel()methodCancel the current event. Present only when it implements Bukkit Cancellable.
uncancel()methodUn-cancel the current event. Present only when it implements Bukkit Cancellable.
playertableLiving Entity Table for the current actor when one is available.

Generic zone hooks provide an actor but no cancellable Bukkit event, so they expose is_cancelled = false and player without cancel() or uncancel().

context.item​

Enchantment action scripts expose this table when their captured source has an inventory slot and item. It addresses that exact slot and checks the current item's material and metadata against the snapshot, ignoring damage and stack amount. It does not search the player's inventory or track an item's unique identity: an equivalent replacement in the captured slot also matches. It can be nil for consumed ammunition. This is distinct from the retired FreeMinecraftModels equipped-item runtime.

MethodArgsReturnsDescription
get_durability()—table/nilRemaining {current, max} durability; nil for unavailable or nondamageable items.
get_durability_percentage()—number/nilRemaining durability divided by the material's maximum; normally 0..1, but externally over-damaged metadata can fall outside that range.
use_durability(amount, can_break?=false)int, bool?boolChange damage; negative amounts repair. By default retain at least one durability; can_break=true can consume the stack.
use_durability_percentage(fraction, can_break?=false)number, bool?boolApply ceil(max_durability * fraction) damage with the same break policy.
consume(amount)positive intboolConsume from the captured stack only when enough items remain.

Durability uses the material's maximum, not a custom max-damage component. These direct changes do not apply vanilla wear calculations, Unbreaking, unbreakable checks, or player item-damage events. Percentage changes require finite values and an integer-range result; negative fractions repair. Breaking consumes the entire captured stack. For the action lifecycle and complete context, see authored enchantments.

context.prop​

FreeMinecraftModels prop scripts receive this table, which inherits the MagmaCore Entity Table when a backing entity exists.

Properties​

FieldTypeDescription
model_idstring/nilModel blueprint name, or nil when no blueprint exists.
current_locationtable/nilLive prop location.

Methods​

MethodArgsReturnsDescription
play_animation(name, blend?=true, loop?=true)string, bool?=true, bool?=trueboolPlay the named animation.
stop_animation()—nilClear queued playback and return to idle when available; the terminal death state is unaffected.
hurt_visual()—nilPlay the red-tint hurt visual without damage.
pickup()—nilQueue permanent removal and drop a placement item.
has_mount_points()—boolTest whether the prop has mount-point bones.
mount(player)tableboolQueue mounting a resolved player on the first available seat.
dismount(player)tableboolQueue dismounting a resolved player from this prop.
get_passengers()—tableReturn mounted player Entity Tables.
spawn_elitemobs_boss(file, x, y, z)string, number, number, numbertable/nilSpawn an EliteMobs custom boss when EliteMobs is enabled.
open_inventory(player, title, rows?=3)table, string, int?=3boolQueue opening persistent storage with rows clamped from 1 to 6.
place_book(player)tableboolQueue storing one held written or writable book when the prop has none.
read_book(player)tableboolQueue opening a stored written book.
take_book(player)tableboolQueue returning the stored book to the player.
has_book()—boolTest whether the prop stores a book.
drop_inventory()—boolQueue clearing persistent storage and dropping its items.
drop_book()—boolQueue clearing and dropping the stored book.
is_viewing_inventory(player)tableboolTest whether the player is viewing this prop's tracked inventory.
set_persistent_data(key, value)string, stringboolStore a string under the prop-scoped fmm_lua_ key.
get_persistent_data(key)stringstring/nilReturn the stored string, or nil.

For queued prop operations, true means the initial player/backing-entity checks passed, not that a seat was available, a book was stored, or a GUI opened. take_book removes storage before inserting the book and does not drop inventory overflow. All viewers of one prop share a single live inventory, saved when the last viewer closes it; while it is open, later calls reuse its title and size. Stored contents larger than the requested rows open at their stored size, so no slots are dropped. Prop data is stored on the backing armor stand; a newly generated placement item is not a promise to preserve that data through pickup.

In on_projectile_hit, prop scripts also receive context.projectile, a shared Entity Table for the projectile. The hook does not fire when another plugin already cancelled the hit. context.event wraps the cancellable FreeMinecraftModels hit event, and context.event.player is the shooter when it is a living entity, including mobs; context.player is set only when a player fired the projectile.

context.npc​

EliteMobs NPC scripts inherit the shared MagmaCore contexts and add this NPC-specific table.

Properties​

FieldTypeDescription
namestringConfigured NPC display name.
filenamestringNPC configuration filename.
uuidstringRuntime NPC UUID.
activation_radiusnumberConfigured activation radius.
current_locationtableLocation snapshot, present only while the backing living entity exists.
entity_typestringUppercase Bukkit entity type, present only while the backing living entity exists.

Methods​

MethodArgsReturnsDescription
is_valid()—boolTest whether the NPC is valid.
remove()—nilRemove the NPC through its owning lifecycle.
get_location()—tableReturn the current NPC location, falling back to its spawn location. The table also includes a direction vector.
get_eye_location()—tableReturn the current eye location, falling back to the spawn location. The table also includes a direction vector.
get_activation_radius()—numberReturn the current configured activation radius.
get_nearby_players(radius)numbertableReturn same-world Player Tables within a 3D radius of the NPC's feet, without a game-mode filter.
face_direction_or_location(target)tablenilFace a vector direction or same-world location; ignored while patrol movement is active.
say_greeting(player?)table/string?nilSend the configured greeting, defaulting to the triggering player when available. A player table, UUID, or name is accepted.
say_dialog(player?)table/string?nilSend configured dialog with the same player resolution.
say_farewell(player?)table/string?nilSend the configured farewell with the same player resolution.
play_model_animation(name)stringnilPlay a model animation when a custom model exists.
patrol_pause()—boolPause the configured patrol.
patrol_resume()—boolResume the configured patrol after a scripted hold or walk.
walk_to(x, y, z)number, number, numberboolWalk to an authored-origin offset, then resume patrol.
hold(x, y, z)number, number, numberboolWalk to an authored-origin offset and remain there.
teleport(x, y, z)number, number, numberboolTeleport to an entity-ticking authored-origin offset.

EliteMobs Power Location Table​

EliteMobs boss-power tables return this location shape from get_location(), get_eye_location(), current_location, and other location results. A missing location returns an empty table.

Properties​

FieldTypeDescription
x, y, znumberCoordinates.
yaw, pitchnumberRotation.
worldstring/nilWorld name when the location has a world.
directiontableUnit {x, y, z} facing vector.

Methods​

MethodArgsReturnsDescription
add(dx?=0, dy?=0, dz?=0)number?=0, number?=0, number?=0tableAdd to the coordinates in place and return the same table; direction is not updated.

EliteMobs Power Entity Reference Table​

EliteMobs boss-power methods return this lightweight table for non-living entities such as projectiles, fireworks, and falling blocks.

Properties​

FieldTypeDescription
namestringEntity name snapshot.
uuidstringEntity UUID.
entity_typestringUppercase Bukkit entity type snapshot.
is_playerboolAlways false.
is_eliteboolAlways false.
is_mountboolFalse unless a boss marks a returned mount table true.
current_locationtableLocation snapshot.

Methods​

MethodArgsReturnsDescription
is_valid()—boolTest live validity.
get_location()—tableReturn the live location.
get_velocity()—tableReturn the live velocity.
is_on_ground()—boolTest the live ground state.
teleport_to_location(location)tablenilTeleport when the location resolves.
set_velocity_vector(vector)tablenilSet velocity when the vector resolves.
set_direction_vector(vector)tablenilSet a fireball direction when applicable.
set_yield(amount)numbernilSet fireball yield when applicable.
set_gravity(enabled)boolnilSet gravity.
detonate()—nilDetonate when the entity is a firework.
remove()—nilRemove the entity.
unregister(reason?=OTHER)string?=OTHERnilUnregister using DEATH, PHASE_BOSS_RESET, PHASE_BOSS_PHASE_END, CHUNK_UNLOAD, WORLD_UNLOAD, SHUTDOWN, EFFECT_TIMEOUT, BOSS_TIMEOUT, NPC_TIMEOUT, OTHER, UNSPECIFIED_WATCHDOG_REMOVAL, REMOVE_COMMAND, KILL_COMMAND, REINFORCEMENT_CULL, ENTITY_REPLACEMENT, or ARENA_RESET.
is_inside_vehicle()—boolTest whether the entity is riding a vehicle.
has_vehicle()—boolTest whether a vehicle exists.
get_vehicle()—table/nilReturn the current vehicle reference.
set_vehicle(vehicle)tableboolMake this entity ride the resolved vehicle.
leave_vehicle()—boolLeave the current vehicle.
has_passengers()—boolTest whether passengers exist.
get_passenger_count()—intReturn the passenger count.
get_passengers()—tableReturn passenger references.
add_passenger(passenger)tableboolAdd the resolved passenger.
remove_passenger(passenger)tableboolRemove the resolved passenger.
eject_passengers()—boolEject every passenger.

EliteMobs Power Living Entity Table​

EliteMobs boss-power living values use this separate table; the Boss and EliteMobs Power Player tables inherit it.

Properties​

FieldTypeDescription
namestringEntity name snapshot.
uuidstringEntity UUID.
entity_typestringUppercase Bukkit entity type snapshot.
is_playerboolWhether the entity is a player.
is_monsterboolWhether the entity implements Bukkit Monster.
is_eliteboolWhether EliteMobs tracks the entity.
is_mountboolWhether the tracked custom boss is a mount.
is_validboolValidity snapshot.
healthnumberHealth snapshot.
maximum_healthnumberMaximum-health snapshot.
current_locationtableLocation snapshot.

Methods​

MethodArgsReturnsDescription
is_alive()—boolTest live validity and death state.
is_ai_enabled()—boolReturn the live AI state.
is_frozen()—boolReturn the EliteMobs custom-boss frozen setting, or false.
get_location()—tableReturn the live location.
get_eye_location()—tableReturn the live eye location.
get_height()—numberReturn Bukkit entity height.
get_health()—numberReturn live health.
get_maximum_health()—numberReturn live maximum health.
get_velocity()—tableReturn live velocity.
deal_damage(amount)numbernilDeal generic Bukkit damage.
deal_custom_damage(amount)numbernilSubmit raw custom damage from the boss to a living target; skips the boss itself, invulnerable or dead targets, and players outside Survival/Adventure. Subject to instance policy and damage-event cancellation.
deal_damage_from_boss(amount)numbernilDeal Bukkit damage attributed to the power's boss.
restore_health(amount)numbernilHeal through EliteMobs when tracked, otherwise clamp Bukkit health to maximum.
play_sound_at_entity(sound, volume_or_options?=1, pitch?=1)string (Sound), number/table?=1, number?=1nilPlay a registered or custom namespaced sound at the entity. The second argument may instead be {volume, pitch}.
play_sound_at_self(sound, volume_or_options?=1, pitch?=1)string (Sound), number/table?=1, number?=1nilAlias that plays at the entity. The second argument may instead be {volume, pitch}.
spawn_particle_at_self(particle, count?=1)string (Particle)/table, int?=1nilSpawn a particle string or particle-spec table at the entity.
spawn_particles_at_location(location, particle, count?=1, dx?=0, dy?=0, dz?=0, speed?=0)table, string (Particle), int?=1, number?=0, number?=0, number?=0, number?=0nilSpawn a particle at a location.
teleport_to_location(location)tablenilTeleport when the location resolves.
set_velocity_vector(vector)tablenilSet velocity when the vector resolves.
set_gravity(enabled)boolnilSet gravity.
is_on_ground()—boolTest the live ground state.
apply_push_vector(vector, additive?=false, delay?=1)table, bool?=false, int?=1nilApply velocity after a delay, optionally adding to current velocity.
set_custom_name(name)stringnilSet a color-processed custom name.
reset_custom_name()—nilRestore the EliteMobs name when tracked, otherwise the Bukkit name.
set_custom_name_visible(visible)boolnilSet custom-name visibility.
set_ai_enabled(enabled, duration?=0)bool, int?=0nilSet AI as an owned change; positive ticks restore the replaced value. true ends this power's active AI change, if any, instead of applying a new value.
set_awareness_enabled(enabled, duration?=0)bool, int?=0nilSet mob awareness as an owned change; positive ticks restore the replaced value. true ends this power's active awareness change, if any, instead of applying a new value.
face_direction_or_location(target)tablenilFace a vector or same-world location.
play_model_animation(name)stringnilPlay a custom-model animation when available.
set_scale(scale, duration?=0)number, int?=0nilSet the base scale as an owned change; positive ticks restore the replaced value.
set_invulnerable(enabled, duration?=0)bool, int?=0nilSet invulnerability as an owned change; positive ticks restore the replaced value.
remove_elite()—nilRemove a tracked elite through the EliteMobs removal pipeline.
is_healing()—boolTest the tracked elite's healing state.
set_healing(enabled)boolniltrue marks a tracked elite as healing when it is not already; false clears only healing this power set. Power shutdown clears healing it still owns.
navigate_to_location(location, speed?=1, force?=false, timeout?=0)table, number?=1, bool?=false, int?=0nilNavigate a tracked custom boss.
add_tag(tag, duration?=0)string, int?=0nilAdd a tag and remove it after positive ticks.
remove_tag(tag)stringnilRemove a tag.
has_tag(tag)stringboolTest an entity, elite, or player tag.
push_relative_to(location, force?=1, extra_x?=0, extra_y?=0, extra_z?=0)table, number?=1, number?=0, number?=0, number?=0nilImmediately replace velocity with a normalized outward vector times force, plus world-axis offsets. Supply a source in the same world.
overlaps_box_at_location(center, half_x?=0.5, half_y?=half_x, half_z?=half_x)table, number?=0.5, number?, number?boolTest the entity bounding box against the requested box.
is_inside_vehicle()—boolTest whether the entity is riding a vehicle.
has_vehicle()—boolTest whether a vehicle exists.
get_vehicle()—table/nilReturn the current vehicle reference.
set_vehicle(vehicle)tableboolMake this entity ride the resolved vehicle.
leave_vehicle()—boolLeave the current vehicle.
has_passengers()—boolTest whether passengers exist.
get_passenger_count()—intReturn the passenger count.
get_passengers()—tableReturn passenger references.
add_passenger(passenger)tableboolAdd the resolved passenger.
remove_passenger(passenger)tableboolRemove the resolved passenger.
eject_passengers()—boolEject every passenger.
apply_potion_effect(type, duration, amplifier?=0)string (PotionEffectType), int, int?=0nilResolve an uppercased Bukkit potion name and apply it when instance policy permits. Amplifiers are zero-based.
set_equipment(slot, material, options?)string (EquipmentSlot), string (Material), table?nilSet equipment; options support unbreakable and enchantments entries with type and level.
damage_equipment(slot, amount)string, intintApply 1–64 durability damage to HAND, OFF_HAND, HEAD, CHEST, LEGS, or FEET; returns actual damage, respects player damage-event cancellation and unbreakable items, and can break the item.
set_fire_ticks(ticks)intnilSet fire ticks when instance policy permits.
add_visual_freeze_ticks(ticks?=1)int?=1nilAdd to Minecraft freeze ticks when instance policy permits; this can cause freezing damage and is not an AI or movement lock.
place_temporary_block(material, ticks?=0, require_air?=false)string (Material), int?=0, bool?=falsenilPlace a temporary block at the entity.

AI, awareness, scale, and invulnerability changes are owned by the calling power. Each records the value it replaced. A positive duration restores that value after the given ticks; a duration of 0 keeps the change until the power shuts down, which also restores it. When several powers change the same property, ending one change restores the most recent remaining change, or the original value when none remain. If another plugin or command changes the property in the meantime, its value is kept and nothing is restored. Pausing a power does not end these changes. Delayed apply_push_vector and tag-removal timers still run independently of the script-owned scheduler. reset_custom_name restores a tracked elite's name; for an ordinary Bukkit entity it uses the entity's current name, not a saved original name.

EliteMobs Power Player Table​

EliteMobs boss-power player values inherit every EliteMobs Power Living Entity property and method.

Properties​

FieldTypeDescription
game_modestringUppercase Bukkit game mode snapshot.

Methods​

MethodArgsReturnsDescription
send_message(text)stringnilSend color-processed chat text.
show_action_bar(text)stringnilSend a color-processed action bar.
show_title(title, subtitle?="", fade_in?=10, stay?=40, fade_out?=10)string, string?="", int?=10, int?=40, int?=10nilShow a color-processed title.
show_boss_bar(title, color?=WHITE, style?=SOLID, duration?=40)string, string (BarColor)?=WHITE, string (BarStyle)?=SOLID, int?=40nilShow a boss bar and remove it after positive ticks.
run_command(command)stringnilRun a command as the player.

context.boss​

EliteMobs boss powers receive this table, which inherits every EliteMobs Power Living Entity property and method and overrides the rows listed here with elite-level semantics.

Properties​

FieldTypeDescription
namestringElite display name or script filename snapshot.
uuidstringElite UUID.
healthnumberElite health snapshot.
maximum_healthnumberElite maximum-health snapshot.
current_locationtableElite location snapshot.
levelintElite level snapshot.
damager_countintDamager-count snapshot.
is_in_combatboolCombat-state snapshot.
existsboolElite existence snapshot.

Methods​

MethodArgsReturnsDescription
is_alive()—boolTest the living entity and EliteMobs existence state.
get_health()—numberReturn live elite health.
get_maximum_health()—numberReturn live elite maximum health.
get_location()—tableReturn the live elite location.
restore_health(amount)numbernilHeal through the EliteMobs entity.
add_tag(tag, duration?=0)string, int?=0nilAdd an elite tag and remove it after positive ticks.
remove_tag(tag)stringnilRemove an elite tag.
has_tag(tag)stringboolTest an elite tag.
reset_custom_name()—nilRestore the elite display name.
play_sound_at_self(sound, volume_or_options?=1, pitch?=1)string (Sound), number/table?=1, number?=1nilPlay a registered or custom namespaced sound at the elite location. The second argument may instead be {volume, pitch}.
play_sound_at_entity(sound, volume_or_options?=1, pitch?=1)string (Sound), number/table?=1, number?=1nilAlias that plays at the elite location. The second argument may instead be {volume, pitch}.
spawn_particle_at_self(particle, count?=1)string (Particle)/table, int?=1nilSpawn a particle at the elite location.
play_model_animation(name)stringnilPlay the custom boss model animation when available.
navigate_to_location(location, speed?=1, force?=false, timeout?=0)table, number?=1, bool?=false, int?=0nilNavigate a custom boss.
get_damager_count()—intReturn the live damager count.
despawn()—nilRemove the elite with reason OTHER.
remove()—nilAlias for despawn().
patrol_pause()—boolPause the configured patrol.
patrol_resume()—boolResume the configured patrol after a scripted hold or walk.
walk_to(x, y, z)number, number, numberboolWalk to an authored-origin offset, then resume patrol.
hold(x, y, z)number, number, numberboolWalk to an authored-origin offset and remain there.
teleport(x, y, z)number, number, numberboolTeleport to an entity-ticking authored-origin offset.
get_ender_dragon_phase()—string/nilReturn the EnderDragon.Phase name, or nil.
set_ender_dragon_phase(phase)string (EnderDragon.Phase)nilSet a valid ender-dragon phase.
has_mount()—boolTest whether the boss has a live mount vehicle.
get_mount()—table/nilReturn the mount reference marked with is_mount = true.
set_mount(mount)tableboolMake the boss ride the resolved entity.
clear_mount()—boolLeave the current vehicle.
dismount()—boolAlias for clear_mount().
start_tracking_fireball_system(speed?=0.5)number?=0.5nilFor a monster boss, fire tracking fireballs at Survival/Adventure players within 20 blocks on each axis on the next tick and every 160 ticks while it has a target. The power owns this task: pausing pauses it, and losing the target or shutting down stops it. Speed must be finite and positive.
handle_spirit_walk_damage(cause)string (DamageCause)nilRun Spirit Walk damage handling.
shield_wall_is_active()—boolTest the shield-wall state.
initialize_shield_wall(openingDirection?=1)int?=1nilInitialize directional pools equal to the boss level. Opening: 1 north, 2 east, 3 south, 4 west; other integers protect all sides. Already-active walls are unchanged.
shield_wall_absorb_damage(player, damage)table, numberboolSubtract damage from the attacker's side if that pool was positive; true means the script should cancel the damage event itself. Does not cancel it automatically.
deactivate_shield_wall()—nilStop the independent wall task and remove its state and visuals. Lua closure alone does not deactivate it.
start_zombie_necronomicon(target, chant)table, stringnilStart the independent controller for a living target. The string is display text, not a filename; summons fixed necronomicon zombie/skeleton files at the caster's level.
send_message(text, range?=20)string, number?=20nilSend color-processed text to players within range.
get_nearby_players(range)numbertableReturn nearby EliteMobs Power Player tables.
get_nearby_elites(radius)numbertableReturn at most 32 living tracked elites in the same world, excluding this boss, nearest first with UUID tie-breaks; radius must be greater than 0 and at most 64.
get_target_player()—table/nilReturn the current mob target when it is a player.
get_nearby_players_in_zone(zone)tabletableReturn players contained by the zone.
spawn_particles_in_zone(zone, particle, count?=1, dx?=0, dy?=0, dz?=0, speed?=0, coverage?=1)table, string (Particle), int?=1, number?=0, number?=0, number?=0, number?=0, number?=1nilSample the zone interior and spawn particles.
spawn_particles_in_zone_border(zone, particle, count?=1, dx?=0, dy?=0, dz?=0, speed?=0, coverage?=1)table, string (Particle), int?=1, number?=0, number?=0, number?=0, number?=0, number?=1nilSample the zone edge and spawn particles.
get_particles_from_self_toward_zone(zone, particle, speed?=0.1)table, string (Particle), number?=0.1tableBuild directional particle specs from the boss toward sampled zone points.
get_particles_toward_self(zone, particle, speed)table, string (Particle), numbertableBuild directional particle specs toward the boss; the live builder currently reads speed from the final supplied argument.
spawn_particles_with_vector(particles)tablenilSpawn an array of directional particle specs.
summon_reinforcement(file, zone_or_location?, duration?=0)string, table?, int?=0table/nilSummon a reinforcement at a sampled zone point, location, or the boss; positive duration removes it after that many ticks.
summon_projectile(type, origin, destination, speed?=1, options?)string (EntityType), table, table, number?=1, table?table/nilSpawn a projectile; options support custom_damage, detonation_power, yield, incendiary, gravity, glowing, invulnerable, persistent, duration, EntityEffect effect, spawn_at_origin, direction_only, track, on_land, and max_ticks.

context.players: EliteMobs Boss Powers​

MethodArgsReturnsDescription
current_target()—table/nilReturn the event actor when it is a player, otherwise the boss's current mob target when it is a player.
nearby_players(radius)numbertableReturn Player Tables within the radius of the boss.
all_players_in_world()—tableReturn all Player Tables in the boss's current world.

context.entities: EliteMobs Boss Powers​

The collection queries exclude the boss itself. Living filters accept player/players, elite/elites, mob/mobs, or any other value for all living entities. They do not impose a Survival/Adventure or dungeon-instance membership filter. The direct-target lookup returns the hook's supplied target independently of those collection filters.

MethodArgsReturnsDescription
get_nearby_entities(radius, filter?="living")number, string?tableLiving filters use a 3D feet-location radius. all or entities instead uses Bukkit's axis-aligned box query and includes non-living entities.
get_entities_in_box(center, half_x, half_y, half_z, filter?="living")table, number, number, number, string?tableReturn living entities whose feet locations lie inside the box, including its boundary.
get_all_entities(filter?="living")string?tableReturn matching living entities in the boss's world.
get_direct_target_entity()—table/nilReturn the direct target supplied by the current hook.
get_boss_spawn_location()—tableReturn the boss's original spawn location.

context.vectors: EliteMobs Boss Powers​

MethodArgsReturnsDescription
get_vector_between_locations(source, destination, options?)table, table, table?tableReturn the vector between same-world locations, or {x=0,y=0,z=0} for invalid or cross-world input. Options support normalize, multiplier, and vector offset.
rotate_vector(vector, pitch?=0, yaw?=0)table, number?=0, number?=0tableReturn the vector rotated by pitch and yaw in degrees.
normalize_vector(vector)tabletableReturn a unit vector; a zero vector remains zero.

context.zones: EliteMobs Boss Powers​

EliteMobs boss powers replace the shared integer-handle zone surface with Elite Script zone-definition queries.

Entity membership, point containment, and sampled particle locations are separate shape operations and can differ at boundaries. coverage changes sampled locations, not entity selection. watch_zone captures a shape and calls each supplied callback with an entity table, not a context; it starts checking after one tick and reports entities already inside as entries. Stopping a watch does not emit leave callbacks.

MethodArgsReturnsDescription
get_entities_in_zone(zone, options?)table, table?tableReturn matching living entities. Options support filter and mode = "full" or "border".
get_locations_in_zone(zone, options?)table, table?tableReturn sampled locations. Options support coverage and mode = "full" or "border".
zone_contains(zone, location, mode?="full")table, table, string?boolTest whether the location is in the full shape or border.
watch_zone(zone, callbacks, options?)table, table, table?nilWatch with {on_enter, on_leave} callbacks. Options support filter and mode; the owned watch stops with the script.

context.script: EliteMobs Boss Powers​

This bridge accepts the same table keys as Elite Script target, zone, and relative-vector YAML configuration.

Methods​

MethodArgsReturnsDescription
target(spec)tabletarget handleCreate a target handle.
zone(spec)tablezone handleCreate a zone handle.
relative_vector(spec, location?, zone?)table, table?, zone handle?vector handleCreate a relative-vector handle, defaulting its action location to the boss.
damage(target, amount?=0, multiplier?=1)target handle, number?=0, number?=1nilSubmit Bukkit damage attributed to the boss. Player hits enter EliteMobs combat scaling with the multiplier; nonplayer hits do not apply that multiplier.
push(target, vector, additive?=false)target handle, table/vector handle, bool?=falsenilAfter one owned tick, replace or add velocity for the captured targets; one resolved vector is used for all targets, and a missing/nonfinite vector becomes zero.
set_facing(target, vector)target handle, table/vector handlenilFace resolved target entities along the vector.
spawn_particles(target, particles)target handle, table/stringnilSpawn the particle specification at resolved target locations.

These calls do not run an Elite Script action list, conditions, cooldowns, warning delays, or repetition automatically. Target handles retain their originating event/direct-target context; avoid reusing event-dependent handles across unrelated hooks. first_entity() means the resolver's first result, not necessarily the nearest entity.

Target Handle Methods​

MethodArgsReturnsDescription
entities()—tableResolve and return Entity Tables.
locations()—tableResolve and return location tables.
first_entity()—table/nilReturn the first resolved entity.
first_location()—table/nilReturn the first resolved location.

Zone Handle Methods​

MethodArgsReturnsDescription
full_target(coverage?)number?target handleCreate a target handle for the shape interior.
border_target(coverage?)number?target handleCreate a target handle for the border.
full_locations(coverage?)number?tableResolve sampled interior locations.
border_locations(coverage?)number?tableResolve sampled border locations.
full_entities()—tableResolve entities inside the shape.
border_entities()—tableResolve entities on the border.
contains(location, mode?="full")table, string?boolTest full-shape or border membership.
watch(callbacks, mode?="full")table, string?intStart an owned {on_enter, on_leave} watch and return its task ID.

Relative-Vector Handle Methods​

MethodArgsReturnsDescription
resolve()—tableResolve the vector for the current context.

EliteMobs Power Event Table​

EliteMobs boss-power event values expose fields and methods conditionally by event type.

Properties​

FieldTypeDescription
damage_amountnumber/nilDamage-event amount snapshot.
damage_causestring/nilDamageCause name when the damage event exposes one.
damagertable/nilRaw damage-by-entity damager reference; for a projectile hit this is the projectile, not its shooter.
projectiletable/nilProjectile reference when the damager is a projectile.
spawn_reasonstring/nilElite spawn reason.
entitytable/nilDamaged reinforcement, death, or zone-event entity, depending on the hook.
is_damage_transferbool/nilPlayer-to-elite damage only: whether this hook is processing an explicitly transferred hit.

Methods​

MethodArgsReturnsDescription
cancel_event()—nilCancel an EliteDamageEvent or other cancellable event.
set_damage_amount(amount)numbernilReplace EliteDamageEvent damage; call with dot syntax.
multiply_damage_amount(multiplier)numbernilMultiply EliteDamageEvent damage; call with dot syntax.
get_damage_amount()—numberReturn the current EliteDamageEvent amount after modifications.
transfer_damage(target, amount)entity reference, numberboolPlayer-to-elite damage only: submit finite nonnegative damage to another live elite allowed by instance policy. Zero, cancelled inputs, nested transfers, and the original target return false; a nonelite recipient is an error. True means submitted, not guaranteed damage. Does not subtract or cancel the original damage.

context.world: EliteMobs Additions and Overrides​

EliteMobs boss powers inherit the shared World Table, including the shared EliteMobs lightning-effect and NPC-spawn helpers, then add or override the methods below. Inherited coordinate methods keep their shared behavior. Boss-specific location methods use the boss location converter: absent/non-table locations fall back to the boss, missing coordinates default to zero, and an explicitly named world must resolve.

Methods​

MethodArgsReturnsDescription
play_sound_at_location(location, sound, volume?=1, pitch?=1)table, string (Sound), number?=1, number?=1nilOverride that accepts registered or custom namespaced sounds through EliteMobs support.
spawn_particle_at_location(location, particle, count?=1)table, string (Particle)/table, int?=1nilOverride that accepts an EliteMobs particle-spec table.
set_block_at_location(location, material, require_air?=false)table, string (Material), bool?=falsenilOverride that places the block permanently through the temporary-block manager, without a timer or tracking.
place_temporary_block_at_location(location, material, ticks?=0, require_air?=false)table, string (Material), int?=0, bool?=falsenilOverride that uses EliteMobs temporary-block placement.
get_block_type_at_location(location)tablestring/nilReturn an uppercase Material name, or nil for an invalid location.
get_highest_block_y_at_location(location)tableint/nilOverride that returns the highest block Y, or nil.
get_blast_resistance_at_location(location)tablenumberReturn block blast resistance, defaulting to 0 for an invalid location.
is_air_at_location(location)tableboolTest whether the target block is air.
is_passable_at_location(location)tableboolTest Bukkit passability.
is_passthrough_at_location(location)tableboolTest whether the material is not solid.
is_on_floor_at_location(location)tableboolTest for a non-solid target with a solid block below.
is_standing_on_material(location, material)table, string (Material)boolTest the block below.
strike_lightning_at_location(location)tablenilOverride that enables the EliteMobs lightning bypass before striking.
run_empowered_lightning_task_at_location(location)tablenilIndependently emit 60 warning iterations, then real lightning and a downward fireball of yield 5. Damaging; Lua pause/closure does not cancel it.
set_world_time(time) / set_world_time(location, time)int/table, int?nilSet the boss world's time or the supplied location world's time.
set_world_weather(weather, duration?=6000) / set_world_weather(location, weather, duration?=6000)string/table, string/int?, int?=6000nilSet CLEAR, PRECIPITATION, RAIN, or THUNDER.
run_console_command(command)stringnilDispatch a command as the console.
spawn_boss_at_location(file, location?, level?)string, table?, int?table/nilSpawn a custom boss at the supplied or current location and supplied or current level.
spawn_custom_boss_at_location(file, location, options?)string, table, table?table/nilSpawn a custom boss; options support silent, level, add_as_reinforcement, and velocity.
spawn_entity_at_location(type, location, options?)string (EntityType), table, table?table/nilSpawn a vanilla entity; options support velocity, duration, EntityEffect effect, on_land, and max_ticks.
spawn_falling_block_at_location(location, material, options?)table, string (Material), table?table/nilSpawn a falling block; options support drop_item, hurt_entities, velocity, and on_land.
spawn_reinforcement_at_location(file, location, duration?=0, velocity?)string, table, int?=0, table?table/nilSummon a reinforcement tied to the boss; positive duration removes it after that many ticks.
spawn_fireworks_at_location(location, options)table, tabletable/nilSpawn a firework; options support effects, type, flicker, trail, colors, fade_colors, power, velocity, and shot_at_angle, with FireworkEffect.Type names for type.
spawn_splash_potion_at_location(location, options)table, tabletable/nilSpawn a splash potion; effects entries accept PotionEffectType type, duration, amplifier, and overwrite, plus top-level velocity.
generate_fake_explosion(locations, source?)table, table?nilRemove real blocks and create damaging falling debris when explosion regeneration is enabled. Restoration starts after 1200 ticks; Lua closure does not undo it. Keep positions in the boss world.
spawn_fake_gold_nugget_at_location(location, velocity, gravity?=false)table, table, bool?=falsetable/nilSpawn a fake gold-nugget projectile.
run_fake_gold_nugget_damage(projectiles)tablenilRun the fake-projectile damage pass.
generate_player_loot(times?=1)int?=1nilGenerate player loot for eligible damagers.
drop_bonus_coins(multiplier?=2)number?=2nilDrop bonus coins for eligible damagers.

EliteMobs Fake Projectile Table​

spawn_fake_gold_nugget_at_location returns this table when spawning succeeds.

Methods​

MethodArgsReturnsDescription
get_location()—tableReturn the fake projectile location.
set_gravity(enabled)boolnilSet fake-projectile gravity.
remove()—nilRemove the fake projectile.
is_removed()—boolTest whether it was removed.

context.settings​

EliteMobs boss powers receive this settings table from the same world-table builder.

Methods​

MethodArgsReturnsDescription
warning_visual_effects_enabled()—boolReturn the current warning-visual-effects setting.