哎呀!
受够了猜测你攻击的实体到底受到了多少伤害?或者,也许你只是想让战斗看起来更华丽一些?
那么这个模组就是为你准备的!
Ouch! 是一款基于 Polymer 开发的 Fabric(以及 Quilt)服务端模组,它会在实体受到伤害、死亡或治疗(默认情况下仅显示伤害和治疗效果)后触发数字/文本粒子特效。该模组完全可配置,允许根据检测伤害类型、受害者(受伤实体)、来源(攻击者或投射物)和攻击者的谓词条件,自定义文本(颜色和显示方式)、大小、移动方式以及可见时间。它还支持为同一次伤害显示具有不同设置的多个粒子,从而带来额外的趣味消息等效果。

配置文件。
本模组的配置文件存储于 ./config/ouch.json。
预设选择配置。
默认情况下,配置采用预设选择格式,允许你选择模组内置的默认样式/外观。
{
"preset": "default"
}
可用的预设:default、minimal
完整配置。
此配置允许你更改任何文本及其行为。可用于高级配置。
预设使用的默认值可在以下位置找到:
其中所有的自定义文本均使用 QuickText 格式。
所有使用的谓词均由 Predicate API 提供,使用该格式。
以 // 开头的行并非真实配置的一部分,此处仅用于解释说明。
{
// 伤害的所有显示值。
"damage": [
// 顶层数组定义了将在其中查找文本/设置的列表。
// 每个包含的数组中仅使用单个定义。它们从上到下匹配。
[
// 文本/显示定义。
{
// [可选] 按类型匹配伤害,可以是单个条目("minecraft:generic")、
// 标签("#minecraft:is_fire")或条目列表(["minecraft:mob_attack", "minecraft:player_attack"])。
// 默认(未设置)时,匹配所有内容。
"type": "...",
// [可选] 检查受害者(受伤实体)的谓词。
// 默认情况下,始终成功。
"victim": {
"type": "..."
},
// [可选] 检查攻击者(攻击实体的实体)的谓词。
// 默认情况下,始终成功。
"attacker": {
"type": "..."
},
// [可选] 检查来源(投射物或攻击者)的谓词。
// 默认情况下,始终成功。
"source": {
"type": "..."
},
// [可选] 显示此内容所需的最小伤害量。
// 默认情况下,未设置。
"min_value": 0,
// [可选] 显示此内容所允许的最大伤害量。
// 默认情况下,未设置。
"max_value": 999999,
// [可选] 一个从 0 到 1(含)的浮点数,描述选中此消息的概率。
// 1 表示如果其他属性匹配则总是选中,
// 0.5 为 50%,0 则为从不。
// 默认情况下,设置为 1。
"chance": 1,
// [可选] 设置粒子每刻乘以的速度值。
// 它需要是一个介于 0 和 1 之间的数字。
// 默认值:0.7
"per_tick_velocity_multiplier": 0.7,
// [可选] 设置粒子受影响的(向下)重力值。
// 它需要是一个介于 -1 和 1 之间的数字。
// 默认值:0.05
"gravity": 0.05,
// [可选] 设置粒子可见的时间(以刻为单位,20 刻为一秒)。
// 它需要是一个大于 0 的数字。
// 默认值:20
"staying_time": 20,
// [可选] 设置粒子的缩放/大小。
// 它需要是一个介于 0 和 5 之间的数字。
// 默认值:0.8
"text_scale": 0.8,
// [可选] 用静态速度覆盖计算出的速度。
// 默认值:未设置 / 使用计算出的值。
"velocity_override": [0, 2, 0],
// 用于伤害粒子的文本。包含占位符:
// ${value} - 显示保留一位小数的四舍五入伤害值。
// ${value_rounded} - 显示四舍五入到整数的伤害值。
// ${value_raw} - 显示原始伤害值。
"text": "<red>-${value}"
}
]
],
// 死亡文本的所有显示值。
"death": [
// 顶层数组定义了将在其中查找文本/设置的列表。
// 每个包含的数组中仅使用单个定义。它们从上到下匹配。
[
// 文本/显示定义。
{
// [可选] 按类型匹配伤害,可以是单个条目("minecraft:generic")、
// 标签("#minecraft:is_fire")或条目列表(["minecraft:mob_attack", "minecraft:player_attack"])。
// 默认(未设置)时,匹配所有内容。
"type": "...",
// [可选] 检查受害者(受伤实体)的谓词。
// 默认情况下,始终成功。
"victim": {
"type": "..."
},
// [可选] 检查攻击者(攻击实体的实体)的谓词。
// 默认情况下,始终成功。
"attacker": {
"type": "..."
},
// [可选] 检查来源(投射物或攻击者)的谓词。
// 默认情况下,始终成功。
"source": {
"type": "..."
},
// [可选] 显示此内容所需的最小治疗量。
// 默认情况下,未设置。
"min_value": 0,
// [可选] 显示此内容所允许的最大治疗量。
// 默认情况下,未设置。
"max_value": 999999,
// [可选] 一个从 0 到 1(含)的浮点数,描述选中此消息的概率。
// 1 表示如果其他属性匹配则总是选中,
// 0.5 为 50%,0 则为从不。
// 默认情况下,设置为 1。
"chance": 1,
// [可选] 设置粒子每刻乘以的速度值。
// 它需要是一个介于 0 和 1 之间的数字。
// 默认值:0.7
"per_tick_velocity_multiplier": 0.7,
// [可选] 设置粒子受影响的(向下)重力值。
// 它需要是一个介于 -1 和 1 之间的数字。
// 默认值:0.05
"gravity": 0.05,
// [可选] 设置粒子可见的时间(以刻为单位,20 刻为一秒)。
// 它需要是一个大于 0 的数字。
// 默认值:20
// [可选] 设置粒子的缩放/大小。
// 该值必须是 0 到 5 之间的数字。
// 默认值:0.8
"text_scale": 0.8,
// [可选] 使用静态速度覆盖计算出的速度。
// 默认值:未设置 / 使用计算出的速度。
"velocity_override": [0, 2, 0],
// 用于伤害粒子的文本。包含占位符:
// ${message} - 使用的死亡消息。
// ${victim} - 受害者的名称。
// ${attacker} - 攻击者的名称。
"text": "<red>${message}"
}
]
],
// 治疗的所有显示值。
"healing": [
// 顶层数组定义了在哪些列表中可以找到文本/设置。
// 每个包含的数组中仅使用单个定义。它们从上到下匹配。
[
// 文本/显示定义。
{
// [可选] 检查被治疗实体的谓词。
// 默认情况下,始终成功。
"entity": {
"type": "..."
},
// [可选] 一个从 0 到 1(含)的浮点数,描述选择此消息的概率。1 表示如果其他属性匹配则总是被选中,
// 0.5 表示 50%,0 表示从不。
// 默认情况下,它设置为 1。
"chance": 1,
// [可选] 设置粒子每秒刻数乘积的速度值。
// 该值必须是 0 到 1 之间的数字。
// 默认值:0.7
"per_tick_velocity_multiplier": 0.7,
// [可选] 设置粒子受影响的(向下)重力值。
// 该值必须是 -1 到 1 之间的数字。
// 默认值:0.05
"gravity": 0.05,
// [可选] 设置粒子可见的时间(以刻为单位,20 刻为一秒)。
// 该值必须是大于 0 的数字。
// 默认值:20
"staying_time": 20,
// [可选] 设置粒子的缩放/大小。
// 该值必须是 0 到 5 之间的数字。
// 默认值:0.8
"text_scale": 0.8,
// [可选] 使用静态速度覆盖计算出的速度。
// 默认值:未设置 / 使用计算出的速度。
"velocity_override": [0, 2, 0],
// 用于治疗粒子的文本。包含占位符:
// ${value} - 显示保留一位小数的四舍五入治疗量。
// ${value_rounded} - 显示四舍五入为整数的治疗量。
// ${value_raw} - 显示原始治疗量数值。
"text": "<green>+${value}"
}
]
]
}
Ouch!
Tired of guessing how much damage entity you attacked took? Or maybe you just wanted to make fights look bit fancier?
Then this mod is for you!
Ouch! is Fabric (and Quilt) server side modification powered by
Polymer which adds number/text particle effect activated after
entity getting damaged, dying or getting healed (by default only damage/healing is visible)! This mod is also
fully configurable allowing to change the text (color and display), size, movement and visibility time, depending
on predicates testing for damage type, victim (damaged entity), source (attacker or projectile) and attacker (attacker).
It can also display multiple particles with different setting for same damage, allowing for extra fun messages and alike.

