script-components

Create reusable Creator Hub Script components with configurable constructors and lifecycle hooks.

3|Updated Apr 13, 2026
One-click install
npx skills add https://github.com/decentraland/sdk-skills --skill script-components
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: script-components
Source: https://github.com/decentraland/sdk-skills/tree/main/script-components
Command: npx skills add https://github.com/decentraland/sdk-skills --skill script-components

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill standardizes the creation of self-contained Script components for the Creator Hub, enabling configurable, reusable logic attached to entities and ensuring consistent lifecycle usage.

Core Features & Use Cases

  • Configurable constructors: exposes public parameters in the Creator Hub UI, including mandatory public src and entity, with optional defaults and tooltips.
  • Lifecycle and behavior: supports start() and update(dt) methods for per-scene initialization and frame updates.
  • Inter-script communication: supports @action methods for triggers and ActionCallback parameters to wire editor actions, and provides runtime utilities to call other script instances.
  • Asset referencing and runtime discovery: demonstrates referencing assets via this.src and finding child entities by name at runtime to keep scripts portable across scenes.
  • Practical use cases: create reusable scripted items or custom logic attached to entities in a Creator Hub scene.

Quick Start

Create a new .tsx file that exports a class with a constructor(public src: string, public entity: Entity) and optional additional parameters, implement start() and update(dt), and attach it to an entity via the Creator Hub UI.

Frequently Asked Questions about script-components

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

FAQPage Schema
How do I create reusable TypeScript components for Decentraland Creator Hub scenes?

To create reusable Creator Hub Script components, export a TypeScript class with a constructor(public src: string, public entity: Entity) and implement optional start() and update(dt) methods for per-scene initialization and frame updates.

How does inter-script communication work in Decentraland SDK components?

Inter-script communication in Creator Hub Script components uses @action methods for triggers and ActionCallback parameters to wire editor actions, plus runtime utilities to call other script instances directly.

Can I expose configurable parameters for a TypeScript script in the Creator Hub UI?

Yes, you can expose configurable constructor parameters in the Creator Hub UI by declaring them as public properties, including mandatory public src and entity, with optional defaults and tooltips for editor visibility.

What is the best way to reference assets and find child entities in an ECS script?

The best way to reference assets and find child entities in an ECS script is by using this.src for asset referencing and finding child entities by name at runtime to keep scripts portable across scenes.

Do I need specific dependencies to build self-contained Script components?

You do not need specific dependencies to build self-contained Script components, as they operate independently and only require a SKILL.md frontmatter with a name and description, plus optional scripts, references, and assets directories.