script-components

Writes TypeScript script classes for Creator Hub Script components attached to Decentraland entities.

Updated Sep 11, 2026
One-click install
npx skills add https://github.com/ansonj-dev/neon-reverse --skill script-components-ansonj-dev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: script-components
Source: https://github.com/ansonj-dev/neon-reverse/tree/main/agent/skills/script-components
Command: npx skills add https://github.com/ansonj-dev/neon-reverse --skill script-components-ansonj-dev

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @dcl/sdk, @dcl/asset-packs, @dcl/sdk-commands.

What problem does it solve? Writing reusable per-entity behavior for Decentraland Creator Hub scenes requires knowing a specific class contract, file placement rules, and editor integration details that are easy to get wrong, causing scripts to silently fail or disappear from the editor UI. ## Core Features & Use Cases - Script class authoring: Defines the required class structure with src/entity constructor parameters, start() and update(dt) lifecycle methods, and correct placement under assets/scripts/ so TypeScript compilation covers the file. - Editor-exposed parameters: Documents supported constructor param types (string, number, boolean, Entity, ActionCallback, Slider), JSDoc @param tooltips, @action tags, and the positional layout JSON used when setting Script component params programmatically. - Use Case: A creator wants a reusable smart item, such as a treasure chest with open/close actions triggerable by a button. This Skill produces a TreasureChest.ts class with @action-tagged methods, optional ActionCallback hooks, and child-entity lookup by name substring so duplicated copies keep working. ## Quick Start Write a Creator Hub Script component class that rotates an entity and exposes its speed as a slider parameter.

Frequently Asked Questions about script-components

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a Script component file for Decentraland Creator Hub?

Create a .ts file under assets/scripts/ exporting a single class whose constructor starts with public src: string and public entity: Entity, followed by your configurable params. Add optional start() and update(dt) methods for load-time and per-frame logic.

Where must script files live in a Creator Hub scene?

Script files must live inside assets/, typically assets/scripts/. The scene tsconfig only includes src/**/* and assets/**/*, so a root-level scripts/ folder is excluded from type checking and the Script component path will not resolve.

Why did my script parameters disappear from the Creator Hub UI?

The most common cause is using decorator syntax like @action() above a method. The Creator Hub parser has no decorators plugin, so parsing fails and all params and actions silently vanish. Use only the @action JSDoc tag inside a comment block.

How do I expose a slider for a number parameter in Creator Hub?

Declare the param as Slider<Min, Max, Step>, for example public speed: Slider<0, 10, 0.5> = 1. The runtime value is a plain number; the type only tells the editor to render a slider. Copy the local type alias into your script since scenes cannot import it yet.

Can a script reference child entities of its own smart item?

Do not pass child entities as Entity params because entity IDs are not stable across scenes. Instead, iterate the hierarchy at runtime and match the child Name component with a substring check like startsWith, so duplicated items with auto-numbered names still work.

When should I not use a Script component for scene logic?

Do not use Script components for regular scene index.ts code or global engine systems. Script components are for self-contained per-entity behavior; global systems and scene-wide state belong in the scene runtime instead.