Configuration.
This mod config file is stored as ./config/ouch.json.
Preset selection config.
By default, config is in a format of preset selection, allowing you to choose default style/look that's built into the mod.
{
"preset": "default"
}
Available presets: default, minimal
Full config.
This config allows you to change any text and it's behaviour. Can be used for advanced configuration.
Default values used by presets can be found here:
All custom text within it uses the QuickText format.
All predicates use are supplied by Predicate API, using this format.
Lines prefixed with // aren't part of real config and are here just to explain it.
{
// All display values for damage.
"damage": [
// Top layer array defines lists in which text/settings will be found.
// Only single definition from each included array is used. They are matched from top to bottom.
[
// Text/Display definition.
{
// [Optional] Matches damage by type, being either a single entry ("minecraft:generic")
// a tag ("#minecraft:is_fire") or list of entries (["minecraft:mob_attack", "minecraft:player_attack"])
// By default (not set), it matches everything.
"type": "...",
// [Optional] Predicate checking for victim (damaged entity).
// By default, always succeeds.
"victim": {
"type": "..."
},
// [Optional] Predicate checking for attacker (entity which attacked entity).
// By default, always succeeds.
"attacker": {
"type": "..."
},
// [Optional] Predicate checking for source (projectile or attacker).
// By default, always succeeds.
"source": {
"type": "..."
},
// [Optional] A minimal amount of damage required for this to display.
// By default, not set.
"min_value": 0,
// [Optional] A maximal amount of damage allowed for this to display.
// By default, not set.
"max_value": 999999,
// [Optional] A floating point number from 0 to 1 (inclusive) describing change
// this message is selected. 1 means it's always selected if other properties match,
// 0.5 is 50% and 0 is never.
// By default, it's set to 1.
"chance": 1,
// [Optional] Sets value velocity of particle is multiplied by every tick.
// It needs to be a number between 0 and 1
// Default value: 0.7
"per_tick_velocity_multiplier": 0.7,
// [Optional] Sets value of (downwards) gravity particle is effected by.
// It needs to be a number between -1 and 1
// Default value: 0.05
"gravity": 0.05,
// [Optional] Sets the time (in ticks, 20 ticks is a second), the particle is
// visible for. It needs to be a number larger than 0.
// Default value: 20
"staying_time": 20,
// [Optional] Sets the scale/size of the particle.
// It needs to be a number between 0 and 5
// Default value: 0.8
"text_scale": 0.8,
// [Optional] Overrides calculated velocity with a static one.
// Default value: not set / uses calculated one.
"velocity_override": [0, 2, 0],
// Text used for damage particle. Has placeholders:
// ${value} - shows rounded damage with 1 number as decimal part.
// ${value_rounded} - shows rounded damage rounded to integer.
// ${value_raw} - shows raw damage value.
"text": "<red>-${value}"
}
]
],
// All display values for death text.
"death": [
// Top layer array defines lists in which text/settings will be found.
// Only single definition from each included array is used. They are matched from top to bottom.
[
// Text/Display definition.
{
// [Optional] Matches damage by type, being either a single entry ("minecraft:generic")
// a tag ("#minecraft:is_fire") or list of entries (["minecraft:mob_attack", "minecraft:player_attack"])
// By default (not set), it matches everything.
"type": "...",
// [Optional] Predicate checking for victim (damaged entity).
// By default, always succeeds.
"victim": {
"type": "..."
},
// [Optional] Predicate checking for attacker (entity which attacked entity).
// By default, always succeeds.
"attacker": {
"type": "..."
},
// [Optional] Predicate checking for source (projectile or attacker).
// By default, always succeeds.
"source": {
"type": "..."
},
// [Optional] A minimal amount of healing required for this to display.
// By default, not set.
"min_value": 0,
// [Optional] A maximal amount of healing allowed for this to display.
// By default, not set.
"max_value": 999999,
// [Optional] A floating point number from 0 to 1 (inclusive) describing change
// this message is selected. 1 means it's always selected if other properties match,
// 0.5 is 50% and 0 is never.
// By default, it's set to 1.
"chance": 1,
// [Optional] Sets value velocity of particle is multiplied by every tick.
// It needs to be a number between 0 and 1
// Default value: 0.7
"per_tick_velocity_multiplier": 0.7,
// [Optional] Sets value of (downwards) gravity particle is effected by.
// It needs to be a number between -1 and 1
// Default value: 0.05
"gravity": 0.05,
// [Optional] Sets the time (in ticks, 20 ticks is a second), the particle is
// visible for. It needs to be a number larger than 0.
// Default value: 20
"staying_time": 20,
// [Optional] Sets the scale/size of the particle.
// It needs to be a number between 0 and 5
// Default value: 0.8
"text_scale": 0.8,
// [Optional] Overrides calculated velocity with a static one.
// Default value: not set / uses calculated one.
"velocity_override": [0, 2, 0],
// Text used for damage particle. Has placeholders:
// ${message} - death message used.
// ${victim} - name of the victim.
// ${attacker} - name of the attacker.
"text": "<red>${message}"
}
]
],
// All display values for healing.
"healing": [
// Top layer array defines lists in which text/settings will be found.
// Only single definition from each included array is used. They are matched from top to bottom.
[
// Text/Display definition.
{
// [Optional] Predicate checking for healed entity.
// By default, always succeeds.
"entity": {
"type": "..."
},
// [Optional] A floating point number from 0 to 1 (inclusive) describing change
// this message is selected. 1 means it's always selected if other properties match,
// 0.5 is 50% and 0 is never.
// By default, it's set to 1.
"chance": 1,
// [Optional] Sets value velocity of particle is multiplied by every tick.
// It needs to be a number between 0 and 1
// Default value: 0.7
"per_tick_velocity_multiplier": 0.7,
// [Optional] Sets value of (downwards) gravity particle is effected by.
// It needs to be a number between -1 and 1
// Default value: 0.05
"gravity": 0.05,
// [Optional] Sets the time (in ticks, 20 ticks is a second), the particle is
// visible for. It needs to be a number larger than 0.
// Default value: 20
"staying_time": 20,
// [Optional] Sets the scale/size of the particle.
// It needs to be a number between 0 and 5
// Default value: 0.8
"text_scale": 0.8,
// [Optional] Overrides calculated velocity with a static one.
// Default value: not set / uses calculated one.
"velocity_override": [0, 2, 0],
// Text used for healing particle. Has placeholders:
// ${value} - shows rounded healing amount with 1 number as decimal part.
// ${value_rounded} - shows healing amount rounded to integer.
// ${value_raw} - shows raw healing amount value.
"text": "<green>+${value}"
}
]
]
}
评论 0
登录后参与评分
还没有评论,来抢沙发吧