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
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
| Propiedad | Tipo | Descripción |
|---|---|---|
pause_game | "true" / "false" | Si la pantalla pausa el juego al abrirse. |
blur | true / false | Blur del mundo de fondo. Sin comillas. |
transition_in | String | Animación de entrada: scale_up, slide_left, slide_right, fade, none. |
transition_out | String | Animación de salida. Mismos valores. |
transition_duration | "300" | Duración de la transición en milisegundos. |
transition_easing | String | linear, ease_in, ease_out, ease_in_out, ease_in_out_quad. |
open_sound | String | Sonido 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_sound | String | Sonido al cerrar. |
close_sound_volume | "0.5" | Volumen de cierre. |
Campos comunes de todos los elementos
| Campo | Obligatorio | Descripció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. |
width | No | Ancho. Default: 100. |
height | No | Alto. Default: 20. |
z_index | No | Orden de capas — mayor = encima. Default: 0. |
visible | No | Visibilidad estática. Default: true. |
properties | Varía | Propiedades específicas del tipo. |
children | No | Elementos 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.
- 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"
| Valor | Posición |
|---|---|
top_left | Esquina superior izquierda |
top_center | Centro superior |
top_right | Esquina superior derecha |
center_left | Centro izquierdo |
center | Centro de la pantalla |
center_right | Centro derecho |
bottom_left | Esquina inferior izquierda |
bottom_center | Centro inferior |
bottom_right | Esquina 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.
# 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 !=.
Tipos de elementos
IMAGE
Imagen estática para fondos, títulos y decoraciones.
- id: "titulo"
type: IMAGE
x: 0
y: 0
width: 500
height: 100
properties:
anchor: "top_center"
anchor_offset_x: 0
anchor_offset_y: 75
texture: "eventui:textures/ui/titles/mi_titulo.png"
IMAGE_BUTTON
El elemento más completo. Botón con textura personalizada, ícono, animación hover, sonidos, hitbox preciso y texturas de estado por evento.
- id: "mi-boton"
type: IMAGE_BUTTON
x: 0
y: 0
width: 100
height: 100
properties:
anchor: "center"
anchor_offset_x: -100
anchor_offset_y: -125
# Texturas
texture: "eventui:textures/ui/books/blue_book.png"
hover_texture: "eventui:textures/ui/books/hovers/blue_book_hover.png"
in_progress_texture: "eventui:textures/ui/widgets/icon_in_progress.png"
completed_texture: "eventui:textures/ui/widgets/icon_completed.png"
# Ícono de ítem encima de la textura
icon: "minecraft:diamond"
icon_scale: "0.7" # escala del ícono (default: "1")
# Animación de hover
hover_animation: "zoom_in"
hover_animation_intensity: "1.15"
# Sonidos
hover_sound: "minecraft:ui.toast.in"
hover_sound_volume: "1.8"
hover_sound_pitch: "1.3"
click_sound: "minecraft:item.book.page_turn"
click_sound_volume: "1.0"
click_sound_pitch: "1.0"
# Hitbox del hover
hover_hitbox: "texture_alpha" # "box" (default) | "texture_alpha"
# Visibilidad condicional
visible_if: "mi_variable == true"
# Acción al clic
action: "open:otra-pantalla"
| Propiedad | Descripción |
|---|---|
texture | Textura base. |
hover_texture | Textura al pasar el cursor. Opcional. |
in_progress_texture | Textura cuando el evento vinculado está en progreso. |
completed_texture | Textura cuando el evento está completado. |
icon | ResourceLocation del ítem renderizado encima. |
icon_scale | Escala del ícono. "1" = normal, "0.7" = 70%. |
hover_animation | Animación al hacer hover. Ver referencia de animaciones. |
hover_animation_intensity | Intensidad de la animación. |
hover_sound | Sonido al pasar el cursor. Vacío = sin sonido. |
hover_sound_volume | Volumen hover (0.0 – 2.0). |
hover_sound_pitch | Tono hover. |
click_sound | Sonido al clic. Vacío = sonido por defecto del sistema. |
click_sound_volume | Volumen clic. |
click_sound_pitch | Tono clic. |
hover_hitbox | "box": rectángulo completo (default). "texture_alpha": solo píxeles opacos — ideal para formas irregulares. |
visible_if | Condición de visibilidad. Operadores: == y !=. |
action | Acción al clic. Ver tabla de acciones abajo. |
BUTTON
Botón de texto estilo vanilla.
- id: "btn-cerrar"
type: BUTTON
x: 150
y: 260
width: 100
height: 22
properties:
text: "§7← Cerrar"
action: "close"
TEXT
Texto con colores, alineación y sombra.
- id: "nombre"
type: TEXT
x: 110
y: 50
width: 0
height: 0
properties:
content: "§6Zombie"
shadow: true
align: "center" # left | center | right
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"
background_color: "2a2a2a"
ENTITY_RENDER
Renderiza una entidad viva en 3D. Compatible con entidades de mods.
- id: "render-zombie"
type: ENTITY_RENDER
x: 100
y: 100
width: 50
height: 50
properties:
entity: "minecraft:zombie" # mods: "modid:nombre_entidad"
scale: "35"
rotation_mode: "spin" # spin | fixed | follow_mouse
spin_speed: "0.5"
y_offset: "0"
TOOLTIP
Siempre como hijo (children) de otro elemento. Se muestra al pasar el cursor sobre el padre.
children:
- id: "tooltip-libro"
type: TOOLTIP
x: 0
y: 0
width: 0
height: 0
properties:
render_type: "standard"
content: "§1Árbol Tecnológico\n§7Consulta las recetas disponibles"
shadow: "true"
children:
- id: "tooltip-mision"
type: TOOLTIP
x: 0
y: 0
width: 0
height: 0
properties:
render_type: "text"
content: "Consigue un casco de diamante."
shadow: "true"
children:
- id: "tooltip-receta"
type: TOOLTIP
x: 0
y: 0
width: 0
height: 0
properties:
render_type: "advanced"
content: |
recipe: minecraft:diamond_chestplate [frame:eventui:textures/ui/widgets/crafting_frame.png]
advanced con receta es recipe: namespace:id [frame:ruta_textura]. El parámetro frame es opcional y define la textura del marco del crafteo.| render_type | Descripción |
|---|---|
standard | Fondo estilo vanilla. Soporta \n y códigos §. |
text | Texto flotante sin fondo. Soporta shadow y saltos de línea. |
advanced | Tooltip enriquecido con recetas, ítems, entidades, imágenes y separadores. |
Acciones de botones
| Acción | Descripción |
|---|---|
open:<id> | Abre otra pantalla. Ejemplo: open:main-menu |
close | Cierra la pantalla actual. |
back | Vuelve a la pantalla anterior en la pila de navegación. |
start_event:<id> | Inicia el evento indicado. |
abandon_event:<id> | Abandona el evento. Pide confirmación si no es repetible. |
none o vacío | Sin acción — botón decorativo. |
Sonidos
Todos los sonidos usan ResourceLocation estándar. Puedes usar sonidos de vanilla o de tu resource pack:
# Vanilla
"minecraft:ui.toast.in"
"minecraft:ui.button.click"
"minecraft:item.book.page_turn"
# Resource pack personalizado
"eventui:ui.hover"
"eventui:ui.click"
"") para desactivarlo. Si omites el campo por completo, los botones usarán el sonido de clic por defecto del sistema.Data binding
Los textos soportan variables dinámicas con la sintaxis {variable}:
# Variable de estado del servidor (establecida con /eventui setuivar)
content: "Puntos: {state.puntos_totales}"
# Progreso de un objetivo
content: "Zombies: {event.matar-zombies.kill-zombies.current}/{event.matar-zombies.kill-zombies.target}"
F3 + Shift con la pantalla abierta para ver posiciones, dimensiones e IDs de todos los elementos. Esencial para ajustar layouts con anclas.