lighting-environment
Lighting and Environment in Decentraland
RULE: Use Smart Items for lights when the Creator Hub MCP is available
When the user asks to add a light and the Creator Hub MCP tools are present (mcp__creator-hub__*), always search_catalog first before manually creating an entity with LightSource. The Creator Hub catalog includes ready-made light Smart Items:
- Spotlight (
87c829b3-8e8d-4fcb-9f43-85d3aa9084f6, categorylights) -- comes with a real GLB model (assets/asset-packs/spotlight/spotlight.glb), a pre-configuredcore::LightSource, built-in Turn On / Turn Off / Toggle actions, and properinspector::Configfor the Creator Hub UI. - Point Light (category
lights) -- same pattern: GLB placeholder, pre-configuredcore::LightSourceof type Point, built-in actions. - There is also a decorative "Spotlight" (category
decorations) that is a visual-only fixture model with noLightSource-- make sure you pick from thelightscategory when the user wants actual illumination.
Use place_smart_item with the assetId and a position. It handles everything: downloading the GLB files, resolving asset paths, setting up asset-packs::Placeholder, asset-packs::Script, asset-packs::Actions, and inspector::Config components. The entity is immediately usable in the editor with action triggers wired up.
Only fall back to manual create_entity + set_component core::LightSource when:
- No Creator Hub MCP tools are available (pure code workflow).
- The user needs a light with no visual model (invisible light source).
- The user needs non-standard light parameters that a Smart Item does not expose.
The manual LightSource component API documented below remains the authoritative reference for both paths -- Smart Items use the same underlying component.