Guía YAML uis/ v1.0.1

Diseñar UIs

Las pantallas de EventUI se definen como archivos .yml en plugins/EventUI/uis/. Cada archivo describe una pantalla completa con elementos, posiciones, sonidos y transiciones.

Estructura de una pantalla

uis/mi-pantalla.yml — estructura completa
id: "mi-pantalla"
title: ""
screen_width: 1366       # escala automáticamente a la resolución del cliente
screen_height: 720

screen_properties:
  pause_game: "false"
  blur: false                           # booleano sin comillas
  transition_in: "scale_up"
  transition_out: "none"
  transition_duration: "300"            # milisegundos
  transition_easing: "ease_in_out_quad"
  open_sound: "minecraft:ui.toast.in"   # vacío = sin sonido
  open_sound_volume: "1.0"
  open_sound_pitch: "1.0"
  close_sound: ""
  close_sound_volume: "0.5"

elements:
  - id: "mi-elemento"
    type: IMAGE
    x: 0
    y: 0
    width: 200
    height: 200
    properties:
      texture: "eventui:textures/ui/fondo.png"

screen_properties disponibles

PropiedadTipoDescripción
pause_game"true" / "false"Si la pantalla pausa el juego al abrirse.
blurtrue / falseBlur del mundo de fondo. Sin comillas.
transition_inStringAnimación de entrada: scale_up, slide_left, slide_right, fade, none.
transition_outStringAnimación de salida. Mismos valores.
transition_duration"300"Duración de la transición en milisegundos.
transition_easingStringlinear, ease_in, ease_out, ease_in_out, ease_in_out_quad.
open_soundStringSonido al abrir la pantalla. Vacío = sin sonido.
open_sound_volume"1.0"Volumen de apertura (0.0 – 2.0).
open_sound_pitch"1.0"Tono de apertura.
close_soundStringSonido al cerrar.
close_sound_volume"0.5"Volumen de cierre.

Campos comunes de todos los elementos

CampoObligatorioDescripción
id✅ SíIdentificador único dentro del archivo.
type✅ SíTipo en mayúsculas: IMAGE, IMAGE_BUTTON, BUTTON, TEXT, PROGRESS_BAR, ENTITY_RENDER, TOOLTIP, ITEM_RENDER, BLOCK_RENDER, PANEL, ICON.
x✅ SíPosición X. Con anchor activo funciona como offset adicional.
y✅ SíPosición Y.
widthNoAncho. Default: 100.
heightNoAlto. Default: 20.
z_indexNoOrden de capas — mayor = encima. Default: 0.
visibleNoVisibilidad estática. Default: true.
propertiesVaríaPropiedades específicas del tipo.
childrenNoElementos hijos: tooltips, sub-botones, renders de entidades.

Sistema de anclas

Con anchor en properties, el elemento se posiciona relativo a un punto de la pantalla. Los campos x e y pasan a ser offsets desde ese punto, y anchor_offset_x / anchor_offset_y dan un desplazamiento adicional.

Ejemplo con anchor
- id: "btn-volver"
  type: IMAGE_BUTTON
  x: 0
  y: 0
  width: 65
  height: 65
  properties:
    anchor: "bottom_center"
    anchor_offset_x: 0
    anchor_offset_y: -50      # 50px hacia arriba desde el borde inferior
    texture: "eventui:textures/ui/logo/logo.png"
    action: "open:main-menu"
ValorPosición
top_leftEsquina superior izquierda
top_centerCentro superior
top_rightEsquina superior derecha
center_leftCentro izquierdo
centerCentro de la pantalla
center_rightCentro derecho
bottom_leftEsquina inferior izquierda
bottom_centerCentro inferior
bottom_rightEsquina inferior derecha

Visibilidad condicional — visible_if

Muestra u oculta un elemento según el valor de una variable de estado del servidor. Perfecto para mostrar contenido bloqueado o desbloqueado según el progreso del jugador.

Ejemplo — carta bloqueada vs desbloqueada
# Solo visible si zombie_card_unlocked NO es "true"
- id: "carta-bloqueada"
  type: IMAGE_BUTTON
  x: 0
  y: 0
  width: 250
  height: 250
  properties:
    anchor: "center_left"
    anchor_offset_x: 0
    anchor_offset_y: -125
    visible_if: "zombie_card_unlocked != true"
    texture: "eventui:textures/ui/widgets/tarjeta_bloqueada.png"
    hover_animation: "zoom_in"
    hover_animation_intensity: "1.03"
    hover_hitbox: "texture_alpha"
    action: ""

