Sample: event_example
A sample that adds three NPC talk and quest types to world logic · id event_example · SDK ^1.2 · latest version 1.0.0
Its name in the manager window is 씬 이벤트 예제 (NPC 대화 · 퀘스트) (scene event sample: NPC talk · quest). It shows all three roles of AddSceneEvent (trigger · condition · action), both with and without Simulate.
| What it shows | type |
|---|---|
A trigger without Simulate (fired only with the Fire button) | npc_talk |
A condition with Simulate (decided from state the plugin remembers) | quest_state |
An action with Simulate (logs + changes state) | quest_start |
Actor · Text · Enum · Bool fields | Fields of the three types |
Summary templates | All three types |
Requirements
Section titled “Requirements”| Item | Value |
|---|---|
| Editor | 0.9.0 or later |
| SDK | 1.2 or later (^1.2) |
| Plugin dependencies | None |
| Game server | The NP Scene server plugin + handlers for the same types (see “Server-side behavior” below) |
| Source | samples/plugins/event_example/ in the NP Editor source (Plugin.cs · EventExample.csproj · plugin.json) |
Installation
Section titled “Installation”- Build it.
If you build outside the source tree, change the csproj to referencedotnet build samples/plugins/event_example/EventExample.csproj -c Release
NP.Editor.Sdk.dllin the install folder, as in Quick start. - Copy
EventExample.dllandplugin.jsonto%APPDATA%\NPEditor\plugins\event_example\. Do not includeNP.Editor.Sdk.dll. - In Tools › Plugin Manager…, click Rescan.
- You are done when the Registered column shows
scene events 3.
Quick start
Section titled “Quick start”Create a rule that “starts quest q1 the first time the player talks to an NPC”, then test it in Play.
- Place one
display,textorspawnscene actor. This is the NPC. - Open Tools › World logic and add a rule.
- Trigger: group 퀘스트(예제) (quest, sample) › NPC 에게 말 걸 때 (when talking to an NPC). In the NPC field, choose the actor from step 1.
- Condition: 퀘스트 상태 (quest state). Quest id =
q1, Status =none. - Action: 퀘스트 시작 (start quest). Quest id =
q1. - The rule’s one-line summary appears as 플레이어가 NPC 「
」 에게 말을 걸면 . - Start Play with Play test in the World logic panel, then click Fire on that rule.
[event_example] 퀘스트 q1 시작 → <player>is recorded in the World logic panel’s log list.- Click Fire once more. The state is now
active, so the condition is false and the action does not run.
The same rule appears as three nodes in the Logic graph. You can connect the NPC actor’s data pin to the NPC field.
What it adds
Section titled “What it adds”| Kind | Name | Description |
|---|---|---|
| World logic trigger | npc_talk NPC 에게 말 걸 때 | When a player starts talking to an NPC. Fired by the server plugin. In the preview it fires only with the Fire button. Icon interact |
| World logic condition | quest_state 퀘스트 상태 | True when the triggering player’s quest is in that state. Icon logic |
| World logic action | quest_start 퀘스트 시작 | Sets the triggering player’s quest to active. Icon star |
| Event | WorldChanged | Clears the preview quest state. |
All three types are in the menu group 퀘스트(예제).
Scene events / fields
Section titled “Scene events / fields”npc_talk (trigger)
Section titled “npc_talk (trigger)”One-line summary: 플레이어가 NPC {npc} 에게 말을 걸면
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
npc | Actor (display · text · spawn) | Yes | — | The NPC actor being talked to |
line | Text | No | — | Dialogue line id. If empty, any line |
quest_state (condition)
Section titled “quest_state (condition)”One-line summary: 퀘스트 {quest} 가 {state} 일 때
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
quest | Text | Yes | — | Quest id |
state | Enum (none · active · done) | No | none | State |
quest_start (action)
Section titled “quest_start (action)”One-line summary: 퀘스트 {quest} 시작
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
quest | Text | Yes | — | Quest id |
notify | Bool | No | true | Show a notification |
It is saved in scene.json like this (part of a rule).
{ "trigger": { "type": "npc_talk", "npc": "npc_guard" }, "conditions": [ { "type": "quest_state", "quest": "q1", "state": "none" } ], "actions": [ { "type": "quest_start", "quest": "q1" } ]}Server-side behavior
Section titled “Server-side behavior”This sample covers only the editor side. To run the rules on the game server, register handlers for the same three types in the NP Scene server plugin.
| type | What the server handler does |
|---|---|
npc_talk | Fires rules whose npc (and line) match on an NPC talk event |
quest_state | Reads the triggering player’s state from the quest store and compares it |
quest_start | Sets the quest to active, and shows a notification if notify |
- Register the handlers with the
SceneEventsApiobtained from Bukkit’sServicesManagerin a Paper plugin. - A server without handlers skips these types with a single warning.
npc_talkrules do not run.
Limitations / known issues
Section titled “Limitations / known issues”- The preview quest state exists only in editor memory. It is cleared on new world · open · plugin disable, and is not shared with the server.
- The
notifyfield ofquest_startis not used in the preview (it only logs). - The
linefield is not used in the preview. - The type names have no plugin prefix (
npc_talk…). They are kept short because this is a sample. In your own plugin, prefix them with your name, as inmyquest_npc_talk. If another plugin registers the same type first, this sample does not enable. - When the plugin is disabled, rules that use these types get an Unknown type warning. The rules and field values are not deleted.
Changelog
Section titled “Changelog”| Version | Date | Details |
|---|---|---|
| 1.0.0 | 2026-10-04 | First version (SDK 1.2): trigger npc_talk · condition quest_state · action quest_start |