ScriptableNPC

public class ScriptableNPC extends ScriptableEntity

Adapts an NPCEntity for the shared Magmacore Lua scripting runtime.

Provides only the NPC-specific (tier-3) context table (context.npc); the generic scripting surface — context.world (incl. strike_lightning), zones, scheduler, cooldowns, log, event — is injected automatically by ScriptInstance, the same way FreeMinecraftModels props receive it. This replaces the old self-contained NPC script runtime that could not reach any of those primitives.

Constructors

Link copied to clipboard
public void ScriptableNPC(NPCEntity npcEntity)

Properties

Link copied to clipboard
public final NPCEntity npcEntity
Link copied to clipboard
public final static ScriptHook ON_INTERACT
Link copied to clipboard
public final static ScriptHook ON_PROXIMITY_ENTER
Link copied to clipboard
public final static ScriptHook ON_PROXIMITY_LEAVE
Link copied to clipboard
public final static ScriptHook ON_REMOVE

Functions

Link copied to clipboard
public LuaTable buildContextTable(ScriptInstance instance)
Link copied to clipboard
public Entity getBukkitEntity()
Link copied to clipboard
public String getContextKey()
Link copied to clipboard
public Location getLocation()
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
public LuaValue resolveExtraContext(String key, ScriptInstance instance)
Exposes context.player as the actor of the current event (interact / proximity), built from Magmacore's living-entity table so NPC scripts get the full player API.

Inherited functions

Link copied to clipboard
public Map<String, Long> getGlobalCooldownStore()
Link copied to clipboard
public Map<String, Long> getLocalCooldownStore(ScriptDefinition definition)
Link copied to clipboard
public boolean handleScriptError(String context, Exception failure)
Link copied to clipboard
public boolean isScriptOwnerActive()
Link copied to clipboard
public void onShutdown()