target-kit (reading the bundle, for a target in any language), script-writer, skript-lang and skript-gui (chest GUIs in Skript). Its README explains each one.
Register a target
compile returns [{ path, content }], an object { 'path': content }, or { files, warnings, errors }. Warnings go to the app’s log, and the code views show them as comments. Paths are relative to folder. It runs in your expansion, so you can keep it pure and test it on its own.
serverPlugin.url may contain {version} (the Minecraft version). To pick a URL in code instead, give resolve(version) and return the URL. No permission is needed: the user picks the target.
install is optional: the steps the “Export completed” modal shows for folder after a pack is exported, plus up to four https links ({ label, url, note? }). {mcVersion} in it is the project’s Minecraft version. Without one, the modal shows its generic copy-and-reload steps.
id is lowercase letters, digits, _ or -, and app-wide. denizen is taken by the built-in target.
What compile receives
The script bundle: every mechanic and GUI in the project, as plain data. It has the same shape for every target. When an editor asks for a preview,bundle.preview is true and holds only the item being edited; leave out support files (command scripts and the like) then.
Mechanics
steps is the graph already walked. There are three kinds:
body is a loop or a gate (Repeat, Foreach, ForEachBlockInRadius, RandomChance, Cooldown). What was wired after the card runs inside it. Params left empty in the editor are absent, so your defaults apply.
GUIs
- Slots count cells from 0, left to right and top to bottom. A button covers
width × heightcells fromslot. commandis one command per line, without the slash.titleGlyph.textis the title the way the content plugin writes a glyph: MiniMessage for Nexo,:offset_N::glyph:for ItemsAdder. The shift is already worked out. Use it as the inventory’s title.- An item slot (
type: 'slot') is a cell the player puts items into. IfreturnOnCloseis true, give its items back when the GUI closes.
logic.triggers is the GUI’s Logic graph, walked like a mechanic’s:
GUI-logic steps:
takeFromSlot(slot, amount), returnSlot(slot), clearSlot(slot), setSlot(slot, item, amount), message(text), giveItem(item, amount), sound(sound), command(command, as) where as is 'server' or 'player', closeGui, openGui(gui), wait(ticks). Checks: slotHas(slot, item, amount), slotEmpty(slot), playerHasItem(item, amount), hasPermission(permission). In GUI logic, slot is a slotId. Look it up in elements.
The GUI command
The GUI editor shows every GUI’s open command,/nm gui open <gui> [player] (bundle.commands.gui). Users copy it into their server, so your target must provide it. Denizen writes it as nm_system.dsc, and the Skript example writes it as nm_system.sk.
The built-in vocabulary
Your target spells everything the editors offer.catalog (the second argument, or sdk.scripting.catalog()) lists it all, with labels and params:
Triggers:
player.* (35, from rightclick and joins to craftItem), entity.* (9), server.* (4) and world.* (10). See catalog.mechanics.triggers for the full list.
Spell what you can. For anything else, write a comment in the file, add a warning, and move on. Never guess. The user then sees in the log and in the code view what their target cannot do yet.
Values and variables
Text values carry variables as tokens:'Welcome <player.name>!'. Every editor saves them this way, so one mapping covers both. helpers.mapTags rewrites the tokens you know and reports the rest:
target, player and location hold player, <player> or a token like <context.entity>. Item and block params hold diamond, minecraft:diamond, DIAMOND, or a custom item such as nexo:ruby. helpers.itemRef(value) tells them apart: { custom: true, id: 'ruby' }.
Helpers
sdk.scripting.helpers:
sdk.scripting.program(graph) and sdk.scripting.guiProgram(graph) walk a raw graph into steps, exactly as the bundle does.
Entries other expansions add
Expansions add Mechanics triggers, actions and conditions, and GUI-logic steps and triggers. Each entry spells itself per target:compile meets a command it has no table entry for, look it up in the catalog and use spellingFor(entry, yourId) with fill or fillLines. If there is no spelling for you, report it. To support your target in other expansions’ entries, tell their authors your target id. See Logic editors for the entry shapes.
What the app does with your target
Legacy NMScript
NMScript is retired. Mechanics written by hand in NMScript before then still export through Denizen exactly as before. Your target never receives them. The export warns which items it skipped, and the editor offers to rebuild them in the graph.Checklist
compileis pure: bundle in, files out. Test it with bundles built from real items.- Every built-in trigger, action and condition is spelled or reported.
- Expansion entries are read through
spellingFor. - Variables are mapped, and the unknown ones reported.
- GUIs: inventory, buttons, item slots (given back on close), Logic,
/nm gui open. - Support files are left out when
bundle.previewis set. serverPluginandreloadCommandsare set, and the URL names a real release file.- The output loads on a real server. Compile a project that uses every trigger, action and check, write the files into a test server’s scripts folder, and load them: zero errors is the bar.