跳至主要内容

Lua 腳本:列舉與值

webapp_banner.jpg

本頁連結到 EliteMobs Lua 方法使用的每個列舉類型的 Spigot Javadocs。在 Lua 程式碼中使用精確的列舉常數名稱(如 "FLAME""ZOMBIE""STONE")作為字串。

  • 拼寫必須與列舉常數名稱完全匹配
  • 大小寫通常在內部標準化,但為了安全起見請匹配 Javadoc 的拼寫
  • 如果名稱錯誤,EliteMobs 會記錄警告且不執行任何操作

Enum Reference

EnumUsed forJavadoc
BarColorBoss bar colorBarColor
BarStyleBoss bar styleBarStyle
EntityEffectEntity visual effectsEntityEffect
EntityTypeEntity spawningEntityType
FireworkEffect.TypeFirework shapeFireworkEffect.Type
MaterialBlocks and itemsMaterial
ParticleParticle effectsParticle
PotionEffectTypePotion effectsPotionEffectType

Non-Spigot Values

Zone shapes

nUsed by native zone definitions (kind field) and script utility zone specs (shape field).

Native (kind)Script Utility (shape)
sphereSPHERE
domeDOME
cylinderCYLINDER
cuboidCUBOID
coneCONE
static_raySTATIC_RAY
rotating_rayROTATING_RAY
translating_rayTRANSLATING_RAY

Entity filters

nUsed by context.zones and context.entities query options.

FilterMatches
playerPlayers only
eliteElite mobs only
mobNon-player living entities
livingAll living entities (default)

Weather values

nUsed by context.world:set_weather(weather).

ValueEffect
CLEARClear skies
RAINRain
THUNDERThunderstorm

Target types

nUsed by context.script:target() specs.

ValueResolves to
SELFThe boss entity
SELF_SPAWNThe boss's spawn location
DIRECT_TARGETThe entity involved in the current event
NEARBY_PLAYERSPlayers within range of the boss
NEARBY_MOBSNon-player mobs within range
NEARBY_ELITESElite mobs within range
ALL_PLAYERSAll online players
WORLD_PLAYERSAll players in the boss's world
ZONE_FULLEntities/locations inside a zone volume
ZONE_BORDEREntities/locations on a zone border
LOCATIONA specific location from the spec