Skip to content

Entity Definition Dashboard

Goals

  • Manage gameplay entities (models, attributes, drop tables) from the Control Center without touching Mongo manually.
  • Provide a typed persistence layer that validates ObjectId references to base items and item models.
  • Ensure auditability via editor audit logging and permission-gated access.

Scope

Backend

  • Introduce EntityDefinition collection with unique key, model metadata, arbitrary property bag and structured drop definitions.
  • Expose REST endpoints (GET/POST/PATCH/DELETE /api/entities) with validation against item and item-model collections.
  • Register editor page access entries and new permission nodes (editor:entities.*).

Frontend

  • Add Entities navigation entry with overview table, search and counts.
  • Implement create/edit form with sections for metadata, primary model, variants, properties and drops.
  • Reuse dashboard stores to prefetch base items and item models for selection inputs.
  • Separates umfangreiches Modell-Handling auf eine eigene Seite (/entities/:id/models) inklusive Blockbench-Upload und Variantenpflege.
  • Schnell-Upload auf /entity-models erlaubt Blockbench .bbmodel-Dateien direkt einer Entity zuzuweisen ohne den Detail-Editor zu öffnen.
  • Entity-Model-Vorschau liefert Hitbox-Toggles, Animationsliste und Playback auf Basis der Blockbench-Keyframes, damit Rigs ohne externe Tools geprüft werden können.

Data Model

  • EntityDefinition: key, name, category, description, tags, properties (Map<String, any>).
  • model: optional primary EntityModelConfig (variant key, display name, resource keys, optional item model reference, numeric dimensions, optional geometryData + geometrySource from Blockbench uploads).
  • variants: zero or more EntityModelConfig entries for alternate states (each may override geometry via Blockbench uploads).
  • drops: list of EntityDropDefinition describing itemId, chance (0-1), quantity range, roll type and JSON conditions.

API Surface

  • GET /api/entities → list definitions.
  • GET /api/entities/{id|key} → fetch by ObjectId or key.
  • POST /api/entities → create, requires editor:entities.write.
  • PATCH /api/entities/{id} → replace payload, requires editor:entities.edit.
  • DELETE /api/entities/{id} → remove definition, requires editor:entities.delete.

Permissions & Page Access

  • New editor page key entities with read/create/edit/delete actions mapped to the respective permission nodes.
  • Page guard ties /api/entities routes to the new page definition so dashboard auth gating applies automatically.

Rollout & Verification

  • Gradle :server:build to ensure new Java sources compile.
  • npm run build to verify Vue routes and TypeScript store work as intended.
  • Smoke test: create entity with sample model and drop, ensure list reflects the entry and backend persists values.

Follow-ups / Open Questions

  • Add metadata editors for variant/model metadata map if needed by runtime systems.
  • Integrate property suggestions once gameplay services publish schemas.
  • Consider JSON schema validation for conditions once drop consumer is finalized.