Skip to main content

Lua API Reference

This reference is generated from the live MagmaCore, FreeMinecraftModels, and EliteMobs Lua table builders, enrichers, and runtime context resolvers.

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.

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.

Entity Table: EliteMobs Enrichment

The live EliteMobs enricher adds these values to MagmaCore entity tables; elite exists only when is_elite is true.

Properties

FieldTypeDescription
is_eliteboolWhether EliteMobs currently tracks the entity.
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 live 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.

Methods

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

Entity Table: FreeMinecraftModels Enrichment

The live FreeMinecraftModels enricher adds these values; model exists only when is_modeled is true, and player-only values appear only on player tables.

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.

Methods

MethodArgsReturnsDescription
model.play_animation(name, blend?=false, loop?=false)string, bool?=false, bool?=falseboolPlay a model animation and return whether it started.
model.stop_animations()nilStop all current model animations.
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, numbernilAdd a vector to the current velocity.
set_facing(x, y, z)number, number, numbernilFace a direction vector.
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 scale attribute, or 1.0 when unavailable.
set_scale(value)numbernilSet the scale attribute when supported by the server.

Player Table

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

Properties

FieldTypeDescription
game_modestringLowercase Bukkit game mode snapshot.

Methods

MethodArgsReturnsDescription
send_message(text)stringnilSend text processed by MagmaCore's color parser.
get_held_item()table/nilReturn {type, amount, display_name} for the main-hand item, or nil for an empty hand.
consume_held_item(amount?=1)int?=1nilQueue reducing the main-hand stack.
has_item(material, amount?=1)string (Material), int?=1boolTest whether the inventory contains the requested amount.
get_target_entity(range?=50)number?=50table/nilRaycast for the entity the player is looking at.
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?=-1boolSend a client-only block and optionally reset it after positive ticks; invalid or non-block materials return false.
reset_block(x, y, z)int, int, intboolQueue restoring the real block for this player.
sleep(x, y, z)number, number, numbernilQueue a forced sleep animation and restore the replaced block after waking.
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 and optionally hide it after positive ticks.
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.

World Table

The MagmaCore world table is exposed as context.world; EliteMobs boss powers inherit it and apply the overrides documented later.

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; invalid types return nil.
raycast(from_x, from_y, from_z, dir_x, dir_y, dir_z, max_distance?=50)number, number, number, number, number, number, number?=50tableReturn hit_entity, hit_location, and hit_block values.
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 a particle in the location table's 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.

context.world: FreeMinecraftModels Additions

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

Methods

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

em Helper Table

MagmaCore exposes this table globally before any script hook runs.

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.

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.

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

Local cooldowns are keyed for one script owner and definition; global cooldowns are shared by the same owner. Omitting a local key uses __lua: followed by the script filename. EliteMobs boss powers expose the same method names, but local values use the boss's shared cooldown store and global values use its built-in power cooldown.

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 zone hooks expose the crossing player through context.player and context.event.player.

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 context table was built; 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

FreeMinecraftModels item scripts receive this table for the matching equipped scripted item.

Properties

FieldTypeDescription
idstringScripted item identifier.

Methods

