Vollständige Methodenreferenz für die Lua-Scripting-API. Alle Methoden werden über die context.table:method()-Syntax aufgerufen.
Globale Methoden (markiert mit GLOBAL) stammen aus Magmacore, der gemeinsamen Kernbibliothek — sie funktionieren identisch in EliteMobs- und FreeMinecraftModels-Skripten.
EliteMobs-Methoden (markiert mit ELITEMOBS) sind spezifisch für EliteMobs-Boss-Power-Skripte.
FMM-Methoden (markiert mit FMM) sind spezifisch für FreeMinecraftModels-Item- und Prop-Skripte.
Wenn eine Methode ein Bukkit-Enum erfordert (Sound, Particle, Material usw.), siehe die Spigot Javadocs für gültige Werte. Enum-Namen werden als Großbuchstaben-Strings übergeben (z.B. "DIAMOND_SWORD", "ENTITY_ARROW_SHOOT").
Entity-Tabelle GLOBAL
Basisfelder, die in allen Entity-Tabellen vorhanden sind — Spieler, Mobs, Props, alles.
Eigenschaften
| Feld | Typ | Beschreibung |
|---|
uuid | string | Entity-UUID |
entity_type | string | Entity-Typ (Kleinbuchstaben) |
is_valid | bool | Entity existiert noch in der Welt |
is_dead | bool | Entity ist tot |
is_player | bool | Ist ein Spieler |
is_hostile | bool | Ist ein Monster |
is_passive | bool | Ist ein Tier |
is_elite | bool | Ist eine EliteMobs-Entity |
is_custom_boss | bool | Ist ein EliteMobs Custom Boss |
is_significant_boss | bool | Custom Boss mit Gesundheitsmultiplikator über 1 (gestaltete Begegnung) |
is_modeled | bool | Hat ein FMM-Modell |
is_prop | bool | Ist ein FMM-Prop |
current_location | location | Entity-Position (x, y, z, yaw, pitch, world) |
world | string | Weltname |
Methoden
| Methode | Argumente | Rückgabe | Beschreibung |
|---|
teleport(location) | location-Tabelle | nil | Entity teleportieren |
remove() | — | nil | Entity aus der Welt entfernen |
set_silent(enabled) | bool | nil | Lautlos setzen |
set_invulnerable(enabled) | bool | nil | Unverwundbar setzen |
set_gravity(enabled) | bool | nil | Gravitation setzen |
set_glowing(enabled) | bool | nil | Leuchten setzen |
Bridge: entity.elite
Nur vorhanden, wenn is_elite wahr ist. Wird über Reflection befüllt — keine EliteMobs-Abhängigkeit erforderlich.
| Feld | Typ | Beschreibung |
|---|
level | int | Elite-Mob-Level |
name | string | Elite-Anzeigename |
health | double | Aktuelle Gesundheit |
max_health | double | Maximale Gesundheit |
is_custom_boss | bool | Ist ein Custom Boss (auch auf oberster Ebene verfügbar) |
health_multiplier | double | Konfigurationsdefinierter Gesundheitsmultiplikator |
damage_multiplier | double | Konfigurationsdefinierter Schadensmultiplikator |
remove() | method | Die Elite-Entity entfernen |
Bridge: entity.model
Nur vorhanden, wenn is_modeled wahr ist. Wird über Reflection befüllt — keine FMM-Abhängigkeit erforderlich.
| Feld | Typ | Beschreibung |
|---|
model_id | string | Modell-Blueprint-Name |
play_animation(name, blend?, loop?) | method | Animation abspielen. blend ist standardmäßig false, loop ist standardmäßig false |
stop_animations() | method | Alle Animationen stoppen |
remove() | method | Die modellierte Entity entfernen |
Living-Entity-Tabelle GLOBAL
Erweitert die Entity-Tabelle. Wird auf alle lebenden Entities angewendet (Mobs und Spieler).
Eigenschaften
| Feld | Typ | Beschreibung |
|---|
health | double | Aktuelle Gesundheit |
maximum_health | double | Maximale Gesundheit |
name | string | Entity-Anzeigename |
is_alive | bool | Entity ist nicht tot |
Methoden
| Methode | Argumente | Rückgabe | Beschreibung |
|---|
damage(amount) | double | nil | Schaden an Entity zufügen |
push(x, y, z) | double, double, double | nil | Geschwindigkeitsvektor hinzufügen |
set_facing(x, y, z) | double, double, double | nil | Blickrichtung setzen |
add_potion_effect(type, duration, amplifier) | string (PotionEffectType), int, int | nil | Trankeffekt nach Name anwenden |
remove_potion_effect(type) | string (PotionEffectType) | nil | Trankeffekt nach Name entfernen |
context.player GLOBAL
Spieler-Entity-Tabelle. Erbt alle Felder von Entity und Living Entity.
Eigenschaften
| Feld | Typ | Beschreibung |
|---|
game_mode | string | survival, creative, adventure, spectator |
Methoden
| Methode | Argumente | Rückgabe | Beschreibung |
|---|
send_message(text) | string | nil | Chat-Nachricht senden. Unterstützt Farbcodes |
get_held_item() | — | table oder nil | Gibt type-, amount-, display_name-Felder zurück, oder nil bei leerer Hand |
consume_held_item(amount?) | int (Standard 1) | nil | Gehaltenen Item-Stapel um Menge reduzieren |
has_item(material, amount?) | string (Material), int (Standard 1) | bool | Inventar auf Material prüfen |
get_target_entity(range?) | num (Standard 50) | entity oder nil | Raycast für Entity, die der Spieler ansieht |
get_eye_location() | — | location | Augenposition des Spielers |
get_look_direction() | — | vector | Einheitsrichtungsvektor |
send_block_change(x, y, z, material, ticks?) | int, int, int, string (Material), int (optional) | bool | Falschen Block senden. Wird nach Ticks automatisch zurückgesetzt, falls angegeben |
reset_block(x, y, z) | int, int, int | bool | Falschen Block auf echten zurücksetzen |
sleep(x, y, z) | num, num, num | nil | Bett-Schlaf-Animation an Position |
wake_up() | — | nil | Aus dem Schlaf aufwachen |
show_boss_bar(text, color?, progress, ticks?) | string, string (BarColor, Standard WHITE), num, int (optional) | nil | Bossleiste anzeigen. Wird nach Ticks automatisch ausgeblendet. Unterstützt Farbcodes |
hide_boss_bar() | — | nil | Bossleiste entfernen |
show_action_bar(text, ticks?) | string, int (optional) | nil | Aktionsleiste anzeigen. Wiederholt sich, wenn Ticks größer als 0. Unterstützt Farbcodes |
show_title(title, subtitle?, fadeIn, stay, fadeOut) | string, string (Standard leer), int, int, int | nil | Titelbildschirm anzeigen. Unterstützt Farbcodes |
context.world GLOBAL
Welt-Operationen. In allen Skripttypen verfügbar.
Eigenschaften
| Feld | Typ | Beschreibung |
|---|
name | string | Weltname |
Methoden
| Methode | Argumente | Rückgabe | Beschreibung |
|---|
get_block_at(x, y, z) | int, int, int | string | Material-Name (Kleinbuchstaben) |
set_block_at(x, y, z, material) | int, int, int, string (Material) | bool | Block platzieren |
get_highest_block_y(x, z) | int, int | int | Y-Wert des höchsten Nicht-Luft-Blocks |
spawn_particle(particle, x, y, z, count?, dx?, dy?, dz?, speed?) | string (Particle), num, num, num, int?=1, num?=0, num?=0, num?=0, num?=0 | nil | Partikeleffekt erzeugen |
play_sound(sound, x, y, z, volume?, pitch?) | string (Sound), num, num, num, float?=1, float?=1 | nil | Sound abspielen |
strike_lightning(x, y, z) | num, num, num | nil | Blitz einschlagen lassen |
get_time() | — | int | Weltzeit in Ticks |
set_time(ticks) | long | nil | Weltzeit setzen |
get_nearby_entities(x, y, z, radius) | num, num, num, num | table | Array von Entity-Tabellen |
get_nearby_players(x, y, z, radius) | num, num, num, num | table | Array von Spieler-Entity-Tabellen |
spawn_entity(type, x, y, z) | string (EntityType), num, num, num | entity | Vanilla-Entity spawnen |
raycast(fx, fy, fz, dx, dy, dz, max?) | num, num, num, num, num, num, num?=50 | table | Gibt hit_entity-, hit_location-, hit_block-Felder zurück |
place_temporary_block(x, y, z, material, ticks?, require_air?) | int, int, int, string (Material), int?=0, bool?=false | bool | Block platzieren, der sich nach Ticks automatisch zurücksetzt |
drop_item(x, y, z, material, amount?) | num, num, num, string (Material), int?=1 | entity | Item-Entity natürlich an Position fallen lassen |
spawn_firework(x, y, z, colors, type?, power?) | num, num, num, table, string (FireworkEffect.Type)?=BALL, int?=1 | nil | Feuerwerk spawnen |
context.boss ELITEMOBS
Boss-Entity-Tabelle für EliteMobs-Lua-Power-Skripte. Erbt alle Methoden von EliteMobs Living Entity. Eigenschaften werden über dedizierte Getter aktualisiert.
Eigenschaften
| Feld | Typ | Beschreibung |
|---|
name | string | Boss-Anzeigename |
uuid | string | Elite-Entity-UUID |
health | double | Aktuelle Gesundheit (Momentaufnahme) |
maximum_health | double | Maximale Gesundheit (Momentaufnahme) |
current_location | location | Boss-Position (Momentaufnahme) |
level | int | Boss-Level |
damager_count | int | Anzahl der Spieler, die diesen Boss beschädigt haben |
is_in_combat | bool | Boss ist im Kampf |
exists | bool | Boss-Entity existiert |
Methoden
| Methode | Argumente | Rückgabe | Beschreibung |
|---|
is_alive() | — | bool | Ob die Boss-Entity lebt (Live-Prüfung) |
get_health() | — | double | Aktuelle Gesundheit (live) |
get_maximum_health() | — | double | Maximale Gesundheit (live) |
get_location() | — | location | Aktuelle Position (live) |
restore_health(amount) | double | nil | Den Boss heilen |
despawn() | — | nil | Boss-Entity entfernen |
get_damager_count() | — | int | Live-Schadensverursacher-Anzahl |
add_tag(tag, ticks?) | string, int?=0 | nil | Tag hinzufügen, automatisch entfernen nach Ticks falls gesetzt |
remove_tag(tag) | string | nil | Tag entfernen |
has_tag(tag) | string | bool | Tag prüfen |
reset_custom_name() | — | nil | Namen auf Konfigurationsstandard zurücksetzen |
play_sound_at_self(sound, volume?, pitch?) | string (Sound), float?=1, float?=1 | nil | Sound beim Boss abspielen |
play_sound_at_entity(sound, volume?, pitch?) | string (Sound), float?=1, float?=1 | nil | Sound beim Boss abspielen (Alias) |
spawn_particle_at_self(particle, count?) | string (Particle) oder table, int?=1 | nil | Partikel beim Boss erzeugen |
play_model_animation(name) | string | nil | FMM-Modellanimation abspielen (erfordert FMM-Modell) |
navigate_to_location(location, speed?, force?, timeout?) | location, double?=1, bool?=false, int?=0 | nil | Pfadfindung zur Position |
send_message(text, range?) | string, double?=20 | nil | Nachricht an nahegelegene Spieler senden. Unterstützt Farbcodes |
get_nearby_players(range) | double | table | Array von Spieler-Tabellen in Reichweite |
get_target_player() | — | player oder nil | Aktuelles Mob-Ziel, falls es ein Spieler ist |
get_nearby_players_in_zone(zone) | zone-Tabelle | table | Spieler innerhalb der Zonenform |
get_ender_dragon_phase() | — | string oder nil | EnderDragon.Phase-Name |
set_ender_dragon_phase(phase) | string (EnderDragon.Phase) | nil | Enderdrachen-Phase setzen |
summon_reinforcement(file, zone?, level?) | string, zone oder nil, int?=0 | entity oder nil | Verstärkungs-Boss spawnen |
summon_projectile(type, origin, dest, speed?, options?) | string (EntityType), location, location, double?=1, table | entity | Verfolgtes Projektil spawnen |
summon_projectile-Optionen
| Option | Typ | Standard | Beschreibung |
|---|
custom_damage | number | — | Projektilschaden überschreiben |
detonation_power | string | — | Explosionskraft-Stufe |
yield | number | — | Feuerball-Yield |
incendiary | bool | true | Feuerball setzt Feuer |
gravity | bool | — | Gravitation aktivieren |
glowing | bool | false | Leuchten setzen |
invulnerable | bool | false | Unverwundbar setzen |
persistent | bool | true | Persistent setzen |
duration | int | 0 | Automatisch entfernen nach Ticks |
effect | string | — | EntityEffect, der beim Spawn abgespielt wird |
spawn_at_origin | bool | false | Am Ursprung spawnen statt vom Boss abzufeuern |
direction_only | bool | false | Richtung setzen ohne Geschwindigkeit (Feuerbälle) |
track | bool | true | Als Elite-Projektil registrieren |
on_land | function | — | Callback wenn Projektil landet: function(location, entity) |
max_ticks | int | 6000 | Maximale Ticks vor erzwungenem Landing-Callback |
Zonen-/Partikel-Methoden
| Methode | Argumente | Rückgabe | Beschreibung |
|---|
spawn_particles_in_zone(zone, particle, ...) | zone, Partikel-Spezifikation, coverage?=1.0 | nil | Zone mit Partikeln füllen |
spawn_particles_in_zone_border(zone, particle, ...) | zone, Partikel-Spezifikation, coverage?=1.0 | nil | Zonen-Umriss mit Partikeln zeichnen |
get_particles_from_self_toward_zone(zone, particle, speed?) | zone, string, double?=0.1 | table | Gerichtete Partikel vom Boss zur Zone |
get_particles_toward_self(zone, particle, speed?) | zone, string, double?=0.1 | table | Gerichtete Partikel von der Zone zum Boss |
spawn_particles_with_vector(particles) | table | nil | Gerichtetes Partikel-Array spawnen |
Spezielle Power-Unterstützung
| Methode | Argumente | Rückgabe | Beschreibung |
|---|
start_tracking_fireball_system(speed?) | double?=0.5 | nil | Tracking-Feuerball-KI starten |
handle_spirit_walk_damage(cause) | string (DamageCause) | nil | Spirit-Walk-Schaden nach Ursache behandeln |
shield_wall_is_active() | — | bool | Ob die Schildmauer aktiv ist |
initialize_shield_wall(charges?) | int?=1 | nil | Schildmauer aktivieren |
shield_wall_absorb_damage(player, damage) | entity-Tabelle, double | bool | Versuchen, Schaden zu absorbieren |
deactivate_shield_wall() | — | nil | Schildmauer deaktivieren |
start_zombie_necronomicon(target, file) | entity-Tabelle, string | nil | Necronomicon auf Ziel starten |
EliteMobs-Living-Entity-Tabelle ELITEMOBS
Entity-Tabellen, die innerhalb von EliteMobs-Power-Skripten erstellt werden (aus context.boss, Event-Daten, Zonen-Callbacks und Welt-Abfragen), verwenden eine erweiterte Living-Entity-Tabelle mit zusätzlichen Methoden über die globale Living Entity hinaus. context.boss erbt all diese.
Eigenschaften
| Feld | Typ | Beschreibung |
|---|
name | string | Entity-Anzeigename |
uuid | string | Entity-UUID |
entity_type | string | Entity-Typname |
is_player | bool | Ist ein Spieler |
is_monster | bool | Ist ein Monster |
is_elite | bool | Ist eine EliteMobs-Entity |
is_valid | bool | Entity existiert noch |
health | double | Aktuelle Gesundheit (Momentaufnahme) |
maximum_health | double | Maximale Gesundheit (Momentaufnahme) |
current_location | location | Entity-Position (Momentaufnahme) |
game_mode | string | Spielmodus (nur Spieler) |
Methoden
| Methode | Argumente | Rückgabe | Beschreibung |
|---|
is_alive() | — | bool | Ob die Entity lebt (Live-Prüfung) |
is_ai_enabled() | — | bool | Ob KI aktiviert ist |
is_frozen() | — | bool | Ob der Boss eingefroren ist (nur CustomBossEntity) |
is_on_ground() | — | bool | Ob die Entity auf dem Boden steht |
is_healing() | — | bool | Ob die Elite heilt |
get_location() | — | location | Aktuelle Position (live) |
get_eye_location() | — | location | Augenposition (live) |
get_height() | — | double | Entity-Höhe |
get_health() | — | double | Aktuelle Gesundheit (live) |
get_maximum_health() | — | double | Maximale Gesundheit (live) |
get_velocity() | — | vector | Aktueller Geschwindigkeitsvektor |
deal_damage(amount) | double | nil | Generischen Schaden zufügen |
deal_custom_damage(amount) | double | nil | Benutzerdefinierten Boss-Angriffsschaden vom Boss der Power zufügen |
deal_damage_from_boss(amount) | double | nil | Dem Boss der Power zugeordneten Schaden zufügen |
restore_health(amount) | double | nil | Entity heilen (nutzt EliteMobs-Heilung bei Elite) |
play_sound_at_entity(sound, volume?, pitch?) | string (Sound), float?=1, float?=1 | nil | Sound bei Entity abspielen |
play_sound_at_self(sound, volume?, pitch?) | string (Sound), float?=1, float?=1 | nil | Sound bei Entity abspielen (Alias) |
spawn_particle_at_self(particle, count?) | string (Particle) oder table, int?=1 | nil | Partikel bei Entity erzeugen |
spawn_particles_at_location(loc, particle, count?) | location, Partikel-Spezifikation, int?=1 | nil | Partikel an Position erzeugen |
teleport_to_location(location) | location | nil | Entity teleportieren |
set_velocity_vector(vector) | vector | nil | Geschwindigkeit setzen |
set_gravity(enabled) | bool | nil | Gravitation setzen |
apply_push_vector(vector, additive?, delay?) | vector, bool?=false, int?=1 | nil | Geschwindigkeit nach Verzögerung anwenden. additive addiert zur bestehenden Geschwindigkeit |
push_relative_to(location, force?, extraX?, extraY?, extraZ?) | location, double?=1, double?=0, double?=0, double?=0 | nil | Entity von Position wegstoßen |
set_custom_name(name) | string | nil | Benutzerdefinierten Anzeigenamen setzen. Unterstützt Farbcodes |
reset_custom_name() | — | nil | Namen auf EliteMobs-Standard zurücksetzen |
set_custom_name_visible(visible) | bool | nil | Namenssichtbarkeit umschalten |
set_ai_enabled(enabled, duration?) | bool, int?=0 | nil | KI-Status setzen. Wird nach duration Ticks automatisch zurückgesetzt |
set_awareness_enabled(enabled, duration?) | bool, int?=0 | nil | Mob-Aufmerksamkeit setzen. Wird nach duration Ticks automatisch zurückgesetzt |
face_direction_or_location(target) | vector oder location | nil | In eine Richtung schauen oder auf eine Position blicken |
play_model_animation(name) | string | nil | FMM-Modellanimation abspielen (erfordert FMM-Modell) |
set_scale(scale, duration?) | double, int?=0 | nil | Entity-Skalierung setzen. Wird nach duration Ticks automatisch auf 1.0 zurückgesetzt |
set_invulnerable(enabled, duration?) | bool, int?=0 | nil | Unverwundbar setzen. Wird nach duration Ticks automatisch zurückgesetzt |
set_healing(enabled) | bool | nil | Elite-Heilungsstatus setzen |
navigate_to_location(location, speed?, force?, timeout?) | location, double?=1, bool?=false, int?=0 | nil | Pfadfindung zur Position (nur CustomBossEntity) |
add_tag(tag, ticks?) | string, int?=0 | nil | Tag hinzufügen, automatisch entfernen nach Ticks |
remove_tag(tag) | string | nil | Tag entfernen |
has_tag(tag) | string | bool | Tag prüfen |
overlaps_box_at_location(center, halfX?, halfY?, halfZ?) | location, double?=0.5, double?=halfX, double?=halfX | bool | Ob die Entity-Bounding-Box eine Box an der Position überlappt |
remove_elite() | — | nil | Über EliteMobs-Entfernungspipeline entfernen |
apply_potion_effect(type, duration, amplifier?) | string (PotionEffectType), int, int?=0 | nil | Trankeffekt anwenden |
set_equipment(slot, material, options?) | string (EquipmentSlot), string (Material), table | nil | Ausrüstungsslot-Item setzen |
set_fire_ticks(ticks) | int | nil | Feuer-Ticks setzen |
add_visual_freeze_ticks(ticks?) | int?=1 | nil | Visuelle Einfrier-Ticks hinzufügen |
place_temporary_block(material, ticks?, visual?) | string (Material), int?=0, bool?=false | nil | Temporären Block an Entity-Position platzieren |
set_equipment-Optionen
| Option | Typ | Standard | Beschreibung |
|---|
unbreakable | bool | false | Item unzerstörbar machen |
enchantments | table | — | Array von {type = "ENCHANT_NAME", level = 1}-Tabellen |
EliteMobs-Spieler-Methoden
Spieler in EliteMobs-Skripten haben alle EliteMobs-Living-Entity-Methoden plus:
| Methode | Argumente | Rückgabe | Beschreibung |
|---|
send_message(text) | string | nil | Chat-Nachricht senden. Unterstützt Farbcodes |
show_action_bar(text) | string | nil | Aktionsleistentext anzeigen. Unterstützt Farbcodes |
show_title(title, subtitle?, fadeIn?, stay?, fadeOut?) | string, string?="", int?=10, int?=40, int?=10 | nil | Titelbildschirm anzeigen. Unterstützt Farbcodes |
show_boss_bar(title, color?, style?, duration?) | string, string (BarColor)?=WHITE, string (BarStyle)?=SOLID, int?=40 | nil | Bossleiste anzeigen. Wird nach duration Ticks automatisch ausgeblendet. Unterstützt Farbcodes |
run_command(command) | string | nil | Befehl als Spieler ausführen |
EliteMobs-Entity-Referenztabelle
Nicht-lebende Entities (Projektile, fallende Blöcke, Feuerwerke), die von EliteMobs-Spawn-Methoden zurückgegeben werden, erhalten eine leichtgewichtige Referenztabelle:
| Feld / Methode | Argumente | Rückgabe | Beschreibung |
|---|
name | — | string | Entity-Name |
uuid | — | string | Entity-UUID |
entity_type | — | string | Entity-Typname |
is_player | — | bool | Immer false |
is_elite | — | bool | Immer false |
is_valid() | — | bool | Ob die Entity noch gültig ist (Live-Prüfung) |
current_location | — | location | Position (Momentaufnahme) |
get_location() | — | location | Aktuelle Position (live) |
get_velocity() | — | vector | Aktueller Geschwindigkeitsvektor |
is_on_ground() | — | bool | Ob die Entity auf dem Boden steht |
teleport_to_location(location) | location | nil | Entity teleportieren |
set_velocity_vector(vector) | vector | nil | Geschwindigkeit setzen |
set_direction_vector(vector) | vector | nil | Richtung setzen (nur Feuerbälle) |
set_yield(amount) | double | nil | Feuerball-Yield setzen |
set_gravity(enabled) | bool | nil | Gravitation setzen |
detonate() | — | nil | Feuerwerk zünden |
remove() | — | nil | Entity entfernen |
unregister(reason?) | string?=OTHER | nil | Aus EliteMobs-Entity-Tracker abmelden |
context.players ELITEMOBS
Spieler-Abfragetabelle, verfügbar in EliteMobs-Power-Skripten. Bietet Hilfsmethoden zum Finden von Spielern relativ zum Boss.
| Methode | Argumente | Rückgabe | Beschreibung |
|---|
current_target() | — | player oder nil | Event-Akteur falls Spieler, oder aktuelles Mob-Ziel des Bosses falls Spieler |
nearby_players(radius) | double | table | Array von Spieler-Tabellen im Radius des Bosses |
all_players_in_world() | — | table | Array aller Spieler-Tabellen in der Welt des Bosses |
context.entities ELITEMOBS
Entity-Abfragetabelle, verfügbar in EliteMobs-Power-Skripten. Bietet Hilfsmethoden zum Finden von Entities relativ zum Boss. Alle Abfragen schließen den Boss selbst aus.
| Methode | Argumente | Rückgabe | Beschreibung |
|---|
get_nearby_entities(radius, filter?) | double, string?="living" | table | Entities im Radius. Filter: "living", "all", "entities" |
get_entities_in_box(center, halfX, halfY, halfZ, filter?) | location, double, double, double, string?="living" | table | Entities innerhalb einer achsenausgerichteten Box |
get_all_entities(filter?) | string?="living" | table | Alle Entities in der Welt des Bosses |
get_direct_target_entity() | — | entity oder nil | Direkte Ziel-Entity aus dem auslösenden Event |
get_boss_spawn_location() | — | location | Der ursprüngliche Spawn-Ort des Bosses |
context.vectors ELITEMOBS
Vektor-Mathematik-Hilfsfunktionen, verfügbar in EliteMobs-Power-Skripten.
| Methode | Argumente | Rückgabe | Beschreibung |
|---|
get_vector_between_locations(from, to, options?) | location, location, table | vector | Vektor von Quelle zu Ziel. Optionen können das Ergebnis modifizieren |
rotate_vector(vector, pitch?, yaw?) | vector, double?=0, double?=0 | vector | Vektor um Pitch und Yaw rotieren (Grad) |
normalize_vector(vector) | vector | vector | Auf Einheitslänge normalisieren |
context.cooldowns GLOBAL
Cooldown-Verwaltung. Lokale Cooldowns gelten pro Skript-Instanz; globale Cooldowns werden über alle Skripte auf derselben Entität/demselben Besitzer geteilt. Wenn kein Schlüssel angegeben wird, wird standardmäßig der Dateiname des Skripts verwendet.
| Method | Args | Returns | Description |
|---|
local_ready(key?) | string (optional) | bool | Ob der lokale Cooldown abgelaufen ist |
local_remaining(key?) | string (optional) | int | Verbleibende Ticks des lokalen Cooldowns (0 wenn bereit) |
check_local(key?, duration) | string (optional), int | bool | Wenn bereit, startet den Cooldown und gibt true zurück; andernfalls false |
set_local(duration, key?) | long, string (optional) | nil | Lokalen Cooldown für die angegebene Dauer in Ticks setzen |
global_ready() | — | bool | Ob der globale Cooldown abgelaufen ist |
set_global(duration) | long | nil | Globalen Cooldown für die angegebene Dauer in Ticks setzen |
In EliteMobs-Power-Skripten werden lokale Cooldowns über alle Powers auf derselben Boss-Entität geteilt, und globale Cooldowns verwenden das eingebaute Power-Cooldown-System des Bosses.
context.scheduler GLOBAL
Aufgabenplanung. Alle Aufgaben werden automatisch abgebrochen, wenn das Skript beendet wird.
Global (Magmacore) variant
| Method | Args | Returns | Description |
|---|
run_later(ticks, callback) | int, function | int | Callback nach der angegebenen Anzahl von Ticks ausführen. Gibt die Aufgaben-ID zurück |
run_repeating(delay, interval, callback) | int, int, function | int | Callback alle interval Ticks nach einer anfänglichen Verzögerung ausführen. Gibt die Aufgaben-ID zurück |
cancel(taskId) | int | nil | Eine geplante Aufgabe abbrechen |
EliteMobs variant
| Method | Args | Returns | Description |
|---|
run_after(ticks, callback) | int, function | int | Callback nach der angegebenen Anzahl von Ticks ausführen. Gibt die Aufgaben-ID zurück |
run_every(ticks, callback) | int, function | int | Callback alle N Ticks ausführen. Gibt die Aufgaben-ID zurück |
cancel_task(taskId) | int | nil | Eine geplante Aufgabe abbrechen |
context.log GLOBAL
Logging-Hilfsfunktionen zum Debuggen von Skripten.
| Method | Args | Returns | Description |
|---|
info(message) | string | nil | Info-Nachricht protokollieren |
warn(message) | string | nil | Warnungsnachricht protokollieren |
error(message) | string | nil | Fehler-/Warnungsnachricht protokollieren |
debug(message) | string | nil | Debug-Nachricht protokollieren (erscheint als Info mit Debug-Präfix) |
context.zones GLOBAL
Zonen-Erstellung und -Überwachung. In allen Skripttypen verfügbar.
Global (Magmacore) variant
| Method | Args | Returns | Description |
|---|
create_sphere(x, y, z, radius) | num, num, num, num | int | Kugelzone erstellen, gibt Handle zurück |
create_cylinder(x, y, z, radius, height) | num, num, num, num, num | int | Zylinderzone erstellen, gibt Handle zurück |
create_cuboid(x, y, z, xSize, ySize, zSize) | num, num, num, num, num, num | int | Quaderzone erstellen, gibt Handle zurück |
watch(handle, on_enter?, on_leave?) | int, function, function | bool | Spieler-Betreten/Verlassen-Ereignisse für Zone verfolgen |
unwatch(handle) | int | nil | Zonenverfolgung beenden |
EliteMobs variant
| Method | Args | Returns | Description |
|---|
get_entities_in_zone(zone, options?) | zone table, table | table | Entitäten innerhalb der Zone abrufen. Optionen: filter, mode |
get_locations_in_zone(zone, options?) | zone table, table | table | Positionen innerhalb der Zone abrufen. Optionen: coverage, mode |
zone_contains(zone, location, mode?) | zone table, location, string?="full" | bool | Ob die Position innerhalb der Zone liegt ("full" oder "border") |
watch_zone(zone, callbacks, mode?) | zone table, table, string?="full" | int | Zone auf Betreten/Verlassen überwachen. Callbacks: {on_enter = fn, on_leave = fn} |
context.event GLOBAL
Ereignisdaten-Tabelle für den Hook, der die aktuelle Skriptausführung ausgelöst hat. Nur während ereignisgesteuerter Hooks vorhanden (nicht bei on_tick).
Global (Magmacore) variant
| Field / Method | Type | Description |
|---|
is_cancelled | bool | Ob das Ereignis derzeit abgebrochen ist |
cancel() | method | Das Ereignis abbrechen |
uncancel() | method | Die Abbruch des Ereignisses rückgängig machen |
player | entity table | Am Ereignis beteiligter Spieler (falls vorhanden) |
Für die EliteMobs-Ereignistabelle (die Schadensbeträge, Schadensursachen usw. bereitstellt), siehe EliteMobs Event Table.
context.script ELITEMOBS
Brücke zum EliteMobs Elite Script-System. Ermöglicht Lua-Powers die Nutzung der YAML-basierten Targeting-, Zonen- und relativen Vektorsysteme über Lua-Tabellen mit denselben Feldnamen wie Elite Script YAML-Konfigurationen.
Methods
| Method | Args | Returns | Description |
|---|
target(spec) | table | target handle | Ein Target-Handle aus einer Elite Script Target-Spezifikationstabelle erstellen |
zone(spec) | table | zone handle | Ein Zonen-Handle aus einer Elite Script Zonen-Spezifikationstabelle erstellen |
relative_vector(spec, location?, zone?) | table, location, zone handle | vector handle | Einen relativen Vektor aus einer Elite Script Vektor-Spezifikation erstellen |
damage(target, amount?, multiplier?) | target handle, double?=0, double?=1 | nil | Schaden an allen Entitäten im Ziel verursachen |
push(target, vector, additive?) | target handle, vector or vector handle, bool?=false | nil | Ziel-Entitäten mit Geschwindigkeit zurückstoßen |
set_facing(target, vector) | target handle, vector or vector handle | nil | Blickrichtung der Ziel-Entitäten setzen |
spawn_particles(target, particles) | target handle, table or string | nil | Partikel an Zielpositionen erzeugen |
Target Handle
Wird von context.script:target(spec) zurückgegeben. Die Spezifikationstabelle verwendet dieselben Schlüssel wie Elite Script YAML-Target-Konfigurationen (z.B. {targetType = "NEARBY_PLAYERS", range = 20}).
| Method | Args | Returns | Description |
|---|
entities() | — | table | Array von Entitäts-Tabellen am Ziel |
locations() | — | table | Array von Positions-Tabellen am Ziel |
first_entity() | — | entity or nil | Erste Entität am Ziel |
first_location() | — | location or nil | Erste Position am Ziel |
Zone Handle
Wird von context.script:zone(spec) zurückgegeben. Die Spezifikationstabelle verwendet dieselben Schlüssel wie Elite Script YAML-Zonen-Konfigurationen (z.B. {shape = "SPHERE", radius = 5, target = {targetType = "SELF"}}).
| Method | Args | Returns | Description |
|---|
full_target(coverage?) | number | target handle | Target-Handle für Positionen im Zoneninneren |
border_target(coverage?) | number | target handle | Target-Handle für Positionen am Zonenrand |
full_locations(coverage?) | number | table | Array von Positionen im Inneren |
border_locations(coverage?) | number | table | Array von Positionen am Rand |
full_entities() | — | table | Entitäten innerhalb der Zone |
border_entities() | — | table | Entitäten am Zonenrand |
contains(location, mode?) | location, string?="full" | bool | Ob die Position in der Zone liegt |
watch(callbacks, mode?) | table, string?="full" | int | Auf Betreten/Verlassen überwachen. Gibt die Aufgaben-ID zurück |
Vector Handle
Wird von context.script:relative_vector(spec) zurückgegeben. Die Spezifikationstabelle verwendet dieselben Schlüssel wie Elite Script YAML-Konfigurationen für relative Vektoren.
| Method | Args | Returns | Description |
|---|
resolve() | — | vector | Den Vektor für den aktuellen Kontext berechnen |
context.world (EliteMobs) ELITEMOBS
Erweiterte Welt-Tabelle für EliteMobs-Power-Skripte. Fügt Boss-spezifisches Spawning, Block-Prüfungen und Effekte zur globalen Welt-Tabelle hinzu.
Block-Abfragen
| Methode | Argumente | Rückgabe | Beschreibung |
|---|
get_block_type_at_location(loc) | location | string oder nil | Material-Name |
get_highest_block_y_at_location(loc) | location | int oder nil | Höchster Block Y-Wert |
get_blast_resistance_at_location(loc) | location | double | Explosionswiderstandswert |
is_air_at_location(loc) | location | bool | Block ist Luft |
is_passable_at_location(loc) | location | bool | Block ist passierbar |
is_passthrough_at_location(loc) | location | bool | Block ist nicht solide |
is_on_floor_at_location(loc) | location | bool | Luft mit solidem Block darunter |
is_standing_on_material(loc, material) | location, string (Material) | bool | Block darunter entspricht Material |
Block-Manipulation
| Methode | Argumente | Rückgabe | Beschreibung |
|---|
set_block_at_location(loc, material, visual?) | location, string (Material), bool?=false | nil | Block platzieren. visual=true für falschen Block |
place_temporary_block_at_location(loc, material, ticks?, visual?) | location, string, int?=0, bool?=false | nil | Block platzieren, automatisch nach Ticks entfernen |
Spawning
| Methode | Argumente | Rückgabe | Beschreibung |
|---|
spawn_boss_at_location(file, loc?, level?) | string, location?=Boss-Pos., int?=Boss-Level | entity oder nil | Custom Boss spawnen |
spawn_custom_boss_at_location(file, loc, options?) | string, location, table | entity oder nil | Boss mit Optionen spawnen (level, silent, add_as_reinforcement, velocity) |
spawn_entity_at_location(type, loc, options?) | string (EntityType), location, table | entity | Vanilla-Entity mit Optionen spawnen (velocity, duration, effect, on_land, max_ticks) |
spawn_falling_block_at_location(loc, material, options?) | location, string (Material), table | entity | Fallenden Block spawnen (drop_item, hurt_entities, velocity, on_land) |
spawn_reinforcement_at_location(file, loc, level?, velocity?) | string, location, int?=0, vector | entity oder nil | An Boss gebundene Verstärkung spawnen |
spawn_fireworks_at_location(loc, config) | location, table | entity oder nil | Feuerwerk spawnen |
spawn_splash_potion_at_location(loc, config) | location, table | entity oder nil | Wurftrank spawnen |
Effekte und Hilfsfunktionen
| Methode | Argumente | Rückgabe | Beschreibung |
|---|
play_sound_at_location(loc, sound, volume?, pitch?) | location, string (Sound), float?=1, float?=1 | nil | Sound abspielen |
spawn_particle_at_location(loc, particle, count?) | location, string (Particle) oder table, int?=1 | nil | Partikel erzeugen |
strike_lightning_at_location(loc) | location | nil | Blitz einschlagen (umgeht EM-Schutz) |
run_empowered_lightning_task_at_location(loc) | location | nil | Verstärkter Blitzeffekt |
generate_fake_explosion(locations, center?) | Tabelle von Positionen, location | nil | Visuelle Explosion ohne Schaden |
spawn_fake_gold_nugget_at_location(loc, velocity, gravity?) | location, vector, bool?=false | fake projectile | Visuelles Goldnugget-Projektil spawnen |
run_fake_gold_nugget_damage(projectiles) | table | nil | Schadensprüfung auf falsche Projektile ausführen |
set_world_time(time) or (loc, time) | long, oder location + long | nil | Weltzeit setzen |
set_world_weather(weather, duration?) or (loc, weather, duration?) | string (CLEAR, RAIN, PRECIPITATION, THUNDER), int?=6000 | nil | Wetter setzen |
run_console_command(command) | string | nil | Konsolenbefehl ausführen |
generate_player_loot(level?) | int?=1 | nil | Beute für Schadensverursacher generieren |
drop_bonus_coins(multiplier?) | double?=2 | nil | Bonusmünzen beim Boss fallen lassen |
context.settings (EliteMobs)
| Methode | Argumente | Rückgabe | Beschreibung |
|---|
warning_visual_effects_enabled() | — | bool | Ob Warnungs-VFX in der Konfiguration aktiviert sind |
EliteMobs-Event-Tabelle
Die context.event-Tabelle wird an Schadens- und Spawn-Hooks übergeben. Felder variieren je nach Event-Typ.
| Feld / Methode | Typ | Vorhanden bei | Beschreibung |
|---|
damage_amount | double | Schadens-Events | Roher Schadensbetrag |
damage_cause | string | Schadens-Events | DamageCause-Name |
damager | entity-Tabelle | Schaden-durch-Entity-Events | Entity, die den Schaden zugefügt hat |
projectile | entity-Tabelle | Projektil-Schadens-Events | Projektil, das den Schaden zugefügt hat |
spawn_reason | string | Spawn-Event | Name des Spawn-Grundes |
entity | entity-Tabelle | Tod-/Zonen-Events | Relevante Entity |
cancel_event() | method | Die meisten Events | Das Event abbrechen |
set_damage_amount(amount) | method (double) | Schadens-Events | Schadensbetrag überschreiben |
multiply_damage_amount(multiplier) | method (double) | Schadens-Events | Aktuellen Schaden multiplizieren |
context.item FMM
Zugriff in FMM-Item-Skripten. Löst das spezifische geskriptete Item aus den ausgerüsteten Slots des Spielers über PDC-Tag auf.
Eigenschaften
| Feld | Typ | Beschreibung |
|---|
id | string | Skript-Bezeichner des Items |
Methoden
| Methode | Argumente | Rückgabe | Beschreibung |
|---|
material() | — | string | Material-Name |
get_amount() | — | int | Stapelgröße |
set_amount(n) | int | nil | Stapelgröße setzen |
consume(n?) | int?=1 | nil | Menge um n verringern, entfernen wenn null |
get_uses() | — | int | PDC-gespeicherter Nutzungszähler |
set_uses(n) | int | nil | PDC-Nutzungszähler setzen |
get_durability() | — | table oder nil | Gibt current- und max-Felder zurück, oder nil ohne Haltbarkeitsleiste |
get_durability_percentage() | — | number oder nil | 0.0--1.0 verbleibender Anteil, oder nil |
use_durability(amount, can_break?) | int, bool?=false | nil | Haltbarkeit um festen Betrag reduzieren. Bei false wird auf 1 verbleibend begrenzt |
use_durability_percentage(fraction, can_break?) | number, bool?=false | nil | Haltbarkeit um Anteil des Maximums reduzieren (0.0--1.0) |
get_name() | — | string oder nil | Anzeigename |
set_name(s) | string | nil | Anzeigenamen setzen. Unterstützt Farbcodes |
get_lore() | — | table | Array von Lore-Strings |
set_lore(table) | table | nil | Lore aus String-Array setzen |
context.prop FMM
Zugriff in FMM-Prop-Skripten. Erbt alle Entity-Felder vom zugrunde liegenden Armor Stand.
Eigenschaften
| Feld | Typ | Beschreibung |
|---|
model_id | string | Blueprint-Modellname |
current_location | location | Aktuelle Position des Props |
Methoden
| Methode | Argumente | Rückgabe | Beschreibung |
|---|
play_animation(name, blend?, loop?) | string, bool?=true, bool?=true | bool | Benannte Animation abspielen |
stop_animation() | — | nil | Alle aktuellen Animationen stoppen |
hurt_visual() | — | nil | Roter Tönungsblitz, kein Schaden |
pickup() | — | nil | Prop entfernen und Platzierungs-Item fallen lassen |
has_mount_points() | — | bool | Ob der Prop Befestigungspunkt-Bones hat |
mount(player) | entity-Tabelle | bool | Spieler auf ersten verfügbaren Sitz setzen |
dismount(player) | entity-Tabelle | bool | Spieler absetzen |
get_passengers() | — | table | Array von Entity-Tabellen für aufgesessene Spieler |
spawn_elitemobs_boss(file, x, y, z) | string, num, num, num | entity oder nil | EliteMobs-Boss spawnen (erfordert EliteMobs) |
open_inventory(player, title, rows?) | entity-Tabelle, string, int?=3 | bool | Persistentes Truheninventar öffnen (1--6 Reihen). Titel unterstützt Farbcodes |
place_book(player) | entity-Tabelle | bool | Gehaltenes beschriebenes Buch des Spielers auf Prop ablegen |
read_book(player) | entity-Tabelle | bool | Gespeichertes Buch zum Lesen öffnen |
take_book(player) | entity-Tabelle | bool | Gespeichertes Buch an Spieler zurückgeben |
has_book() | — | bool | Ob ein Buch gespeichert ist |
drop_inventory() | — | bool | Alle gespeicherten Items fallen lassen und leeren |
drop_book() | — | bool | Gespeichertes Buch fallen lassen und leeren |
is_viewing_inventory(player) | entity-Tabelle | bool | Ob der Spieler das Inventar dieses Props geöffnet hat |
set_persistent_data(key, value) | string, string | bool | String im PDC des Props speichern |
get_persistent_data(key) | string | string oder nil | String aus dem PDC des Props abrufen |
Farbcodes
Alle Methoden, die als Farbcode-unterstützend markiert sind, verwenden Magmacores ChatColorConverter. Diese Formate können in jedem String frei gemischt werden:
Legacy-Codes
Verwende & gefolgt von einem Farb-/Formatzeichen:
| Code | Farbe | Code | Format |
|---|
&0 | Schwarz | &l | Fett |
&1 | Dunkelblau | &m | Durchgestrichen |
&2 | Dunkelgrün | &n | Unterstrichen |
&3 | Dunkelaqua | &o | Kursiv |
&4 | Dunkelrot | &r | Zurücksetzen |
&5 | Dunkellila | | |
&6 | Gold | | |
&7 | Grau | | |
&8 | Dunkelgrau | | |
&9 | Blau | | |
&a | Grün | | |
&b | Aqua | | |
&c | Rot | | |
&d | Helllila | | |
&e | Gelb | | |
&f | Weiß | | |
Hex-Farben
Exakte RGB-Farbe mit 6-stelligem Hex:
&#FF5500 -- Ampersand-Präfix
<#FF5500> -- Tag-Syntax
Verläufe
Sanfte Interpolation zwischen zwei oder mehr Farben über den Text:
<gradient:#FF0000:#0000FF>Dieser Text verläuft von Rot zu Blau</gradient>
<g:#FF0000:#00FF00:#0000FF>Dreifarbiger Verlauf</g>
Die Kurzform g funktioniert identisch zu gradient. Du kannst beliebig viele Farbstopps verketten.
Regenbogen
Durchläuft das gesamte Farbspektrum. Optionale Sättigung (0--100):
<rainbow>Voller Regenbogentext</rainbow>
<r:50>Pastell-Regenbogen (50% Sättigung)</r>
Häufige Typen
location
{ x = number, y = number, z = number, yaw = number, pitch = number, world = string }
vector
{ x = number, y = number, z = number }
entity-Tabelle
Jede Tabelle mit einem uuid-Feld. Spieler- und Entity-Tabellen aus dem Kontext funktionieren direkt:
context.player -- gültige Entity-Tabelle
context.world:get_nearby_entities(x,y,z,r) -- gibt Array von Entity-Tabellen zurück