ConditionsMod
ConditionsMod 是一款 Minecraft 模组,允许你使用简单的 YAML 文件创建完全可自定义的事件,而无需编写代码。
它灵感来源于 ConditionalEvents,但构建目标更为明确:为现代模组服务器提供一个更清晰、更快、更轻量且更灵活的事件系统。ConditionsMod 保留了熟悉的事件-条件-动作工作流,同时提升了配置体验、运行时性能和可扩展性。
该项目针对 Forge 和 Fabric 端口进行设计,具体取决于 Minecraft 版本。
工作原理
ConditionsMod 遵循一个简单的流程:
事件 -> 条件 -> 动作
事件:检测游戏中发生的某事。
条件:检查是否满足要求。
动作:如果条件通过,则执行结果。
这使得你可以在不创建独立模组或编写 Java 代码的情况下,构建自定义的服务器行为。
YAML 配置
事件通过 .yml 文件进行配置。
服务端: conditions/
客户端: config/conditions/
示例:
events:
- name: welcome
type: player_join
enabled: true
conditions: []
actions:
default:
- "message: &a欢迎, %player%!"
ConditionalEvents 兼容性
ConditionsMod 支持基于 ConditionalEvents 风格的配置,因此服务器管理员可以迁移许多现有设置,而无需重写所有内容。
支持的兼容性功能包括:
Events: 根部分。
- 原生
events: 列表格式。
- 文本条件,例如
%main_command% == /hello。
- 带有
execute 的条件动作分支。
- 使用
and 和 or 的组合条件。
- 动作组,如
default、cooldown、one_time 以及自定义组。
- 定向动作,如
to_all、to_target、to_world、to_player 和 to_range。
- 常用变量,如
%player%、%main_command%、%args_length%、%arg_1%、%block%、%playerblock_inside%、%playerblock_below_1%、%playerblock_above_1%、%random_1_10%、%random_last%、%world_time%、冷却变量以及 SVR 变量。
使用 ConditionalEvents 风格布局的示例:
Events:
command_example:
type: player_command
conditions:
- "%main_command% == /announce"
- "%args_length% == 0 execute error"
actions:
default:
- "to_all: centered_message: &c&lAnnouncement"
- "to_all: message: &e%player%&7: %args_substring_1-100%"
error:
- "message: &cUse /announce <message>"
ConditionsMod 的改进
ConditionsMod 旨在超越传统的 ConditionalEvents 方法:
- 采用 YAML 优先的配置方式,更易阅读和维护。
- 轻量级运行时,专注于仅检查所需内容。
- 通过名称快速查找事件,用于调用、启用/禁用命令以及调试工具。
- 按类型对事件进行分组,减少不必要的检查。
- 缓存正则表达式条件,提升重复条件判断的性能。
- 支持并发运行时状态,用于处理冷却时间和一次性事件追踪。
- 更简洁的插件 API,支持自定义操作、占位符、变量和自定义事件。
- 提供客户端功能,这是传统仅限服务器的插件无法实现的,例如 HUD、摄像机、按键屏蔽和按键组合。
- 更精简的核心,避免在不需要时加载大型插件式系统。
事件类型
ConditionsMod 包含以下事件类型:
- 玩家加入、离开、死亡、击杀、聊天、命令、重生、传送、受伤、潜行、跳跃、物品栏、统计、饥饿度、空气值等。
- 方块破坏、放置和交互。
- 物品交互、消耗、拾取、丢弃、合成、附魔、修复、移动和选择。
- 实体交互和生成。
- 服务器启动、停止、周期性服务器检查、自定义事件和调用事件。
- 客户端功能,如 HUD 显示、摄像机、按键和按键组合事件。
条件
条件支持常用运算符:
==, !=, equals, !equals
equalsIgnoreCase, !equalsIgnoreCase
contains, !contains
startsWith, !startsWith
endsWith, !endsWith
matches, !matches
>, >=, <, <=
示例:
conditions:
- "%player_world% == overworld"
- "%main_command% equalsIgnoreCase /spawn"
- "%args_length% == 0 execute no_args"
- "%block% matches (?i)(minecraft:)?stone_button"
操作
可用操作包括:
message(消息)
centered_message(居中消息)
broadcast(广播)
title(标题)
actionbar(动作栏)
console_command(控制台命令)
player_command(玩家命令)
kick(踢出)
cancel_event(取消事件)
give_item(给予物品)
remove_item(移除物品)
give_potion_effect(给予药水效果)
remove_potion_effect(移除药水效果)
heal(治疗)
damage(伤害)
set_food_level(设置饥饿度)
set_on_fire(点燃)
gamemode(游戏模式)
playsound(播放声音)
particle(粒子效果)
lightning_strike(闪电打击)
set_block(设置方块)
summon(召唤)
teleport(传送)
set_cooldown(设置冷却时间)
call_event(调用事件)
wait(等待)
to_all(发送给所有人)
to_target(发送给目标)
to_world(发送给整个世界)
to_player(发送给玩家)
to_range(发送给范围内)
特色功能
摄像机
摄像机事件可以更改玩家的摄像机模式或视角,从而实现诸如 2D 视图、RPG 风格视图和自定义摄像机位置等效果。
HUD
HUD 事件可以在屏幕上显示自定义文本,支持位置、缩放、背景、持续时间和动画设置。
按键与按键组合
按键事件可以通过配置屏蔽或控制特定的按键、鼠标按钮或按键组合。
SVR 变量
SVR 提供持久化的服务器变量,用于存储全局值、玩家值和列表,数据存储在 YAML 文件中。
自定义事件
其他模组可以向 ConditionsMod 触发自定义事件,使配置文件能够响应外部模组的逻辑。
项目状态
ConditionsMod 正在积极开发中。兼容性层将继续扩展,增加更多 ConditionalEvents 风格的变量、操作和等效事件。
目标不是做一个简单的克隆。目标是保留简便的事件配置风格,同时提供更高的性能、更清晰的架构、更强的模组集成能力,以及传统纯服务端插件无法实现的功能。
ConditionsMod 西班牙语版
ConditionsMod 是一款 Minecraft 模组,允许你使用 YAML 文件创建完全自定义的事件,无需编程。
它灵感来源于 ConditionalEvents,但旨在更进一步:为现代模组服务器提供一个更简洁、快速、轻量且灵活的解决方案。它保留了“事件-条件-动作”这一易于理解的核心理念,但在组织性、性能表现以及扩展可能性上进行了优化提升。
该项目计划根据 Minecraft 的版本提供 Forge 和 Fabric 平台的移植版本。
工作原理
ConditionsMod 采用以下流程:
事件 -> 条件 -> 动作
事件:检测游戏中发生的特定情况。
条件:检查是否满足执行动作的要求。
动作:当条件满足时,执行相应的响应。
借助这种方式,你可以构建完整的系统,而无需开发其他模组或编写 Java 代码。
YAML 配置
事件通过 .yml 文件进行配置。
服务端: conditions/
客户端: config/conditions/
示例:
events:
- name: welcome
type: player_join
enabled: true
conditions: []
actions:
default:
- "message: &a欢迎, %player%!"
与 ConditionalEvents 的兼容性
ConditionsMod 支持 ConditionalEvents 风格的配置格式,使用户能够迁移大量配置而无需从零开始重写。
包含的兼容性:
- 根节点
Events:。
- 原生
events: 格式。
- 文本条件,如
%main_command% == /hello。
- 带有
execute 的条件分支。
- 使用
and 和 or 组合而成的复合条件。
- 动作组,如
default、cooldown、one_time 以及自定义组。
- 目标动作,如
to_all、to_target、to_world、to_player 和 to_range。
- 常用变量,如
%player%、%main_command%、%args_length%、%arg_1%、%block%、%playerblock_inside%、%playerblock_below_1%、%playerblock_above_1%、%random_1_10%、%random_last%、%world_time%、冷却变量和 SVR 变量。
采用 ConditionalEvents 风格格式的示例:
Events:
comando_anuncio:
type: player_command
conditions:
- "%main_command% == /anuncio"
- "%args_length% == 0 execute error"
actions:
default:
- "to_all: centered_message: &c&lAnuncio"
- "to_all: message: &e%player%&7: %args_substring_1-100%"
error:
- "message: &cUsa /anuncio <mensaje>"
ConditionsMod 的改进之处
ConditionsMod 旨在提升体验,相较于传统的 ConditionalEvents 方法:
- 更清晰、更易编辑的 YAML 配置。
- 更轻量化的系统,旨在仅运行所需功能。
- 支持通过名称快速搜索事件,用于
call_event、启用/禁用命令及调试。
- 按类型分组事件,以减少不必要的检查。
- 缓存正则表达式,以优化重复条件判断。
- 使用并发运行时状态处理冷却时间和一次性事件。
- 为插件、自定义操作、占位符、变量和自定义事件提供更简洁的 API。
- 提供服务器端插件无法实现的客户端功能,如 HUD、摄像机视角、按键锁定及按键组合。
- 核心更加精简,避免加载不需要的庞大系统。
事件类型
ConditionsMod 包含以下事件:
- 玩家:加入、离开、死亡、击杀、聊天、命令、重生、传送、受伤、潜行、跳跃、物品栏、统计、饥饿、氧气等。
- 方块:破坏、放置和交互。
- 物品:交互、消耗、拾取、丢弃、合成、附魔、修复、移动和选择。
- 实体:交互和生成。
- 服务器:启动、关闭、周期性服务器事件、自定义事件和调用事件。
- 客户端:HUD、摄像机、按键和按键组合。
条件
条件支持常用运算符:
==, !=, equals, !equals
equalsIgnoreCase, !equalsIgnoreCase
contains, !contains
startsWith, !startsWith
endsWith, !endsWith
matches, !matches
>, >=, <, <=
示例:
conditions:
- "%player_world% == overworld"
- "%main_command% equalsIgnoreCase /spawn"
- "%args_length% == 0 execute sin_argumentos"
- "%block% matches (?i)(minecraft:)?stone_button"
动作
可用动作包括:
message(消息)
centered_message(居中消息)
broadcast(广播)
title(标题)
actionbar(操作栏)
console_command(控制台命令)
player_command(玩家命令)
kick(踢出)
cancel_event(取消事件)
give_item(给予物品)
remove_item(移除物品)
give_potion_effect(给予药水效果)
remove_potion_effect(移除药水效果)
heal(治疗)
damage(伤害)
set_food_level(设置饥饿值)
set_on_fire(点燃)
gamemode(切换游戏模式)
playsound(播放音效)
particle(粒子效果)
lightning_strike(闪电劈击)
set_block(设置方块)
summon(召唤)
teleport(传送)
set_cooldown(设置冷却时间)
call_event(调用事件)
wait(等待)
to_all(发送给所有人)
to_target(发送给目标)
to_world(发送给全服)
to_player(发送给指定玩家)
to_range(发送给范围内玩家)
特殊功能
摄像机
摄像机事件允许更改玩家的视图或视角,例如 2D 视角、RPG 视角或自定义位置。
HUD
HUD 事件允许在屏幕上显示文本,支持设置位置、缩放、背景、持续时间和动画效果。
按键与按键组合
按键事件允许从配置中锁定或控制键盘按键、鼠标按钮或完整的按键组合。
SVR 变量
SVR 允许使用 YAML 保存全局持久化变量、玩家专属变量以及列表数据。
自定义事件
其他模组可以向 ConditionsMod 触发自定义事件,以便配置文件能够响应外部系统的行为。
项目状态
ConditionsMod 正在积极开发中。对 ConditionalEvents 的兼容性将持续增强,将增加更多的变量、动作和等效事件。
我们的目标不是做一个简单的复制品。目标是保留无需编程即可轻松创建事件的便利性,同时拥有更好的性能、更清晰的代码结构、与模组更好的集成,以及传统纯服务端插件无法实现的功能。
ConditionsMod
ConditionsMod is a Minecraft mod that lets you create fully customizable events using simple YAML files, without writing code.
It is inspired by ConditionalEvents, but it is built with a stronger goal: to provide a cleaner, faster, lighter, and more flexible event system for modern modded servers. ConditionsMod keeps the familiar event-condition-action workflow while improving the configuration experience, runtime performance, and extensibility.
The project is designed for Forge and Fabric ports, depending on the Minecraft version.
How It Works
ConditionsMod follows a simple flow:
Event -> Conditions -> Actions
Event: detects something happening in the game.
Conditions: checks whether requirements are met.
Actions: runs the result if the conditions pass.
This lets you build custom server behavior without creating a separate mod or writing Java code.
YAML Configuration
Events are configured with .yml files.
Server: conditions/
Client: config/conditions/
Example:
events:
- name: welcome
type: player_join
enabled: true
conditions: []
actions:
default:
- "message: &aWelcome, %player%!"
ConditionalEvents Compatibility
ConditionsMod supports ConditionalEvents-style configuration so server owners can migrate many existing setups without rewriting everything.
Supported compatibility features include:
Events: root section.
- Native
events: list format.
- Text conditions such as
%main_command% == /hello.
- Conditional action branches with
execute.
- Compound conditions with
and and or.
- Action groups such as
default, cooldown, one_time, and custom groups.
- Targeted actions such as
to_all, to_target, to_world, to_player, and to_range.
- Common variables such as
%player%, %main_command%, %args_length%, %arg_1%, %block%, %playerblock_inside%, %playerblock_below_1%, %playerblock_above_1%, %random_1_10%, %random_last%, %world_time%, cooldown variables, and SVR variables.
Example using ConditionalEvents-style layout:
Events:
command_example:
type: player_command
conditions:
- "%main_command% == /announce"
- "%args_length% == 0 execute error"
actions:
default:
- "to_all: centered_message: &c&lAnnouncement"
- "to_all: message: &e%player%&7: %args_substring_1-100%"
error:
- "message: &cUse /announce <message>"
What ConditionsMod Improves
ConditionsMod is made to go beyond the traditional ConditionalEvents approach:
- YAML-first configuration that is easier to read and maintain.
- Lightweight runtime focused on checking only what is needed.
- Fast event lookup by name for calls, enable/disable commands, and debug tools.
- Events grouped by type, reducing unnecessary checks.
- Cached regex conditions for better repeated-condition performance.
- Concurrent runtime state for cooldowns and one-time event tracking.
- Cleaner addon API for custom actions, placeholders, variables, and custom events.
- Client-side features that traditional server-only plugins cannot provide, such as HUD, camera, key blocking, and key combos.
- A simpler core that avoids loading large plugin-style systems when they are not needed.
Event Types
ConditionsMod includes event types for:
- Player join, leave, death, kill, chat, command, respawn, teleport, damage, sneak, jump, inventory, stats, food, air, and more.
- Block break, place, and interact.
- Item interact, consume, pickup, drop, craft, enchant, repair, move, and select.
- Entity interact and spawn.
- Server start, stop, repetitive server checks, custom events, and call events.
- Client features such as HUD display, camera, key, and key combo events.
Conditions
Conditions support common operators:
==, !=, equals, !equals
equalsIgnoreCase, !equalsIgnoreCase
contains, !contains
startsWith, !startsWith
endsWith, !endsWith
matches, !matches
>, >=, <, <=
Examples:
conditions:
- "%player_world% == overworld"
- "%main_command% equalsIgnoreCase /spawn"
- "%args_length% == 0 execute no_args"
- "%block% matches (?i)(minecraft:)?stone_button"
Actions
Available actions include:
message
centered_message
broadcast
title
actionbar
console_command
player_command
kick
cancel_event
give_item
remove_item
give_potion_effect
remove_potion_effect
heal
damage
set_food_level
set_on_fire
gamemode
playsound
particle
lightning_strike
set_block
summon
teleport
set_cooldown
call_event
wait
to_all
to_target
to_world
to_player
to_range
Special Features
Camera
Camera events can change the player camera mode or perspective, allowing effects such as 2D views, RPG-style views, and custom camera positions.
HUD
HUD events can display custom on-screen text with position, scale, background, duration, and animations.
Key And Key Combo
Key events can block or control specific keys, mouse buttons, or key combinations through configuration.
SVR Variables
SVR provides persistent server variables for global values, player values, and lists, stored in YAML.
Custom Events
Other mods can fire custom events into ConditionsMod, allowing configs to react to external mod logic.
Project Status
ConditionsMod is in active development. The compatibility layer will continue expanding with more ConditionalEvents-style variables, actions, and event equivalents.
The goal is not to be a simple clone. The goal is to keep the easy event configuration style while delivering better performance, cleaner structure, stronger mod integration, and features that are not possible in a traditional server-only plugin.
ConditionsMod Español
ConditionsMod es un mod de Minecraft que permite crear eventos completamente personalizados usando archivos YAML, sin necesidad de programar.
Está inspirado en ConditionalEvents, pero busca ir más allá: ofrecer un sistema más limpio, rápido, ligero y flexible para servidores modernos con mods. Mantiene la idea fácil de entender de evento-condiciones-acciones, pero con mejor organización, mejor rendimiento y más posibilidades de expansión.
El proyecto está pensado para tener ports en Forge y Fabric según la versión de Minecraft.
Cómo Funciona
ConditionsMod usa este flujo:
Evento -> Condiciones -> Acciones
Evento: detecta algo que ocurre en el juego.
Condiciones: comprueban si se cumplen los requisitos.
Acciones: ejecutan la respuesta cuando las condiciones pasan.
Con esto puedes crear sistemas completos sin hacer otro mod y sin escribir código Java.
Configuración YAML
Los eventos se configuran con archivos .yml.
Servidor: conditions/
Cliente: config/conditions/
Ejemplo:
events:
- name: bienvenida
type: player_join
enabled: true
conditions: []
actions:
default:
- "message: &aBienvenido, %player%!"
Compatibilidad Con ConditionalEvents
ConditionsMod soporta el estilo de configuración de ConditionalEvents para que los usuarios puedan migrar muchas configs sin rehacer todo desde cero.
Compatibilidad incluida:
- Sección raíz
Events:.
- Formato nativo
events:.
- Condiciones de texto como
%main_command% == /hello.
- Ramas condicionales con
execute.
- Condiciones compuestas con
and y or.
- Grupos de acciones como
default, cooldown, one_time y grupos personalizados.
- Acciones dirigidas como
to_all, to_target, to_world, to_player y to_range.
- Variables comunes como
%player%, %main_command%, %args_length%, %arg_1%, %block%, %playerblock_inside%, %playerblock_below_1%, %playerblock_above_1%, %random_1_10%, %random_last%, %world_time%, variables de cooldown y variables SVR.
Ejemplo con formato estilo ConditionalEvents:
Events:
comando_anuncio:
type: player_command
conditions:
- "%main_command% == /anuncio"
- "%args_length% == 0 execute error"
actions:
default:
- "to_all: centered_message: &c&lAnuncio"
- "to_all: message: &e%player%&7: %args_substring_1-100%"
error:
- "message: &cUsa /anuncio <mensaje>"
Qué Mejora ConditionsMod
ConditionsMod está hecho para mejorar la experiencia frente al enfoque clásico de ConditionalEvents:
- Configuración YAML más clara y fácil de editar.
- Sistema más ligero, pensado para ejecutar solo lo necesario.
- Búsqueda rápida de eventos por nombre para
call_event, comandos de enable/disable y debug.
- Eventos agrupados por tipo para reducir comprobaciones innecesarias.
- Regex cacheadas para mejorar condiciones repetidas.
- Estados runtime concurrentes para cooldowns y eventos de una sola vez.
- API más limpia para addons, acciones custom, placeholders, variables y eventos custom.
- Funciones de cliente que un plugin solo de servidor no puede ofrecer, como HUD, cámara, bloqueo de teclas y combinaciones de teclas.
- Núcleo más simple, evitando cargar sistemas grandes cuando no hacen falta.
Tipos De Eventos
ConditionsMod incluye eventos para:
- Jugadores: entrar, salir, morir, matar, chat, comandos, respawn, teleport, daño, sneak, salto, inventario, estadísticas, comida, aire y más.
- Bloques: romper, colocar e interactuar.
- Items: interactuar, consumir, recoger, tirar, craftear, encantar, reparar, mover y seleccionar.
- Entidades: interactuar y spawn.
- Servidor: inicio, apagado, eventos repetitivos de servidor, eventos custom y eventos call.
- Cliente: HUD, cámara, teclas y combinaciones de teclas.
Condiciones
Las condiciones soportan operadores comunes:
==, !=, equals, !equals
equalsIgnoreCase, !equalsIgnoreCase
contains, !contains
startsWith, !startsWith
endsWith, !endsWith
matches, !matches
>, >=, <, <=
Ejemplos:
conditions:
- "%player_world% == overworld"
- "%main_command% equalsIgnoreCase /spawn"
- "%args_length% == 0 execute sin_argumentos"
- "%block% matches (?i)(minecraft:)?stone_button"
Acciones
Acciones disponibles:
message
centered_message
broadcast
title
actionbar
console_command
player_command
kick
cancel_event
give_item
remove_item
give_potion_effect
remove_potion_effect
heal
damage
set_food_level
set_on_fire
gamemode
playsound
particle
lightning_strike
set_block
summon
teleport
set_cooldown
call_event
wait
to_all
to_target
to_world
to_player
to_range
Funciones Especiales
Camera
Los eventos de cámara permiten cambiar la vista o perspectiva del jugador, como cámara 2D, vista RPG o posiciones personalizadas.
HUD
Los eventos HUD permiten mostrar texto en pantalla con posición, escala, fondo, duración y animaciones.
Key Y Key Combo
Los eventos de teclas permiten bloquear o controlar teclas, botones del mouse o combinaciones completas desde configuración.
Variables SVR
SVR permite guardar variables persistentes globales, por jugador y listas, usando YAML.
Eventos Custom
Otros mods pueden disparar eventos custom hacia ConditionsMod para que las configs reaccionen a sistemas externos.
Estado Del Proyecto
ConditionsMod está en desarrollo activo. La compatibilidad con ConditionalEvents seguirá creciendo con más variables, acciones y eventos equivalentes.
La meta no es ser una copia simple. La meta es conservar la facilidad de crear eventos sin programar, pero con mejor rendimiento, estructura más limpia, mejor integración con mods y funciones que no son posibles en un plugin tradicional solo de servidor.
评论 0
登录后参与评分
还没有评论,来抢沙发吧