MethodArgsReturnsDescription
material()string/nilReturn the uppercase Material name, or nil when the item is not equipped.
get_amount()intReturn the stack amount, or 0 when not equipped.
set_amount(amount)intnilQueue setting the stack amount.
consume(amount?=1)int?=1nilQueue reducing the stack amount.
get_uses()intReturn the persistent use counter, defaulting to 0.
set_uses(uses)intnilQueue setting the persistent use counter.
get_durability()table/nilReturn {current, max}, or nil when the item has no durability bar.
get_durability_percentage()number/nilReturn remaining durability from 0.0 to 1.0, or nil.
use_durability(amount, can_break?=false)int, bool?=falsenilQueue applying flat durability damage and clamp to one remaining unless breaking is allowed.
use_durability_percentage(fraction, can_break?=false)number, bool?=falsenilQueue applying durability damage equal to a fraction of maximum durability.
get_name()string/nilReturn the display name, or nil when absent.
set_name(name)stringnilQueue setting a color-processed display name.
get_lore()tableReturn an array of lore strings.
set_lore(lore)tablenilQueue setting color-processed lore strings.

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()nilStop all current animations.
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.

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.
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 nearby Player Tables.
face_direction_or_location(target)tablenilFace a vector direction or look toward a location.
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.

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)numbernilDeal EliteMobs custom damage from the power's boss.
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 and switch to the opposite state after positive ticks.
set_awareness_enabled(enabled, duration?=0)bool, int?=0nilSet mob awareness and switch to the opposite state after positive ticks.
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 scale and reset it to 1.0 after positive ticks.
set_invulnerable(enabled, duration?=0)bool, int?=0nilSet invulnerability with the EliteMobs duration helper.
remove_elite()nilRemove a tracked elite through the EliteMobs removal pipeline.
is_healing()boolTest the tracked elite's healing state.
set_healing(enabled)boolnilSet the tracked elite's healing state.
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?=0nilPush away from a source location plus optional offsets.
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?=0nilApply a potion effect.
set_equipment(slot, material, options?)string (EquipmentSlot), string (Material), table?nilSet equipment; options support unbreakable and enchantments entries with type and level.
set_fire_ticks(ticks)intnilSet fire ticks.
add_visual_freeze_ticks(ticks?=1)int?=1nilAdd freeze ticks.
place_temporary_block(material, ticks?=0, require_air?=false)string (Material), int?=0, bool?=falsenilPlace a temporary block at the entity.

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.
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.5nilStart tracking-fireball behavior for a monster boss.
handle_spirit_walk_damage(cause)string (DamageCause)nilRun Spirit Walk damage handling.
shield_wall_is_active()boolTest the shield-wall state.
initialize_shield_wall(charges?=1)int?=1nilInitialize the shield wall.
shield_wall_absorb_damage(player, damage)table, numberboolAttempt to absorb player damage.
deactivate_shield_wall()nilDeactivate the shield wall.
start_zombie_necronomicon(target, file)table, stringnilStart Zombie Necronomicon handling for a living target.
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_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?, level?=0)string, table?, int?=0table/nilSummon a reinforcement at a sampled zone point, location, or the boss.
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

These queries exclude the boss itself. Living filters accept player/players, elite/elites, mob/mobs, or any other value for all living entities.

MethodArgsReturnsDescription
get_nearby_entities(radius, filter?="living")number, string?tableReturn entities within the radius. all or entities includes non-living entities; other filters return living tables.
get_entities_in_box(center, half_x, half_y, half_z, filter?="living")table, number, number, number, string?tableReturn living entities inside the axis-aligned box.
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.

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?=1nilDamage every resolved target entity.
push(target, vector, additive?=false)target handle, table/vector handle, bool?=falsenilApply velocity to resolved target entities.
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.

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/nilDamage-by-entity damager reference.
projectiletable/nilProjectile reference when the damager is a projectile.
spawn_reasonstring/nilElite spawn reason.
entitytable/nilDeath or zone-event entity.

Methods

MethodArgsReturnsDescription
cancel_event()nilCancel an EliteDamageEvent or other cancellable event.
set_damage_amount(amount)numbernilReplace EliteDamageEvent damage.
multiply_damage_amount(multiplier)numbernilMultiply EliteDamageEvent damage.

context.world: EliteMobs Additions and Overrides

EliteMobs boss powers inherit every MagmaCore World Table row and add or override the methods below.

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 uses EliteMobs temporary-block placement with no expiry.
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)tablenilRun empowered Ender Dragon lightning support.
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, level?=0, velocity?)string, table, int?=0, table?table/nilSummon a reinforcement tied to the boss.
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?nilGenerate an EliteMobs fake explosion for an array of block locations.
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.