Complete method reference for the Lua scripting API. All methods are called via context.table:method() syntax.
Global methods (marked GLOBAL) come from Magmacore, the shared core library — they work identically in EliteMobs and FreeMinecraftModels scripts.
EliteMobs methods (marked ELITEMOBS) are specific to EliteMobs boss power scripts.
FMM methods (marked FMM) are specific to FreeMinecraftModels item and prop scripts.
Where a method requires a Bukkit enum (Sound, Particle, Material, etc.), see the Spigot Javadocs for valid values. Enum names are passed as uppercase strings (e.g., "DIAMOND_SWORD", "ENTITY_ARROW_SHOOT").
Entity Table GLOBAL
Base fields present on all entity tables — players, mobs, props, anything.
Properties
| Field | Type | Description |
|---|
uuid | string | Entity UUID |
entity_type | string | Entity type (lowercase) |
is_valid | bool | Entity still exists in the world |
is_dead | bool | Entity is dead |
is_player | bool | Is a player |
is_hostile | bool | Is a Monster |
is_passive | bool | Is an Animal |
is_elite | bool | Is an EliteMobs entity |
is_custom_boss | bool | Is an EliteMobs custom boss |
is_significant_boss | bool | Custom boss with health multiplier over 1 (designed encounter) |
is_modeled | bool | Has an FMM model |
is_prop | bool | Is an FMM prop |
current_location | location | Entity position (x, y, z, yaw, pitch, world) |
world | string | World name |
Methods
| Method | Args | Returns | Description |
|---|
teleport(location) | location table | nil | Teleport entity |
remove() | — | nil | Remove entity from world |
set_silent(enabled) | bool | nil | Set silent |
set_invulnerable(enabled) | bool | nil | Set invulnerable |
set_gravity(enabled) | bool | nil | Set gravity |
set_glowing(enabled) | bool | nil | Set glowing |
Bridge: entity.elite
Only present when is_elite is true. Populated via reflection — no EliteMobs dependency required.
| Field | Type | Description |
|---|
level | int | Elite mob level |
name | string | Elite display name |
health | double | Current health |
max_health | double | Max health |
is_custom_boss | bool | Is a custom boss (also available at top level) |
health_multiplier | double | Config-defined health multiplier |
damage_multiplier | double | Config-defined damage multiplier |
remove() | method | Remove the elite entity |
Bridge: entity.model
Only present when is_modeled is true. Populated via reflection — no FMM dependency required.
| Field | Type | Description |
|---|
model_id | string | Model blueprint name |
play_animation(name, blend?, loop?) | method | Play animation |
stop_animations() | method | Stop all animations |
remove() | method | Remove the modeled entity |
Living Entity Table GLOBAL
Extends Entity Table. Applied to all living entities (mobs and players).
Properties
| Field | Type | Description |
|---|
health | double | Current health |
maximum_health | double | Max health |
name | string | Entity display name |
is_alive | bool | Entity is not dead |
Methods
| Method | Args | Returns | Description |
|---|
damage(amount) | double | nil | Deal damage to entity |
push(x, y, z) | double, double, double | nil | Add velocity vector |
set_facing(x, y, z) | double, double, double | nil | Set look direction |
add_potion_effect(type, duration, amplifier) | string (PotionEffectType), int, int | nil | Apply potion effect by name |
remove_potion_effect(type) | string (PotionEffectType) | nil | Remove potion effect by name |
context.player GLOBAL
Player entity table. Inherits all Entity and Living Entity fields.
Properties
| Field | Type | Description |
|---|
game_mode | string | survival, creative, adventure, spectator |
Methods
| Method | Args | Returns | Description |
|---|
send_message(text) | string | nil | Send chat message. Supports color codes |
get_held_item() | — | table or nil | Returns type, amount, display_name fields, or nil if empty hand |
consume_held_item(amount?) | int (default 1) | nil | Reduce held item stack by amount |
has_item(material, amount?) | string (Material), int (default 1) | bool | Check inventory for material |
get_target_entity(range?) | num (default 50) | entity or nil | Raycast for entity player is looking at |
get_eye_location() | — | location | Player eye position |
get_look_direction() | — | vector | Unit direction vector |
send_block_change(x, y, z, material, ticks?) | int, int, int, string (Material), int (optional) | bool | Send fake block. Auto-resets after ticks if given |
reset_block(x, y, z) | int, int, int | bool | Reset fake block to real |
sleep(x, y, z) | num, num, num | nil | Bed sleep animation at location |
wake_up() | — | nil | Wake from sleep |
show_boss_bar(text, color?, progress, ticks?) | string, string (BarColor, default WHITE), num, int (optional) | nil | Display boss bar. Auto-hides after ticks. Supports color codes |
hide_boss_bar() | — | nil | Remove boss bar |
show_action_bar(text, ticks?) | string, int (optional) | nil | Show action bar. Repeats if ticks greater than 0. Supports color codes |
show_title(title, subtitle?, fadeIn, stay, fadeOut) | string, string (default empty), int, int, int | nil | Show title screen. Supports color codes |
context.world GLOBAL
World operations. Available in all script types.
Properties
| Field | Type | Description |
|---|
name | string | World name |
Methods
| Method | Args | Returns | Description |
|---|
get_block_at(x, y, z) | int, int, int | string | Material name (lowercase) |
set_block_at(x, y, z, material) | int, int, int, string (Material) | bool | Place block |
get_highest_block_y(x, z) | int, int | int | Y of highest non-air block |
spawn_particle(particle, x, y, z, count?, dx?, dy?, dz?, speed?) | string (Particle), num, num, num, int, num, num, num, num (last 5 optional, default 0) | nil | Spawn particle effect |
play_sound(sound, x, y, z, volume?, pitch?) | string (Sound), num, num, num, float (default 1), float (default 1) | nil | Play sound |
strike_lightning(x, y, z) | num, num, num | nil | Strike lightning |
get_time() | — | int | World time in ticks |
set_time(ticks) | long | nil | Set world time |
get_nearby_entities(x, y, z, radius) | num, num, num, num | table | Array of entity tables |
get_nearby_players(x, y, z, radius) | num, num, num, num | table | Array of player entity tables |
spawn_entity(type, x, y, z) | string (EntityType), num, num, num | entity | Spawn vanilla entity |
raycast(fx, fy, fz, dx, dy, dz, max?) | num, num, num, num, num, num, num (default 50) | table | Returns hit_entity, hit_location, hit_block fields |
spawn_firework(x, y, z, colors, type?, power?) | num, num, num, table, string (FireworkEffect.Type, default BALL), int (default 1) | nil | Spawn firework |
context.boss ELITEMOBS
Boss entity table for EliteMobs Lua power scripts. Inherits all Living Entity methods. Properties refresh via dedicated getters.
Properties
| Field | Type | Description |
|---|
name | string | Boss display name |
uuid | string | Elite entity UUID |
health | double | Current health (snapshot) |
maximum_health | double | Max health (snapshot) |
current_location | location | Boss position (snapshot) |
level | int | Boss level |
damager_count | int | Number of players who damaged this boss |
is_in_combat | bool | Boss is in combat |
exists | bool | Boss entity exists |
Methods
| Method | Args | Returns | Description |
|---|
get_health() | — | double | Current health (live) |
get_maximum_health() | — | double | Max health (live) |
get_location() | — | location | Current position (live) |
restore_health(amount) | double | nil | Heal the boss |
despawn() | — | nil | Remove boss entity |
get_damager_count() | — | int | Live damager count |
add_tag(tag, ticks?) | string, int (default 0) | nil | Add tag, auto-remove after ticks if set |
remove_tag(tag) | string | nil | Remove tag |
has_tag(tag) | string | bool | Check tag |
reset_custom_name() | — | nil | Reset name to config default |
play_sound_at_self(sound, volume?, pitch?) | string (Sound), float, float | nil | Play sound at boss |
spawn_particle_at_self(particle, count?) | string (Particle), int (default 1) | nil | Spawn particle at boss |
play_model_animation(name) | string | nil | Play FMM model animation (requires FMM model) |
navigate_to_location(location, speed?, force?, timeout?) | location, double (default 1), bool (default false), int (default 0) | nil | Pathfind to location |
send_message(text, range?) | string, double (default 20) | nil | Send message to nearby players. Supports color codes |
get_nearby_players(range) | double | table | Array of player tables within range |
get_target_player() | — | player or nil | Current mob target if it's a player |
get_nearby_players_in_zone(zone) | zone table | table | Players inside the zone shape |
get_ender_dragon_phase() | — | string or nil | EnderDragon.Phase name |
set_ender_dragon_phase(phase) | string (EnderDragon.Phase) | nil | Set ender dragon phase |
summon_reinforcement(file, zone?, level?) | string, zone or nil, int (default 0) | entity or nil | Spawn reinforcement boss |
summon_projectile(type, origin, dest, speed?, options?) | string (EntityType), location, location, double (default 1), table | entity | Spawn tracked projectile |
summon_projectile options
| Option | Type | Default | Description |
|---|
custom_damage | number | — | Override projectile damage |
detonation_power | string | — | Explosive power level |
yield | number | — | Fireball yield |
incendiary | bool | true | Fireball sets fire |
gravity | bool | — | Enable gravity |
glowing | bool | false | Set glowing |
invulnerable | bool | false | Set invulnerable |
duration | int | 0 | Auto-remove after ticks |
spawn_at_origin | bool | false | Spawn at origin instead of launching from boss |
direction_only | bool | false | Set direction without velocity (fireballs) |
track | bool | true | Register as elite projectile |
on_land | function | — | Callback when projectile lands: function(location, entity) |
max_ticks | int | 6000 | Max ticks before forced landing callback |
Zone/Particle Methods
| Method | Args | Returns | Description |
|---|
spawn_particles_in_zone(zone, particle, ...) | zone, particle spec, coverage (default 1.0) | nil | Fill zone with particles |
spawn_particles_in_zone_border(zone, particle, ...) | zone, particle spec, coverage (default 1.0) | nil | Outline zone with particles |
get_particles_from_self_toward_zone(zone, particle, speed?) | zone, string, double (default 0.1) | table | Directional particles from boss to zone |
get_particles_toward_self(zone, particle, speed?) | zone, string, double (default 0.1) | table | Directional particles from zone to boss |
spawn_particles_with_vector(particles) | table | nil | Spawn directional particle array |
Special Power Support
| Method | Args | Returns | Description |
|---|
start_tracking_fireball_system(speed?) | double (default 0.5) | nil | Start tracking fireball AI |
handle_spirit_walk_damage(cause) | string (DamageCause) | nil | Handle spirit walk damage by cause |
shield_wall_is_active() | — | bool | Whether shield wall is active |
initialize_shield_wall(charges?) | int (default 1) | nil | Activate shield wall |
shield_wall_absorb_damage(player, damage) | entity table, double | bool | Attempt to absorb damage |
deactivate_shield_wall() | — | nil | Deactivate shield wall |
start_zombie_necronomicon(target, file) | entity table, string | nil | Start necronomicon on target |
context.world (EliteMobs) ELITEMOBS
Extended world table for EliteMobs power scripts. Adds boss-specific spawning, block checks, and effects on top of the global world table.
Block Queries
| Method | Args | Returns | Description |
|---|
get_block_type_at_location(loc) | location | string or nil | Material name |
get_highest_block_y_at_location(loc) | location | int or nil | Highest block Y |
get_blast_resistance_at_location(loc) | location | double | Blast resistance value |
is_air_at_location(loc) | location | bool | Block is air |
is_passable_at_location(loc) | location | bool | Block is passable |
is_passthrough_at_location(loc) | location | bool | Block is not solid |
is_on_floor_at_location(loc) | location | bool | Air with solid block below |
is_standing_on_material(loc, material) | location, string (Material) | bool | Block below matches material |
Block Manipulation
| Method | Args | Returns | Description |
|---|
set_block_at_location(loc, material, visual?) | location, string (Material), bool (default false) | nil | Place block. visual=true for fake block |
place_temporary_block_at_location(loc, material, ticks?, visual?) | location, string, int (default 0), bool (default false) | nil | Place block, auto-remove after ticks |
Spawning
| Method | Args | Returns | Description |
|---|
spawn_boss_at_location(file, loc?, level?) | string, location (default boss loc), int (default boss level) | entity or nil | Spawn custom boss |
spawn_custom_boss_at_location(file, loc, options?) | string, location, table | entity or nil | Spawn boss with options (level, silent, add_as_reinforcement, velocity) |
spawn_entity_at_location(type, loc, options?) | string (EntityType), location, table | entity | Spawn vanilla entity with options (velocity, duration, effect, on_land) |
spawn_falling_block_at_location(loc, material, options?) | location, string (Material), table | entity | Spawn falling block (drop_item, hurt_entities, velocity, on_land) |
spawn_reinforcement_at_location(file, loc, level?, velocity?) | string, location, int (default 0), vector | entity or nil | Spawn reinforcement tied to boss |
spawn_fireworks_at_location(loc, config) | location, table | entity or nil | Spawn firework |
spawn_splash_potion_at_location(loc, config) | location, table | entity or nil | Spawn splash potion |
Effects and Utility
| Method | Args | Returns | Description |
|---|
play_sound_at_location(loc, sound, volume?, pitch?) | location, string (Sound), float (default 1), float (default 1) | nil | Play sound |
spawn_particle_at_location(loc, particle, count?) | location, string (Particle) or table, int (default 1) | nil | Spawn particles |
strike_lightning_at_location(loc) | location | nil | Strike lightning (bypasses EM protection) |
run_empowered_lightning_task_at_location(loc) | location | nil | Empowered lightning effect |
generate_fake_explosion(locations, center?) | table of locations, location | nil | Visual explosion without damage |
spawn_fake_gold_nugget_at_location(loc, velocity, gravity?) | location, vector, bool (default false) | fake projectile | Spawn visual gold nugget projectile |
run_fake_gold_nugget_damage(projectiles) | table | nil | Run damage check on fake projectiles |
set_world_time(time) or (loc, time) | long, or location + long | nil | Set world time |
set_world_weather(weather, duration?) or (loc, weather, duration?) | string (CLEAR, RAIN, THUNDER), int (default 6000) | nil | Set weather |
run_console_command(command) | string | nil | Execute console command |
generate_player_loot(level?) | int (default 1) | nil | Generate loot for damagers |
drop_bonus_coins(multiplier?) | double (default 2) | nil | Drop bonus coins at boss |
context.settings (EliteMobs)
| Method | Args | Returns | Description |
|---|
warning_visual_effects_enabled() | — | bool | Whether warning VFX are enabled in config |
context.item FMM
Accessed in FMM item scripts. Resolves the specific scripted item from the player's equipped slots via PDC tag.
Properties
| Field | Type | Description |
|---|
id | string | Item's script identifier |
Methods
| Method | Args | Returns | Description |
|---|
material() | — | string | Material name |
get_amount() | — | int | Stack size |
set_amount(n) | int | nil | Set stack size |
consume(n?) | int (default 1) | nil | Decrement amount by n, remove if zero |
get_uses() | — | int | PDC-stored use counter |
set_uses(n) | int | nil | Set PDC use counter |
get_durability() | — | table or nil | Returns current and max fields, or nil if no durability bar |
get_durability_percentage() | — | number or nil | 0.0–1.0 remaining fraction, or nil |
use_durability(amount, can_break?) | int, bool (default false) | nil | Reduce durability by flat amount. When false, clamps to 1 remaining |
use_durability_percentage(fraction, can_break?) | number, bool (default false) | nil | Reduce durability by fraction of max (0.0–1.0) |
get_name() | — | string or nil | Display name |
set_name(s) | string | nil | Set display name. Supports color codes |
get_lore() | — | table | Array of lore strings |
set_lore(table) | table | nil | Set lore from array of strings |
context.prop FMM
Accessed in FMM prop scripts. Inherits all Entity fields from the backing armor stand.
Properties
| Field | Type | Description |
|---|
model_id | string | Blueprint model name |
current_location | location | Prop's current position |
Methods
| Method | Args | Returns | Description |
|---|
play_animation(name, blend?, loop?) | string, bool (default true), bool (default true) | bool | Play named animation |
stop_animation() | — | nil | Stop all current animations |
hurt_visual() | — | nil | Red tint flash, no damage |
pickup() | — | nil | Remove prop and drop placement item |
has_mount_points() | — | bool | Whether prop has mount point bones |
mount(player) | entity table | bool | Mount player onto first available seat |
dismount(player) | entity table | bool | Dismount player |
get_passengers() | — | table | Array of entity tables for mounted players |
spawn_elitemobs_boss(file, x, y, z) | string, num, num, num | entity or nil | Spawn EliteMobs boss (requires EliteMobs) |
open_inventory(player, title, rows?) | entity table, string, int (default 3) | bool | Open persistent chest inventory (1–6 rows). Title supports color codes |
place_book(player) | entity table | bool | Store player's held written book on prop |
read_book(player) | entity table | bool | Open stored book for reading |
take_book(player) | entity table | bool | Return stored book to player |
has_book() | — | bool | Whether a book is stored |
drop_inventory() | — | bool | Drop all stored items and clear |
drop_book() | — | bool | Drop stored book and clear |
is_viewing_inventory(player) | entity table | bool | Whether player has this prop's inventory open |
set_persistent_data(key, value) | string, string | bool | Store string in prop's PDC |
get_persistent_data(key) | string | string or nil | Retrieve string from prop's PDC |
Color Codes
All methods marked as supporting color codes use Magmacore's ChatColorConverter. These formats can be mixed freely in any string:
Legacy codes
Use & followed by a color/format character:
| Code | Color | Code | Format |
|---|
&0 | Black | &l | Bold |
&1 | Dark Blue | &m | Strikethrough |
&2 | Dark Green | &n | Underline |
&3 | Dark Aqua | &o | Italic |
&4 | Dark Red | &r | Reset |
&5 | Dark Purple | | |
&6 | Gold | | |
&7 | Gray | | |
&8 | Dark Gray | | |
&9 | Blue | | |
&a | Green | | |
&b | Aqua | | |
&c | Red | | |
&d | Light Purple | | |
&e | Yellow | | |
&f | White | | |
Hex colors
Exact RGB color using 6-digit hex:
&#FF5500 -- ampersand prefix
<#FF5500> -- tag syntax
Gradients
Smoothly interpolate between two or more colors across the text:
<gradient:#FF0000:#0000FF>This text fades red to blue</gradient>
<g:#FF0000:#00FF00:#0000FF>Three-color gradient</g>
The short form g works identically to gradient. You can chain as many color stops as you want.
Rainbow
Cycle through the full hue spectrum. Optional saturation (0–100):
<rainbow>Full rainbow text</rainbow>
<r:50>Pastel rainbow (50% saturation)</r>
Common Types
location
{ x = number, y = number, z = number, yaw = number, pitch = number, world = string }
vector
{ x = number, y = number, z = number }
entity table
Any table with a uuid field. Player and entity tables from context work directly:
context.player -- valid entity table
context.world:get_nearby_entities(x,y,z,r) -- returns array of entity tables