Lua APIリファレンス
このリファレンスは、稼働中のMagmaCore、FreeMinecraftModels、EliteMobsのLuaテーブルビルダー、エンリッチャー、ランタイムコンテキストリゾルバーから生成されています。
Entity Table
MagmaCoreのentityテーブルは汎用エンティティ値の基底です。Living Entity、Player、FreeMinecraftModels Propの各テーブルはこれを継承します。
Properties
| フィールド | 型 | 説明 |
|---|---|---|
uuid | string | エンティティのUUID。 |
entity_type | string | 小文字のBukkitエンティティタイプ。 |
is_valid | bool | 現在の有効性の値。 |
is_dead | bool | 現在の死亡状態。 |
current_location | table/nil | 現在の {x, y, z, yaw, pitch, world} ロケーション。 |
world | string/nil | 現在のワールド名。 |
is_player | bool | エンティティがプレイヤーかどうか。 |
is_hostile | bool | エンティティがBukkitの Monster を実装しているかどうか。 |
is_passive | bool | エンティティがBukkitの Animals を実装しているかどうか。 |
Methods
| メソッド | 引数 | 戻り値 | 説明 |
|---|---|---|---|
teleport(location) | table | nil | locationテーブルの位置へテレポートする。 |
remove() | — | nil | まだ有効であればエンティティを削除する。 |
set_silent(enabled) | bool | nil | サイレント状態を設定する。 |
set_invulnerable(enabled) | bool | nil | 無敵状態を設定する。 |
set_gravity(enabled) | bool | nil | 重力の状態を設定する。 |
set_glowing(enabled) | bool | nil | 発光状態を設定する。 |
Entity Table: EliteMobs Enrichment
稼働中のEliteMobsエンリッチャーは、MagmaCoreのentityテーブルに以下の値を追加します。elite は is_elite がtrueのときにのみ存在します。
Properties
| フィールド | 型 | 説明 |
|---|---|---|
is_elite | bool | EliteMobsが現在そのエンティティを追跡しているかどうか。 |
is_custom_boss | bool | 追跡中のエリートがカスタムボスかどうか。 |
is_significant_boss | bool | 体力倍率が 1 を超えるカスタムボスかどうか。 |
elite | table/nil | ネストされた稼働中のEliteMobsデータ。解決済みのエリートに対してのみ存在する。 |
elite.level | int | エリートレベルのスナップショット。 |
elite.name | string/nil | エリートの表示名のスナップショット。 |
elite.health | number | 現在の体力。 |
elite.max_health | number | 現在の最大体力。 |
elite.is_custom_boss | bool | そのエリートがカスタムボスかどうか。 |
elite.health_multiplier | number | 設定された体力倍率のスナップショット。 |
elite.damage_multiplier | number | 設定されたダメージ倍率のスナップショット。 |
Methods
| メソッド | 引数 | 戻り値 | 説明 |
|---|---|---|---|
elite.remove() | — | nil | EliteMobsの削除パイプラインを通してエリートを削除する。 |
Entity Table: FreeMinecraftModels Enrichment
稼働中のFreeMinecraftModelsエンリッチャーは以下の値を追加します。model は is_modeled がtrueのときにのみ存在し、プレイヤー専用の値はプレイヤーテーブルにのみ現れます。
Properties
| フィールド | 型 | 説明 |
|---|---|---|
is_modeled | bool | FreeMinecraftModelsがモデル付きエンティティとして解決するかどうか。 |
is_prop | bool | エンティティがアーマースタンドを基盤とするFreeMinecraftModelsのpropかどうか。 |
model | table/nil | ネストされたモデルデータ。モデル付きエンティティに対してのみ存在する。 |
model.model_id | string/nil | モデルブループリントの識別子。 |
model.is_dynamic | bool | モデル付きエンティティが動的かどうか。 |
is_op | bool | プレイヤー専用のサーバーオペレーター状態。 |
Methods
| メソッド | 引数 | 戻り値 | 説明 |
|---|---|---|---|
model.play_animation(name, blend?=false, loop?=false) | string, bool?=false, bool?=false | bool | モデルアニメーションを再生し、開始したかどうかを返す。 |
model.stop_animations() | — | nil | 現在のモデルアニメーションをすべて停止する。 |
model.remove() | — | nil | モデル付きエンティティを削除する。 |
has_permission(node) | string | bool | プレイヤー専用の権限チェック。 |
Living Entity Table
MagmaCoreのliving entityテーブルは、Entity Tableのすべてのプロパティとメソッドを継承します。
Properties
| フィールド | 型 | 説明 |
|---|---|---|
health | number | 現在の体力。 |
maximum_health | number | 現在の最大体力。 |
name | string/nil | 現在のBukkitエンティティ名。 |
is_alive | bool | Bukkitの死亡状態を現在時点で反転した値。 |
Methods
| メソッド | 引数 | 戻り値 | 説明 |
|---|---|---|---|
damage(amount) | number | nil | Bukkitのダメージを与える。 |
push(x, y, z) | number, number, number | nil | 現在の速度にベクトルを加算する。 |
set_facing(x, y, z) | number, number, number | nil | 方向ベクトルの向きを向かせる。 |
add_potion_effect(type, duration, amplifier) | string (PotionEffectType), int, int | nil | typeが解決できた場合にポーション効果を追加する。 |
remove_potion_effect(type) | string (PotionEffectType) | nil | typeが解決できた場合にポーション効果を除去する。 |
get_scale() | — | number | scale属性を返す。利用できない場合は 1.0。 |
set_scale(value) | number | nil | サーバーが対応している場合にscale属性を設定する。 |
Player Table
MagmaCoreのplayerテーブルは、Living Entity Tableのすべてのプロパティとメソッドを継承します。
Properties
| フィールド | 型 | 説明 |
|---|---|---|
game_mode | string | 小文字のBukkitゲームモードのスナップショット。 |
Methods
| メソッド | 引数 | 戻り値 | 説明 |
|---|---|---|---|
send_message(text) | string | nil | MagmaCoreのカラーコードパーサーで処理したテキストを送信する。 |
get_held_item() | — | table/nil | メインハンドのアイテムの {type, amount, display_name} を返す。空の手の場合はnil。 |
consume_held_item(amount?=1) | int?=1 | nil | メインハンドのスタックを減らす処理をキューに入れる。 |
has_item(material, amount?=1) | string (Material), int?=1 | bool | インベントリに指定数量が含まれるかを判定する。 |
get_target_entity(range?=50) | number?=50 | table/nil | プレイヤーが見ているエンティティをレイキャストで取得する。 |
get_eye_location() | — | table | 目の高さのロケーションを返す。 |
get_look_direction() | — | table | 単位ベクトルの {x, y, z} 方向を返す。 |
send_block_change(x, y, z, material, ticks?=-1) | int, int, int, string (Material), int?=-1 | bool | クライアント側にのみ見えるブロックを送信し、ticksが正の値ならその後リセットする。無効なマテリアルやブロックでないマテリアルの場合はfalseを返す。 |
reset_block(x, y, z) | int, int, int | bool | このプレイヤーに対して実際のブロックを復元する処理をキューに入れる。 |
sleep(x, y, z) | number, number, number | nil | 強制的な睡眠アニメーションをキューに入れ、起床後に置き換えたブロックを復元する。 |
wake_up() | — | nil | 睡眠中であればプレイヤーを起こす処理をキューに入れる。 |
show_boss_bar(text, color?=WHITE, progress, ticks?=-1) | string, string (BarColor)?=WHITE, number, int?=-1 | nil | プレイヤーの現在のソリッドなボスバーを置き換え、ticksが正の値ならその後非表示にする。 |
hide_boss_bar() | — | nil | プレイヤーの現在のLuaボスバーを削除する。 |
show_action_bar(text, ticks?=-1) | string, int?=-1 | nil | 一度だけ送信するか、正の継続時間が終わるまで40ticksごとに繰り返す。 |
show_title(title, subtitle?="", fade_in, stay, fade_out) | string, string?="", int, int, int | nil | カラーコード処理されたタイトルとサブタイトルを表示する。 |
World Table
MagmaCoreのworldテーブルは context.world として公開されます。EliteMobsのボスパワーはこれを継承し、後述のオーバーライドを適用します。
Properties
| フィールド | 型 | 説明 |
|---|---|---|
name | string | ワールド名のスナップショット。 |
Methods
| メソッド | 引数 | 戻り値 | 説明 |
|---|---|---|---|
get_block_at(x, y, z) | int, int, int | string | 小文字のMaterial名を返す。未読み込みのチャンクを読み込むことはなく、その場合は air を返す。 |
set_block_at(x, y, z, material) | int, int, int, string (Material) | bool | ブロック設置をキューに入れる。無効なマテリアルはfalseを返し、未読み込みのチャンクはキューされたタスクによりスキップされる。 |
get_highest_block_y(x, z) | int, int | int | 最も高いブロックの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?=0 | nil | パーティクルを生成する。無効な名前の場合は何も起きない。 |
play_sound(sound, x, y, z, volume?=1, pitch?=1) | string (Sound), number, number, number, number?=1, number?=1 | nil | 登録済みのサウンド、または小文字の名前空間付きリソースパックサウンドキーを再生する。 |
strike_lightning(x, y, z) | number, number, number | nil | 落雷を発生させる。 |
get_time() | — | int | ワールド時間をtick単位で返す。 |
set_time(ticks) | int | nil | ワールド時間を設定する。 |
get_nearby_entities(x, y, z, radius) | number, number, number, number | table | 付近のEntityテーブルまたはLiving Entityテーブルを返す。 |
get_nearby_players(x, y, z, radius) | number, number, number, number | table | 付近のPlayerテーブルを返す。 |
spawn_entity(type, x, y, z) | string (EntityType), number, number, number | table/nil | バニラのエンティティをスポーンさせる。無効なタイプの場合はnilを返す。 |
raycast(from_x, from_y, from_z, dir_x, dir_y, dir_z, max_distance?=50) | number, number, number, number, number, number, number?=50 | table | hit_entity、hit_location、hit_block の値を返す。 |
place_temporary_block(x, y, z, material, ticks?=0, require_air?=false) | int, int, int, string (Material), int?=0, bool?=false | bool | 一時ブロックを設置する。無効なマテリアルや未読み込みのチャンクの場合はfalseを返す。 |
drop_item(x, y, z, material, amount?=1) | number, number, number, string (Material), int?=1 | table/nil | アイテムを自然にドロップし、そのEntity Tableを返す。無効なマテリアルの場合はnilを返す。 |
spawn_firework(x, y, z, colors, type?=BALL, power?=1) | number, number, number, table, string (FireworkEffect.Type)?=BALL, int?=1 | nil | Bukkitの Color 定数名を使って花火をキューに入れる。1つも解決できない場合は白になる。 |
strike_lightning_at_location(location) | table | nil | locationテーブルのワールドで落雷を発生させる。 |
play_sound_at_location(location, sound, volume?=1, pitch?=1) | table, string (Sound), number?=1, number?=1 | nil | 登録済みのサウンド、または小文字の名前空間付きリソースパックサウンドキーを再生する。 |
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?=0 | nil | locationテーブルのワールドでパーティクルを生成する。 |
get_block_at_location(location) | table | string | 小文字のマテリアル名を返す。無効なロケーションや未読み込みのチャンクの場合は air。 |
set_block_at_location(location, material) | table, string (Material) | bool | locationテーブルのワールドでブロック設置をキューに入れる。 |
place_temporary_block_at_location(location, material, ticks?=0, require_air?=false) | table, string (Material), int?=0, bool?=false | bool | locationテーブルのワールドに一時ブロックを設置する。 |
get_highest_block_y_at_location(location) | table | int/nil | 最も高いブロックのY座標を返す。無効なロケーションの場合はnil。 |
context.world: FreeMinecraftModels Additions
FreeMinecraftModelsはこれらを自身のMagmaCore worldテーブルに登録するため、FreeMinecraftModelsのアイテムスクリプトおよびpropスクリプトの context.world に現れます。いずれのメソッドも、EliteMobsが有効でない場合やプレイヤーが解決できない場合はfalseを返し、location引数が省略されているか使用できない場合はプレイヤーのロケーションにフォールバックします。
Methods
| メソッド | 引数 | 戻り値 | 説明 |
|---|---|---|---|
drop_elitemobs_procedural_loot(player, level, location?) | table/string, int, table? | bool | プレイヤー向けに手続き生成されたEliteMobsアイテムを1つドロップする。手続き生成アイテムのドロップが無効な場合はfalseを返す。 |
drop_elitemobs_random_loot(player, level, location?) | table/string, int, table? | bool | 指定レベルでそのプレイヤー向けにEliteMobsのルートテーブルを抽選する。 |
drop_elitemobs_custom_loot(player, file, level, location?) | table/string, string, int, table? | bool | 指定したEliteMobsカスタムアイテムファイルをプレイヤー向けにドロップする。ファイルが解決できない場合はfalseを返す。 |
player 引数はplayerテーブル、UUID文字列、または正確なプレイヤー名を受け付けます。location 引数はlocationテーブル、または current_location を持つentityテーブルを受け付けます。
em Helper Table
MagmaCoreは、いずれのスクリプトフックが実行されるよりも前に、このテーブルをグローバルに公開します。
Properties
ヘルパーコンストラクタは以下のコンパクトなデータテーブルを返します。
| フィールド | 型 | 説明 |
|---|---|---|
location.x | number | em.create_location が返すX座標。 |
location.y | number | em.create_location が返すY座標。 |
location.z | number | em.create_location が返すZ座標。 |
location.world | string/nil | em.create_location に渡された場合のワールド名。 |
location.yaw | number/nil | em.create_location に渡された場合のyaw。 |
location.pitch | number/nil | em.create_location に渡された場合のpitch。 |
vector.x | number | em.create_vector が返すX成分。 |
vector.y | number | em.create_vector が返すY成分。 |
vector.z | number | em.create_vector が返すZ成分。 |
zone.kind | string | sphere、dome、cylinder、cuboid、cone、static_ray、rotating_ray、translating_ray のいずれか。 |
zone.radius | number/nil | sphere、dome、cylinder、coneの半径。 |
zone.height | number/nil | cylinderの高さ。 |
zone.x | number/nil | cuboidのXサイズ。 |
zone.y | number/nil | cuboidのYサイズ。 |
zone.z | number/nil | cuboidのZサイズ。 |
zone.length | number/nil | coneまたはrayの長さ。 |
zone.thickness | number/nil | static-rayの太さ。 |
zone.point_radius | number/nil | rotating-rayまたはtranslating-rayのポイント半径。 |
zone.animation_duration | number/nil | rotating-rayまたはtranslating-rayのアニメーション継続時間。 |
zone.origin | table/nil | set_center または set_origin で設定されたロケーション。 |
zone.destination | table/nil | set_destination で設定されたロケーション。 |
Methods
| メソッド | 引数 | 戻り値 | 説明 |
|---|---|---|---|
em.create_location(x, y, z, world?, yaw?, pitch?) | number, number, number, string?, number?, number? | table | locationテーブルを返す。 |
em.create_vector(x, y, z) | number, number, number | table | {x, y, z} のベクトルテーブルを返す。 |
location.add(dx?=0, dy?=0, dz?=0) | number?=0, number?=0, number?=0 | table | その場で加算し、同じlocationテーブルを返す。 |
em.zone.create_sphere_zone(radius) | number | table | set_center(location) を持つsphere定義を返す。 |
em.zone.create_dome_zone(radius) | number | table | set_center(location) を持つdome定義を返す。 |
em.zone.create_cylinder_zone(radius, height) | number, number | table | set_center(location) を持つcylinder定義を返す。 |
em.zone.create_cuboid_zone(x, y, z) | number, number, number | table | set_center(location) を持つcuboid定義を返す。 |
em.zone.create_cone_zone(length, radius) | number, number | table | set_origin(location) と set_destination(location) を持つcone定義を返す。 |
em.zone.create_static_ray_zone(length, thickness) | number, number | table | originとdestinationのセッターを持つstatic-ray定義を返す。 |
em.zone.create_rotating_ray_zone(length, point_radius, animation_duration) | number, number, number | table | originとdestinationのセッターを持つrotating-ray定義を返す。 |
em.zone.create_translating_ray_zone(length, point_radius, animation_duration) | number, number, number | table | originとdestinationのセッターを持つtranslating-ray定義を返す。 |
zone.set_center(location) | table | table | 中心を zone.origin として設定し、同じzoneテーブルを返す。 |
zone.set_origin(location) | table | table | originを設定し、同じzoneテーブルを返す。 |
zone.set_destination(location) | table | table | destinationを設定し、同じzoneテーブルを返す。 |
em.location.is_in_dungeon(location) | table | bool | 登録済みのダンジョン領域と、dungeon の種別を報告するオーナーを判定する。 |
em.location.is_protected(location) | table | bool | 組み込みのWorldGuard/GriefPreventionアダプターと、プラグインが登録した保護オーナーを判定する。 |
em.location.owned_by(location, namespace) | table, string | bool | プラグイン名前空間による所有を判定する。 |
em.location.owners(location) | table | table | オーナー名前空間文字列の配列を返す。 |
em.location.kinds_at(location) | table | table | 所有種別の文字列配列を返す。 |
em.location.has_kind(location, kind) | table, string | bool | 所有種別を判定する。 |
context.state
すべてのMagmaCoreスクリプトインスタンスは、そのインスタンスの生存期間中維持されるプレーンなLuaテーブルを受け取ります。カウンター、フラグ、タスクID、フック間で共有する値の保持に使用してください。
context.state.counter = (context.state.counter or 0) + 1
context.log
MagmaCore, FreeMinecraftModels, and EliteMobs NPC Methods
| メソッド | 引数 | 戻り値 | 説明 |
|---|---|---|---|
info(message) | string | nil | 共有のLuaプレフィックス付きで情報メッセージをログ出力する。 |
warn(message) | string | nil | 警告をログ出力する。 |
error(message) | string | nil | 共有の警告チャンネルを通してログ出力する。 |
EliteMobs Boss-Power Methods
| メソッド | 引数 | 戻り値 | 説明 |
|---|---|---|---|
info(message) | string | nil | ボスパワーの情報メッセージをログ出力する。 |
warn(message) | string | nil | 警告をログ出力する。 |
debug(message) | string | nil | Luaパワーのデバッグプレフィックス付きで情報メッセージをログ出力する。 |
context.scheduler
スケジュールされたタスクはスクリプトインスタンスに属し、インスタンスが終了すると同時にキャンセルされます。以下の2系統の命名はいずれも、共有のMagmaCore面とEliteMobsのボスパワーの両方で利用できます。
| メソッド | 引数 | 戻り値 | 説明 |
|---|---|---|---|
run_later(ticks, callback) | int, function | int | 遅延後に一度だけ実行し、BukkitのタスクIDを返す。 |
run_repeating(delay, interval, callback) | int, int, function | int | 初回遅延の後に繰り返し実行し、タスクIDを返す。 |
cancel(task_id) | int | nil | 所有しているタスクをキャンセルする。 |
run_after(ticks, callback) | int, function | int | run_later のエイリアス。 |
run_every(interval, callback) | int, function | int | 初回遅延なしで繰り返し実行し、タスクIDを返す。 |
cancel_task(task_id) | int | nil | cancel のエイリアス。 |
context.cooldowns
ローカルクールダウンは1つのスクリプトオーナーと定義に対してキー付けされ、グローバルクールダウンは同じオーナー間で共有されます。ローカルキーを省略すると __lua: にスクリプトファイル名を続けたものが使われます。EliteMobsのボスパワーも同じメソッド名を公開しますが、ローカル値はボスの共有クールダウンストアを使用し、グローバル値は組み込みのパワークールダウンを使用します。
| メソッド | 引数 | 戻り値 | 説明 |
|---|---|---|---|
local_ready(key?) | string? | bool | 指定キーのローカルクールダウンが準備完了かを判定する。 |
local_remaining(key?) | string? | int | 残りticksを返す。準備完了の場合は 0。 |
check_local(key, duration) | string/nil, int | bool | 準備完了ならクールダウンを開始してtrueを返す。デフォルトキーを使う場合はnilを渡す。 |
set_local(duration, key?) | int, string? | nil | ローカルクールダウンを設定または解除する。0以下の値を渡すと解除される。 |
global_ready() | — | bool | オーナーのグローバルクールダウンが準備完了かを判定する。 |
set_global(duration) | int | nil | グローバルクールダウンをtick単位で設定する。共有のMagmaCore面では0以下の値を渡すと解除される。 |
context.zones: Shared MagmaCore Surface
FreeMinecraftModelsスクリプト、EliteMobsのNPCスクリプト、その他のデフォルトのMagmaCoreコンシューマは、現在のスクリプトオーナーのワールド内で整数のゾーンハンドルを受け取ります。
| メソッド | 引数 | 戻り値 | 説明 |
|---|---|---|---|
create_sphere(x, y, z, radius) | number, number, number, number | int/nil | sphereを登録してそのハンドルを返す。オーナーにワールドがない場合はnil。 |
create_cylinder(x, y, z, radius, height) | number, number, number, number, number | int/nil | cylinderを登録してそのハンドルを返す。オーナーにワールドがない場合はnil。 |
create_cuboid(x, y, z, x_size, y_size, z_size) | number, number, number, number, number, number | int/nil | cuboidを登録してそのハンドルを返す。オーナーにワールドがない場合はnil。 |
watch(handle, on_enter?, on_leave?) | int, function?, function? | bool/nil | 既知のハンドルに対して境界の追跡を有効にする。関数を渡すと対応する on_zone_enter または on_zone_leave フックが有効になる。渡した関数の本体が直接呼び出されるわけではない。 |
unwatch(handle) | int | nil | 追跡を停止してハンドルを削除する。 |
汎用のゾーンフックでは、境界を越えたプレイヤーが context.player と context.event.player から取得できます。
context.event: Shared MagmaCore Surface
このテーブルは、共有フックが現在のBukkitイベントまたはアクターを持っている間だけ存在します。スケジュールされたコールバックや、いずれの値も持たないフックには存在しません。
| フィールドまたはメソッド | 型 | 説明 |
|---|---|---|
is_cancelled | bool | contextテーブルが構築された時点でのキャンセル状態。cancel() や uncancel() を呼んでもこのフィールドは更新されない。 |
cancel() | method | 現在のイベントをキャンセルする。Bukkitの Cancellable を実装している場合にのみ存在する。 |
uncancel() | method | 現在のイベントのキャンセルを取り消す。Bukkitの Cancellable を実装している場合にのみ存在する。 |
player | table | 現在のアクターが取得できる場合の、そのアクターのLiving Entity Table。 |
汎用のゾーンフックはアクターを提供しますがキャンセル可能なBukkitイベントは提供しないため、is_cancelled = false と player は公開されますが cancel() と uncancel() は存在しません。
context.item
FreeMinecraftModelsのアイテムスクリプトは、対応する装備中のスクリプト付きアイテムに対してこのテーブルを受け取ります。
Properties
| フィールド | 型 | 説明 |
|---|---|---|
id | string | スクリプト付きアイテムの識別子。 |
Methods
| メソッド | 引数 | 戻り値 | 説明 |
|---|---|---|---|
material() | — | string/nil | 大文字のMaterial名を返す。アイテムが装備されていない場合はnil。 |
get_amount() | — | int | スタック数を返す。装備されていない場合は 0。 |
set_amount(amount) | int | nil | スタック数の設定をキューに入れる。 |
consume(amount?=1) | int?=1 | nil | スタック数を減らす処理をキューに入れる。 |
get_uses() | — | int | 永続的な使用回数カウンターを返す。デフォルトは 0。 |
set_uses(uses) | int | nil | 永続的な使用回数カウンターの設定をキューに入れる。 |
get_durability() | — | table/nil | {current, max} を返す。耐久度バーがないアイテムの場合はnil。 |
get_durability_percentage() | — | number/nil | 残り耐久度を 0.0 から 1.0 で返す。ない場合はnil。 |
use_durability(amount, can_break?=false) | int, bool?=false | nil | 固定値の耐久度ダメージの適用をキューに入れる。破壊が許可されていない限り残り1でクランプされる。 |
use_durability_percentage(fraction, can_break?=false) | number, bool?=false | nil | 最大耐久度に対する割合分の耐久度ダメージの適用をキューに入れる。 |
get_name() | — | string/nil | 表示名を返す。ない場合はnil。 |
set_name(name) | string | nil | カラーコード処理された表示名の設定をキューに入れる。 |
get_lore() | — | table | lore文字列の配列を返す。 |
set_lore(lore) | table | nil | カラーコード処理されたlore文字列の設定をキューに入れる。 |
context.prop
FreeMinecraftModelsのpropスクリプトはこのテーブルを受け取ります。基盤となるエンティティが存在する場合、MagmaCoreのEntity Tableを継承します。
Properties
| フィールド | 型 | 説明 |
|---|---|---|
model_id | string/nil | モデルブループリント名。ブループリントが存在しない場合はnil。 |
current_location | table/nil | 現在のpropのロケーション。 |
Methods
| メソッド | 引数 | 戻り値 | 説明 |
|---|---|---|---|
play_animation(name, blend?=true, loop?=true) | string, bool?=true, bool?=true | bool | 指定した名前のアニメーションを再生する。 |
stop_animation() | — | nil | 現在のアニメーションをすべて停止する。 |
hurt_visual() | — | nil | ダメージを与えずに赤く点滅する被弾表現を再生する。 |
pickup() | — | nil | 恒久的な削除をキューに入れ、設置用アイテムをドロップする。 |
has_mount_points() | — | bool | propにマウントポイントのボーンがあるかを判定する。 |
mount(player) | table | bool | 解決されたプレイヤーを最初の空き座席に乗せる処理をキューに入れる。 |
dismount(player) | table | bool | 解決されたプレイヤーをこのpropから降ろす処理をキューに入れる。 |
get_passengers() | — | table | 搭乗中のプレイヤーのEntity Tableを返す。 |
spawn_elitemobs_boss(file, x, y, z) | string, number, number, number | table/nil | EliteMobsが有効な場合にEliteMobsのカスタムボスをスポーンさせる。 |
open_inventory(player, title, rows?=3) | table, string, int?=3 | bool | 永続ストレージを開く処理をキューに入れる。行数は 1 から 6 にクランプされる。 |
place_book(player) | table | bool | propが本を保持していない場合に、手に持っている記入済みまたは未記入の本を1冊保管する処理をキューに入れる。 |
read_book(player) | table | bool | 保管されている記入済みの本を開く処理をキューに入れる。 |
take_book(player) | table | bool | 保管されている本をプレイヤーに返す処理をキューに入れる。 |
has_book() | — | bool | propが本を保管しているかを判定する。 |
drop_inventory() | — | bool | 永続ストレージを空にして中身をドロップする処理をキューに入れる。 |
drop_book() | — | bool | 保管されている本を取り除いてドロップする処理をキューに入れる。 |
is_viewing_inventory(player) | table | bool | プレイヤーがこのpropの追跡対象インベントリを表示中かを判定する。 |
set_persistent_data(key, value) | string, string | bool | propスコープの fmm_lua_ キーの下に文字列を保存する。 |
get_persistent_data(key) | string | string/nil | 保存された文字列を返す。ない場合はnil。 |
context.npc
EliteMobsのNPCスクリプトは共有のMagmaCoreコンテキストを継承し、このNPC固有のテーブルを追加します。
Properties
| フィールド | 型 | 説明 |
|---|---|---|
name | string | 設定されたNPCの表示名。 |
filename | string | NPC設定ファイル名。 |
uuid | string | ランタイムのNPC UUID。 |
activation_radius | number | 設定されたアクティベーション半径。 |
current_location | table | ロケーションのスナップショット。基盤となるliving entityが存在する間のみ利用できる。 |
entity_type | string | 大文字のBukkitエンティティタイプ。基盤となるliving entityが存在する間のみ利用できる。 |
Methods
| メソッド | 引数 | 戻り値 | 説明 |
|---|---|---|---|
is_valid() | — | bool | NPCが有効かを判定する。 |
get_location() | — | table | 現在のNPCロケーションを返す。取得できない場合はスポーン地点にフォールバックする。返されるテーブルには direction ベクトルも含まれる。 |
get_eye_location() | — | table | 現在の目の高さのロケーションを返す。取得できない場合はスポーン地点にフォールバックする。返されるテーブルには direction ベクトルも含まれる。 |
get_activation_radius() | — | number | 現在設定されているアクティベーション半径を返す。 |
get_nearby_players(radius) | number | table | 付近のPlayer Tableを返す。 |
face_direction_or_location(target) | table | nil | ベクトルの方向を向くか、ロケーションの方を向く。 |
say_greeting(player?) | table/string? | nil | 設定された挨拶を送信する。省略時は取得できればトリガーしたプレイヤーが対象になる。playerテーブル、UUID、名前を受け付ける。 |
say_dialog(player?) | table/string? | nil | 同じプレイヤー解決方法で設定された会話文を送信する。 |
say_farewell(player?) | table/string? | nil | 同じプレイヤー解決方法で設定された別れの挨拶を送信する。 |
play_model_animation(name) | string | nil | カスタムモデルが存在する場合にモデルアニメーションを再生する。 |
EliteMobs Power Entity Reference Table
EliteMobsのボスパワーのメソッドは、投射物、花火、落下ブロックなどの非生物エンティティに対してこの軽量テーブルを返します。
Properties
| フィールド | 型 | 説明 |
|---|---|---|
name | string | エンティティ名のスナップショット。 |
uuid | string | エンティティのUUID。 |
entity_type | string | 大文字のBukkitエンティティタイプのスナップショット。 |
is_player | bool | 常にfalse。 |
is_elite | bool | 常にfalse。 |
is_mount | bool | ボスが返されたマウントテーブルをtrueとしてマークしない限りfalse。 |
current_location | table | ロケーションのスナップショット。 |
Methods
| メソッド | 引数 | 戻り値 | 説明 |
|---|---|---|---|
is_valid() | — | bool | 現在の有効性を判定する。 |
get_location() | — | table | 現在のロケーションを返す。 |
get_velocity() | — | table | 現在の速度を返す。 |
is_on_ground() | — | bool | 現在の接地状態を判定する。 |
teleport_to_location(location) | table | nil | ロケーションが解決できた場合にテレポートする。 |
set_velocity_vector(vector) | table | nil | ベクトルが解決できた場合に速度を設定する。 |
set_direction_vector(vector) | table | nil | 該当する場合にファイアボールの方向を設定する。 |
set_yield(amount) | number | nil | 該当する場合にファイアボールの爆発威力を設定する。 |
set_gravity(enabled) | bool | nil | 重力を設定する。 |
detonate() | — | nil | エンティティが花火の場合に爆発させる。 |
remove() | — | nil | エンティティを削除する。 |
unregister(reason?=OTHER) | string?=OTHER | nil | 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、ARENA_RESET のいずれかを使って登録解除する。 |
is_inside_vehicle() | — | bool | エンティティが乗り物に乗っているかを判定する。 |
has_vehicle() | — | bool | 乗り物が存在するかを判定する。 |
get_vehicle() | — | table/nil | 現在の乗り物の参照を返す。 |
set_vehicle(vehicle) | table | bool | このエンティティを解決された乗り物に乗せる。 |
leave_vehicle() | — | bool | 現在の乗り物から降りる。 |
has_passengers() | — | bool | 搭乗者が存在するかを判定する。 |
get_passenger_count() | — | int | 搭乗者の数を返す。 |
get_passengers() | — | table | 搭乗者の参照を返す。 |
add_passenger(passenger) | table | bool | 解決された搭乗者を追加する。 |
remove_passenger(passenger) | table | bool | 解決された搭乗者を降ろす。 |
eject_passengers() | — | bool | すべての搭乗者を降ろす。 |
EliteMobs Power Living Entity Table
EliteMobsのボスパワーにおける生物の値はこの独立したテーブルを使用します。BossテーブルとEliteMobs Power Playerテーブルはこれを継承します。
Properties
| フィールド | 型 | 説明 |
|---|---|---|
name | string | エンティティ名のスナップショット。 |
uuid | string | エンティティのUUID。 |
entity_type | string | 大文字のBukkitエンティティタイプのスナップショット。 |
is_player | bool | エンティティがプレイヤーかどうか。 |
is_monster | bool | エンティティがBukkitの Monster を実装しているかどうか。 |
is_elite | bool | EliteMobsがそのエンティティを追跡しているかどうか。 |
is_mount | bool | 追跡中のカスタムボスがマウントかどうか。 |
is_valid | bool | 有効性のスナップショット。 |
health | number | 体力のスナップショット。 |
maximum_health | number | 最大体力のスナップショット。 |
current_location | table | ロケーションのスナップショット。 |
Methods
| メソッド | 引数 | 戻り値 | 説明 |
|---|---|---|---|
is_alive() | — | bool | 現在の有効性と死亡状態を判定する。 |
is_ai_enabled() | — | bool | 現在のAI状態を返す。 |
is_frozen() | — | bool | EliteMobsのカスタムボスのfrozen設定を返す。該当しない場合はfalse。 |
get_location() | — | table | 現在のロケーションを返す。 |
get_eye_location() | — | table | 現在の目の高さのロケーションを返す。 |
get_height() | — | number | Bukkitのエンティティの高さを返す。 |
get_health() | — | number | 現在の体力を返す。 |
get_maximum_health() | — | number | 現在の最大体力を返す。 |
get_velocity() | — | table | 現在の速度を返す。 |
deal_damage(amount) | number | nil | 汎用のBukkitダメージを与える。 |
deal_custom_damage(amount) | number | nil | パワーの持ち主であるボスからEliteMobsのカスタムダメージを与える。 |
deal_damage_from_boss(amount) | number | nil | パワーの持ち主であるボスに帰属するBukkitダメージを与える。 |
restore_health(amount) | number | nil | 追跡対象であればEliteMobsを通して回復し、そうでなければBukkitの体力を最大値でクランプする。 |
play_sound_at_entity(sound, volume_or_options?=1, pitch?=1) | string (Sound), number/table?=1, number?=1 | nil | 登録済みまたはカスタムの名前空間付きサウンドをエンティティの位置で再生する。第2引数には {volume, pitch} を渡すこともできる。 |
play_sound_at_self(sound, volume_or_options?=1, pitch?=1) | string (Sound), number/table?=1, number?=1 | nil | エンティティの位置で再生するエイリアス。第2引数には {volume, pitch} を渡すこともできる。 |
spawn_particle_at_self(particle, count?=1) | string (Particle)/table, int?=1 | nil | パーティクル名の文字列またはパーティクル仕様テーブルをエンティティの位置で生成する。 |
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?=0 | nil | 指定したロケーションでパーティクルを生成する。 |
teleport_to_location(location) | table | nil | ロケーションが解決できた場合にテレポートする。 |
set_velocity_vector(vector) | table | nil | ベクトルが解決できた場合に速度を設定する。 |
set_gravity(enabled) | bool | nil | 重力を設定する。 |
is_on_ground() | — | bool | 現在の接地状態を判定する。 |
apply_push_vector(vector, additive?=false, delay?=1) | table, bool?=false, int?=1 | nil | 遅延後に速度を適用する。現在の速度に加算することもできる。 |
set_custom_name(name) | string | nil | カラーコード処理されたカスタム名を設定する。 |
reset_custom_name() | — | nil | 追跡対象であればEliteMobsの名前を、そうでなければBukkitの名前を復元する。 |
set_custom_name_visible(visible) | bool | nil | カスタム名の表示状態を設定する。 |
set_ai_enabled(enabled, duration?=0) | bool, int?=0 | nil | AIを設定し、ticksが正の値ならその後反対の状態に切り替える。 |
set_awareness_enabled(enabled, duration?=0) | bool, int?=0 | nil | モブの認識を設定し、ticksが正の値ならその後反対の状態に切り替える。 |
face_direction_or_location(target) | table | nil | ベクトル、または同一ワールド内のロケーションの方を向く。 |
play_model_animation(name) | string | nil | 利用可能な場合にカスタムモデルのアニメーションを再生する。 |
set_scale(scale, duration?=0) | number, int?=0 | nil | スケールを設定し、ticksが正の値ならその後 1.0 に戻す。 |
set_invulnerable(enabled, duration?=0) | bool, int?=0 | nil | EliteMobsのduration用ヘルパーを使って無敵状態を設定する。 |
remove_elite() | — | nil | 追跡中のエリートをEliteMobsの削除パイプラインを通して削除する。 |
is_healing() | — | bool | 追跡中のエリートの回復状態を判定する。 |
set_healing(enabled) | bool | nil | 追跡中のエリートの回復状態を設定する。 |
navigate_to_location(location, speed?=1, force?=false, timeout?=0) | table, number?=1, bool?=false, int?=0 | nil | 追跡中のカスタムボスを移動させる。 |
add_tag(tag, duration?=0) | string, int?=0 | nil | タグを追加し、ticksが正の値ならその後削除する。 |
remove_tag(tag) | string | nil | タグを削除する。 |
has_tag(tag) | string | bool | エンティティ、エリート、プレイヤーのタグを判定する。 |
push_relative_to(location, force?=1, extra_x?=0, extra_y?=0, extra_z?=0) | table, number?=1, number?=0, number?=0, number?=0 | nil | 元となるロケーションから遠ざける方向に、任意のオフセットを加えて押し出す。 |
overlaps_box_at_location(center, half_x?=0.5, half_y?=half_x, half_z?=half_x) | table, number?=0.5, number?, number? | bool | エンティティの当たり判定ボックスと指定したボックスの重なりを判定する。 |
is_inside_vehicle() | — | bool | エンティティが乗り物に乗っているかを判定する。 |
has_vehicle() | — | bool | 乗り物が存在するかを判定する。 |
get_vehicle() | — | table/nil | 現在の乗り物の参照を返す。 |
set_vehicle(vehicle) | table | bool | このエンティティを解決された乗り物に乗せる。 |
leave_vehicle() | — | bool | 現在の乗り物から降りる。 |
has_passengers() | — | bool | 搭乗者が存在するかを判定する。 |
get_passenger_count() | — | int | 搭乗者の数を返す。 |
get_passengers() | — | table | 搭乗者の参照を返す。 |
add_passenger(passenger) | table | bool | 解決された搭乗者を追加する。 |
remove_passenger(passenger) | table | bool | 解決された搭乗者を降ろす。 |
eject_passengers() | — | bool | すべての搭乗者を降ろす。 |
apply_potion_effect(type, duration, amplifier?=0) | string (PotionEffectType), int, int?=0 | nil | ポーション効果を適用する。 |
set_equipment(slot, material, options?) | string (EquipmentSlot), string (Material), table? | nil | 装備を設定する。optionsは unbreakable と、type および level を持つ enchantments のエントリに対応する。 |
set_fire_ticks(ticks) | int | nil | 炎上ticksを設定する。 |
add_visual_freeze_ticks(ticks?=1) | int?=1 | nil | 凍結ticksを追加する。 |
place_temporary_block(material, ticks?=0, require_air?=false) | string (Material), int?=0, bool?=false | nil | エンティティの位置に一時ブロックを設置する。 |
EliteMobs Power Player Table
EliteMobsのボスパワーにおけるプレイヤーの値は、EliteMobs Power Living Entityのすべてのプロパティとメソッドを継承します。
Properties
| フィールド | 型 | 説明 |
|---|---|---|
game_mode | string | 大文字のBukkitゲームモードのスナップショット。 |
Methods
| メソッド | 引数 | 戻り値 | 説明 |
|---|---|---|---|
send_message(text) | string | nil | カラーコード処理されたチャットテキストを送信する。 |
show_action_bar(text) | string | nil | カラーコード処理されたアクションバーを送信する。 |
show_title(title, subtitle?="", fade_in?=10, stay?=40, fade_out?=10) | string, string?="", int?=10, int?=40, int?=10 | nil | カラーコード処理されたタイトルを表示する。 |
show_boss_bar(title, color?=WHITE, style?=SOLID, duration?=40) | string, string (BarColor)?=WHITE, string (BarStyle)?=SOLID, int?=40 | nil | ボスバーを表示し、ticksが正の値ならその後削除する。 |
run_command(command) | string | nil | プレイヤーとしてコマンドを実行する。 |
context.boss
EliteMobsのボスパワーはこのテーブルを受け取ります。EliteMobs Power Living Entityのすべてのプロパティとメソッドを継承し、ここに挙げた行はエリートレベルの意味論でオーバーライドされます。
Properties
| フィールド | 型 | 説明 |
|---|---|---|
name | string | エリートの表示名、またはスクリプトファイル名のスナップショット。 |
uuid | string | エリートのUUID。 |
health | number | エリートの体力のスナップショット。 |
maximum_health | number | エリートの最大体力のスナップショット。 |
current_location | table | エリートのロケーションのスナップショット。 |
level | int | エリートレベルのスナップショット。 |
damager_count | int | ダメージを与えた者の数のスナップショット。 |
is_in_combat | bool | 戦闘状態のスナップショット。 |
exists | bool | エリートの存在状態のスナップショット。 |
Methods
| メソッド | 引数 | 戻り値 | 説明 |
|---|---|---|---|
is_alive() | — | bool | living entityの状態とEliteMobsでの存在状態を判定する。 |
get_health() | — | number | 現在のエリートの体力を返す。 |
get_maximum_health() | — | number | 現在のエリートの最大体力を返す。 |
get_location() | — | table | 現在のエリートのロケーションを返す。 |
restore_health(amount) | number | nil | EliteMobsのエンティティを通して回復する。 |
add_tag(tag, duration?=0) | string, int?=0 | nil | エリートタグを追加し、ticksが正の値ならその後削除する。 |
remove_tag(tag) | string | nil | エリートタグを削除する。 |
has_tag(tag) | string | bool | エリートタグを判定する。 |
reset_custom_name() | — | nil | エリートの表示名を復元する。 |
play_sound_at_self(sound, volume_or_options?=1, pitch?=1) | string (Sound), number/table?=1, number?=1 | nil | 登録済みまたはカスタムの名前空間付きサウンドをエリートの位置で再生する。第2引数には {volume, pitch} を渡すこともできる。 |
play_sound_at_entity(sound, volume_or_options?=1, pitch?=1) | string (Sound), number/table?=1, number?=1 | nil | エリートの位置で再生するエイリアス。第2引数には {volume, pitch} を渡すこともできる。 |
spawn_particle_at_self(particle, count?=1) | string (Particle)/table, int?=1 | nil | エリートの位置でパーティクルを生成する。 |
play_model_animation(name) | string | nil | 利用可能な場合にカスタムボスモデルのアニメーションを再生する。 |
navigate_to_location(location, speed?=1, force?=false, timeout?=0) | table, number?=1, bool?=false, int?=0 | nil | カスタムボスを移動させる。 |
get_damager_count() | — | int | 現在のダメージを与えた者の数を返す。 |
despawn() | — | nil | 理由 OTHER でエリートを削除する。 |
get_ender_dragon_phase() | — | string/nil | EnderDragon.Phase名を返す。該当しない場合はnil。 |
set_ender_dragon_phase(phase) | string (EnderDragon.Phase) | nil | 有効なエンダードラゴンのフェーズを設定する。 |
has_mount() | — | bool | ボスが生存中のマウント(乗り物)を持っているかを判定する。 |
get_mount() | — | table/nil | is_mount = true とマークされたマウントの参照を返す。 |
set_mount(mount) | table | bool | ボスを解決されたエンティティに乗せる。 |
clear_mount() | — | bool | 現在の乗り物から降りる。 |
dismount() | — | bool | clear_mount() のエイリアス。 |
start_tracking_fireball_system(speed?=0.5) | number?=0.5 | nil | モンスター系ボス向けの追尾ファイアボール挙動を開始する。 |
handle_spirit_walk_damage(cause) | string (DamageCause) | nil | Spirit Walkのダメージ処理を実行する。 |
shield_wall_is_active() | — | bool | シールドウォールの状態を判定する。 |
initialize_shield_wall(charges?=1) | int?=1 | nil | シールドウォールを初期化する。 |
shield_wall_absorb_damage(player, damage) | table, number | bool | プレイヤーのダメージの吸収を試みる。 |
deactivate_shield_wall() | — | nil | シールドウォールを解除する。 |
start_zombie_necronomicon(target, file) | table, string | nil | living entityの対象に対してZombie Necronomiconの処理を開始する。 |
send_message(text, range?=20) | string, number?=20 | nil | 範囲内のプレイヤーにカラーコード処理されたテキストを送信する。 |
get_nearby_players(range) | number | table | 付近のEliteMobs Power Playerテーブルを返す。 |
get_target_player() | — | table/nil | 現在のモブのターゲットがプレイヤーの場合にそれを返す。 |
get_nearby_players_in_zone(zone) | table | table | ゾーンに含まれるプレイヤーを返す。 |
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?=1 | nil | ゾーンの内部をサンプリングしてパーティクルを生成する。 |
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?=1 | nil | ゾーンの縁をサンプリングしてパーティクルを生成する。 |
get_particles_from_self_toward_zone(zone, particle, speed?=0.1) | table, string (Particle), number?=0.1 | table | ボスからサンプリングされたゾーン上の点へ向かう方向付きパーティクル仕様を構築する。 |
get_particles_toward_self(zone, particle, speed) | table, string (Particle), number | table | ボスへ向かう方向付きパーティクル仕様を構築する。現行のビルダーは最後に渡された引数からspeedを読み取る。 |
spawn_particles_with_vector(particles) | table | nil | 方向付きパーティクル仕様の配列を生成する。 |
summon_reinforcement(file, zone_or_location?, level?=0) | string, table?, int?=0 | table/nil | サンプリングされたゾーン上の点、指定ロケーション、またはボスの位置に増援を召喚する。 |
summon_projectile(type, origin, destination, speed?=1, options?) | string (EntityType), table, table, number?=1, table? | table/nil | 投射物をスポーンさせる。optionsは custom_damage、detonation_power、yield、incendiary、gravity、glowing、invulnerable、persistent、duration、EntityEffectの effect、spawn_at_origin、direction_only、track、on_land、max_ticks に対応する。 |
context.players: EliteMobs Boss Powers
| メソッド | 引数 | 戻り値 | 説明 |
|---|---|---|---|
current_target() | — | table/nil | イベントのアクターがプレイヤーの場合はそれを返し、そうでなければボスの現在のモブターゲットがプレイヤーの場合にそれを返す。 |
nearby_players(radius) | number | table | ボスから指定半径内のPlayer Tableを返す。 |
all_players_in_world() | — | table | ボスの現在のワールドにいるすべてのPlayer Tableを返す。 |
context.entities: EliteMobs Boss Powers
これらのクエリはボス自身を除外します。living向けのフィルターは player/players、elite/elites、mob/mobs を受け付け、それ以外の値はすべてのliving entityを対象とします。
| メソッド | 引数 | 戻り値 | 説明 |
|---|---|---|---|
get_nearby_entities(radius, filter?="living") | number, string? | table | 指定半径内のエンティティを返す。all または entities は非生物エンティティも含め、それ以外のフィルターはlivingのテーブルを返す。 |
get_entities_in_box(center, half_x, half_y, half_z, filter?="living") | table, number, number, number, string? | table | 軸に沿ったボックス内のliving entityを返す。 |
get_all_entities(filter?="living") | string? | table | ボスのワールド内で条件に一致するliving entityを返す。 |
get_direct_target_entity() | — | table/nil | 現在のフックが提供する直接のターゲットを返す。 |
get_boss_spawn_location() | — | table | ボスの元のスポーン地点を返す。 |
context.vectors: EliteMobs Boss Powers
| メソッド | 引数 | 戻り値 | 説明 |
|---|---|---|---|
get_vector_between_locations(source, destination, options?) | table, table, table? | table | 同一ワールド内のロケーション間のベクトルを返す。無効な入力やワールドをまたぐ入力の場合は {x=0,y=0,z=0}。optionsは normalize、multiplier、ベクトルの offset に対応する。 |
rotate_vector(vector, pitch?=0, yaw?=0) | table, number?=0, number?=0 | table | pitchとyaw(度単位)で回転させたベクトルを返す。 |
normalize_vector(vector) | table | table | 単位ベクトルを返す。ゼロベクトルはゼロのまま。 |
context.zones: EliteMobs Boss Powers
EliteMobsのボスパワーは、共有の整数ハンドル方式のゾーン面を、Elite Scriptのゾーン定義クエリに置き換えます。
| メソッド | 引数 | 戻り値 | 説明 |
|---|---|---|---|
get_entities_in_zone(zone, options?) | table, table? | table | 条件に一致するliving entityを返す。optionsは filter と mode = "full" または "border" に対応する。 |
get_locations_in_zone(zone, options?) | table, table? | table | サンプリングされたロケーションを返す。optionsは coverage と mode = "full" または "border" に対応する。 |
zone_contains(zone, location, mode?="full") | table, table, string? | bool | ロケーションが形状全体または境界に含まれるかを判定する。 |
watch_zone(zone, callbacks, options?) | table, table, table? | nil | {on_enter, on_leave} コールバックで監視する。optionsは filter と mode に対応する。所有された監視はスクリプトの終了とともに停止する。 |
context.script: EliteMobs Boss Powers
このブリッジは、Elite Scriptのtarget、zone、relative vectorのYAML設定と同じテーブルキーを受け付けます。
Methods
| メソッド | 引数 | 戻り値 | 説明 |
|---|---|---|---|
target(spec) | table | targetハンドル | targetハンドルを作成する。 |
zone(spec) | table | zoneハンドル | zoneハンドルを作成する。 |
relative_vector(spec, location?, zone?) | table, table?, zoneハンドル? | vectorハンドル | relative vectorのハンドルを作成する。アクションのロケーションは既定でボスになる。 |
damage(target, amount?=0, multiplier?=1) | targetハンドル, number?=0, number?=1 | nil | 解決されたすべてのターゲットエンティティにダメージを与える。 |
push(target, vector, additive?=false) | targetハンドル, table/vectorハンドル, bool?=false | nil | 解決されたターゲットエンティティに速度を適用する。 |
set_facing(target, vector) | targetハンドル, table/vectorハンドル | nil | 解決されたターゲットエンティティをベクトルの方向に向かせる。 |
spawn_particles(target, particles) | targetハンドル, table/string | nil | 解決されたターゲットのロケーションでパーティクル仕様を生成する。 |
Target Handle Methods
| メソッド | 引数 | 戻り値 | 説明 |
|---|---|---|---|
entities() | — | table | 解決してEntity Tableを返す。 |
locations() | — | table | 解決してlocationテーブルを返す。 |
first_entity() | — | table/nil | 最初に解決されたエンティティを返す。 |
first_location() | — | table/nil | 最初に解決されたロケーションを返す。 |
Zone Handle Methods
| メソッド | 引数 | 戻り値 | 説明 |
|---|---|---|---|
full_target(coverage?) | number? | targetハンドル | 形状の内部に対するtargetハンドルを作成する。 |
border_target(coverage?) | number? | targetハンドル | 境界に対するtargetハンドルを作成する。 |
full_locations(coverage?) | number? | table | サンプリングされた内部のロケーションを解決する。 |
border_locations(coverage?) | number? | table | サンプリングされた境界のロケーションを解決する。 |
full_entities() | — | table | 形状の内部にいるエンティティを解決する。 |
border_entities() | — | table | 境界上にいるエンティティを解決する。 |
contains(location, mode?="full") | table, string? | bool | 形状全体または境界への所属を判定する。 |
watch(callbacks, mode?="full") | table, string? | int | 所有された {on_enter, on_leave} の監視を開始し、そのタスクIDを返す。 |
Relative-Vector Handle Methods
| メソッド | 引数 | 戻り値 | 説明 |
|---|---|---|---|
resolve() | — | table | 現在のコンテキストに対してベクトルを解決する。 |
EliteMobs Power Event Table
EliteMobsのボスパワーのイベント値は、イベントの種類に応じて条件付きでフィールドとメソッドを公開します。
Properties
| フィールド | 型 | 説明 |
|---|---|---|
damage_amount | number/nil | ダメージイベントのダメージ量のスナップショット。 |
damage_cause | string/nil | ダメージイベントが公開している場合のDamageCause名。 |
damager | table/nil | エンティティによるダメージイベントの、ダメージ元の参照。 |
projectile | table/nil | ダメージ元が投射物の場合の投射物の参照。 |
spawn_reason | string/nil | エリートのスポーン理由。 |
entity | table/nil | 死亡イベントまたはゾーンイベントのエンティティ。 |
Methods
| メソッド | 引数 | 戻り値 | 説明 |
|---|---|---|---|
cancel_event() | — | nil | EliteDamageEventまたはその他のキャンセル可能なイベントをキャンセルする。 |
set_damage_amount(amount) | number | nil | EliteDamageEventのダメージを置き換える。 |
multiply_damage_amount(multiplier) | number | nil | EliteDamageEventのダメージを乗算する。 |
context.world: EliteMobs Additions and Overrides
EliteMobsのボスパワーはMagmaCoreのWorld Tableのすべての行を継承し、以下のメソッドを追加またはオーバーライドします。
Methods
| メソッド | 引数 | 戻り値 | 説明 |
|---|---|---|---|
play_sound_at_location(location, sound, volume?=1, pitch?=1) | table, string (Sound), number?=1, number?=1 | nil | EliteMobsのサポートを通じて登録済みサウンドとカスタムの名前空間付きサウンドを受け付けるオーバーライド。 |
spawn_particle_at_location(location, particle, count?=1) | table, string (Particle)/table, int?=1 | nil | EliteMobsのパーティクル仕様テーブルを受け付けるオーバーライド。 |
set_block_at_location(location, material, require_air?=false) | table, string (Material), bool?=false | nil | 期限なしのEliteMobs一時ブロック設置を使用するオーバーライド。 |
place_temporary_block_at_location(location, material, ticks?=0, require_air?=false) | table, string (Material), int?=0, bool?=false | nil | EliteMobsの一時ブロック設置を使用するオーバーライド。 |
get_block_type_at_location(location) | table | string/nil | 大文字のMaterial名を返す。無効なロケーションの場合はnil。 |
get_highest_block_y_at_location(location) | table | int/nil | 最も高いブロックのY座標を返すオーバーライド。取得できない場合はnil。 |
get_blast_resistance_at_location(location) | table | number | ブロックの爆発耐性を返す。無効なロケーションの場合は既定で 0。 |
is_air_at_location(location) | table | bool | 対象のブロックが空気かを判定する。 |
is_passable_at_location(location) | table | bool | Bukkitの通過可能性を判定する。 |
is_passthrough_at_location(location) | table | bool | マテリアルが非固体かを判定する。 |
is_on_floor_at_location(location) | table | bool | 対象が非固体で、その下が固体ブロックかを判定する。 |
is_standing_on_material(location, material) | table, string (Material) | bool | 真下のブロックを判定する。 |
strike_lightning_at_location(location) | table | nil | 落雷の前にEliteMobsの雷バイパスを有効にするオーバーライド。 |
run_empowered_lightning_task_at_location(location) | table | nil | 強化エンダードラゴンの雷サポートを実行する。 |
set_world_time(time) / set_world_time(location, time) | int/table, int? | nil | ボスのワールドの時間、または渡されたロケーションのワールドの時間を設定する。 |
set_world_weather(weather, duration?=6000) / set_world_weather(location, weather, duration?=6000) | string/table, string/int?, int?=6000 | nil | CLEAR、PRECIPITATION、RAIN、THUNDER を設定する。 |
run_console_command(command) | string | nil | コンソールとしてコマンドを実行する。 |
spawn_boss_at_location(file, location?, level?) | string, table?, int? | table/nil | 指定または現在のロケーションで、指定または現在のレベルのカスタムボスをスポーンさせる。 |
spawn_custom_boss_at_location(file, location, options?) | string, table, table? | table/nil | カスタムボスをスポーンさせる。optionsは silent、level、add_as_reinforcement、velocity に対応する。 |
spawn_entity_at_location(type, location, options?) | string (EntityType), table, table? | table/nil | バニラのエンティティをスポーンさせる。optionsは velocity、duration、EntityEffectの effect、on_land、max_ticks に対応する。 |
spawn_falling_block_at_location(location, material, options?) | table, string (Material), table? | table/nil | 落下ブロックをスポーンさせる。optionsは drop_item、hurt_entities、velocity、on_land に対応する。 |
spawn_reinforcement_at_location(file, location, level?=0, velocity?) | string, table, int?=0, table? | table/nil | ボスに紐づいた増援を召喚する。 |
spawn_fireworks_at_location(location, options) | table, table | table/nil | 花火をスポーンさせる。optionsは effects、type、flicker、trail、colors、fade_colors、power、velocity、shot_at_angle に対応し、type にはFireworkEffect.Typeの名前を使う。 |
spawn_splash_potion_at_location(location, options) | table, table | table/nil | スプラッシュポーションをスポーンさせる。effects の各エントリはPotionEffectTypeの type、duration、amplifier、overwrite を受け付け、トップレベルの velocity も使用できる。 |
generate_fake_explosion(locations, source?) | table, table? | nil | ブロックロケーションの配列に対してEliteMobsの疑似爆発を生成する。 |
spawn_fake_gold_nugget_at_location(location, velocity, gravity?=false) | table, table, bool?=false | table/nil | 疑似金塊の投射物をスポーンさせる。 |
run_fake_gold_nugget_damage(projectiles) | table | nil | 疑似投射物のダメージ処理を実行する。 |
generate_player_loot(times?=1) | int?=1 | nil | 条件を満たすダメージ元プレイヤーに対してプレイヤールートを生成する。 |
drop_bonus_coins(multiplier?=2) | number?=2 | nil | 条件を満たすダメージ元プレイヤーにボーナスコインをドロップする。 |
EliteMobs Fake Projectile Table
spawn_fake_gold_nugget_at_location は、スポーンに成功したときにこのテーブルを返します。
Methods
| メソッド | 引数 | 戻り値 | 説明 |
|---|---|---|---|
get_location() | — | table | 疑似投射物のロケーションを返す。 |
set_gravity(enabled) | bool | nil | 疑似投射物の重力を設定する。 |
remove() | — | nil | 疑似投射物を削除する。 |
is_removed() | — | bool | すでに削除済みかを判定する。 |
context.settings
EliteMobsのボスパワーは、worldテーブルと同じビルダーからこのsettingsテーブルを受け取ります。
Methods
| メソッド | 引数 | 戻り値 | 説明 |
|---|---|---|---|
warning_visual_effects_enabled() | — | bool | 現在の警告用ビジュアルエフェクト設定を返す。 |