# Solo visible si zombie_card_unlocked ES "true"
- id: "carta-desbloqueada"
  type: IMAGE_BUTTON
  x: 0
  y: 0
  width: 250
  height: 250
  properties:
    anchor: "center_left"
    anchor_offset_x: 0
    anchor_offset_y: -125
    visible_if: "zombie_card_unlocked == true"
    texture: "eventui:textures/ui/widgets/tarjeta_desbloqueada.png"
    hover_animation: "zoom_in"
    hover_animation_intensity: "1.03"
    hover_hitbox: "texture_alpha"
    action: ""
  children:
    - id: "render-zombie"
      type: ENTITY_RENDER
      x: 100
      y: 100
      width: 50
      height: 50
      properties:
        entity: "minecraft:zombie"
        scale: "35"
        rotation_mode: "spin"
        spin_speed: "0.5"
        y_offset: "0"

Las variables se establecen desde el servidor con /eventui setuivar <jugador> <clave> <valor>. Los operadores disponibles son ==, != y = (igualdad simple).

Tipos de elementos

Para la referencia completa de propiedades de cada tipo de elemento, ver Tipos de UI.

IMAGE

- id: "fondo"
  type: IMAGE
  x: 0
  y: 0
  width: 500
  height: 350
  properties:
    texture: "eventui:textures/ui/fondo.png"

IMAGE_BUTTON

- id: "btn-iniciar"
  type: IMAGE_BUTTON
  x: 100
  y: 200
  width: 120
  height: 40
  properties:
    texture: "eventui:textures/ui/btn.png"
    hover_texture: "eventui:textures/ui/btn_hover.png"
    action: "start_event:mision"

BUTTON

- id: "btn-cerrar"
  type: BUTTON
  x: 150
  y: 260
  width: 100
  height: 22
  properties:
    text: "§7← Cerrar"
    action: "close"

TEXT

- id: "titulo"
  type: TEXT
  x: 50
  y: 50
  width: 300
  height: 20
  properties:
    content: "§eMi Título"
    align: "center"
    shadow: "true"

PROGRESS_BAR

- id: "barra"
  type: PROGRESS_BAR
  x: 68
  y: 190
  width: 128
  height: 8
  properties:
    event_id: "matar-zombies"
    objective_id: "kill-zombies"
    color: "5cb85c"

PANEL

- id: "panel"
  type: PANEL
  x: 50
  y: 100
  width: 200
  height: 80
  properties:
    color: "1a1a1a"
    alpha: "180"

ICON

- id: "icono"
  type: ICON
  x: 100
  y: 50
  width: 16
  height: 16
  properties:
    item: "minecraft:diamond"

TOOLTIP

children:
  - id: "tooltip"
    type: TOOLTIP
    x: 0
    y: 0
    width: 0
    height: 0
    properties:
      render_type: "standard"
      content: "§eInformación\n§7Descripción aquí"

ENTITY_RENDER

- id: "render-zombie"
  type: ENTITY_RENDER
  x: 100
  y: 100
  width: 50
  height: 50
  properties:
    entity: "minecraft:zombie"
    scale: "35"
    rotation_mode: "spin"
Demo: Entity spin rotation
Entity spin demo
La entidad rota continuamente en modo spin

ITEM_RENDER

- id: "render-espada"
  type: ITEM_RENDER
  x: 120
  y: 80
  width: 32
  height: 32
  properties:
    item: "minecraft:diamond_sword"
    scale: "2.0"

BLOCK_RENDER

- id: "render-bloque"
  type: BLOCK_RENDER
  x: 150
  y: 100
  width: 48
  height: 48
  properties:
    block: "minecraft:diamond_block"
    scale: "1.5"

SKILL_TREE

- id: "skill-tree-ui"
  type: SKILL_TREE
  x: 0
  y: 0
  width: 500
  height: 350
  properties:
    skill_tree_id: "combate"
    point_type: "combat_points"

Acciones de botones

Los elementos BUTTON e IMAGE_BUTTON ejecutan una acción al hacer clic:

AcciónDescripción
open:<id>Abre otra pantalla por su id. Agrega la actual a la pila de navegación.
closeCierra la pantalla actual.
backVuelve a la pantalla anterior en la pila de navegación.
start_event:<id>Inicia el evento indicado en el servidor.
abandon_event:<id>Abandona el evento. Pide confirmación si no es repetible.
none o vacíoSin acción — el botón es decorativo.