add-interactivity

Installation
SKILL.md

Adding Interactivity to Decentraland Scenes

RULE: Fetch composite entities — never re-create them

If the entity to make interactive was defined in assets/scene/main.composite, look it up by name or tag in index.ts. Do NOT call engine.addEntity() + component create — that would create a duplicate.

import { engine, pointerEventsSystem, InputAction } from '@dcl/sdk/ecs'
import { EntityNames } from '../assets/scene/entity-names'

export function main() {
  // By name (type-safe via auto-generated EntityNames enum)
  const door = engine.getEntityOrNullByName(EntityNames.Door_1)
  if (door) {
    pointerEventsSystem.onPointerDown(
      { entity: door, opts: { button: InputAction.IA_PRIMARY, hoverText: 'Open' } },
      () => { /* open door */ }
    )
  }
Installs
3
GitHub Stars
3
First Seen
Apr 13, 2026
add-interactivity — decentraland/sdk-skills