Potions Please
适用于 Minecraft 1.21.5 的服务端 Fabric 模组,通过注入 POTION_DURATION_SCALE 组件来修改原版药水的持续时间。
药水来源
本模组仅影响通过以下主要来源生成的药水:
- 酿造台酿造
- 村民交易
- 战利品表(set_potion 函数)
- 溅射箭制作
由其他来源创建的药水(例如 /give 命令或创造模式物品栏中的药水)不会修改其持续时间。
这是因为该模组无法从这些来源的物品中注入 POTION_DURATION_SCALE 组件。
配置
首次打开游戏会在 config/potionsplease.json5 生成一个配置文件。通过配置此文件可以调整药水持续时间。
JSON 键名对应 Minecraft 的药水 ID,接下来的 4 个值定义了每种类型的持续时间(单位为 刻)。
- DEFAULT_DURATION -> 药水
- SPLASH_DURATION -> 喷溅药水
- LINGER_DURATION -> 滞留药水
- (原版滞留药水仅施加普通药水 25% 的效果持续时间)
- TIPPED_DURATION -> 溅射箭
- (原版溅射箭仅施加普通药水 12.5% 的效果持续时间)
{
"minecraft:long_strength" : {
"DEFAULT_DURATION" : 9600,
"SPLASH_DURATION" : 9600,
"LINGER_DURATION" : 2400,
"TIPPED_DURATION" : 1200
}
}
上述示例使用了原版长力量药水(Extended strength)的持续时间。在这种情况下,正常饮用药水将为玩家提供 8 分钟的力量效果。
也许这还不够长,我们可以将数值更改为以下内容,使默认药水提供 45 分钟的力量效果。
要计算药水持续时间的刻数,只需遵循以下公式:分钟数 × 60(每秒秒数) × 20(每秒刻数)
{
"minecraft:long_strength" : {
"DEFAULT_DURATION" : 54000, // 45 × 60 × 20 = 45 分钟的刻数
"SPLASH_DURATION" : 18000, // 15 × 60 × 20 = 15 分钟的刻数
"LINGER_DURATION" : 9600, // 8 × 60 × 20 = 8 分钟的刻数
"TIPPED_DURATION" : 3600 // 3 × 60 × 20 = 3 分钟的刻数
}
}
从配置中移除某个药水会禁用该药水的持续时间注入逻辑。
Potions Please
Server-side fabric mod for Minecraft 1.21.5 to alter vanilla potion durations by injecting the POTION_DURATION_SCALE Component.
Potion Sources
This mod only affects potions generated through the following primary sources:
- Brewing
- Villager Trading
- Loot Tables (set_potion function)
- Tipped Arrow crafting
Potions that is created from any other source such as the /give command or the creative inventory do not have the durations modified.
This is because the mod is unable to inject the POTION_DURATION_SCALE Component to the items from those sources.
Configuration
Opening the game for the first time generates a file to config/potionsplease.json5. Configuring this file is used to alter the potion durations.
The JSON keys match minecraft's potion IDs and the next 4 values define the duration in TICKS for each item type.
- DEFAULT_DURATION -> Potion
- SPLASH_DURATION -> Splash Potion
- (Vanilla splash potions have the same duration as regular potions)
- LINGER_DURATION -> Lingering Potion
- (Vanilla lingering potions only apply 25% of the regular potion duration)
- TIPPED_DURATION -> Tipped Arrow
- (Vanilla tipped arrows only apply 12.5% of the regular potion duration)
{
"minecraft:long_strength" : {
"DEFAULT_DURATION" : 9600,
"SPLASH_DURATION" : 9600,
"LINGER_DURATION" : 2400,
"TIPPED_DURATION" : 1200
}
}
The above example uses the vanilla long_strength (Extended strength) potion durations. In this case drinking the potion regularly will grant the player strength for 8 minutes.
Maybe this isn't long enough so we can change the values to following to instead have default potion grant 45 minutes of strength.
To calculate the number of ticks for the potion duration, you can simply follow this equation: MINUTES × 60(seconds in a minute) × 20(ticks per second)
{
"minecraft:long_strength" : {
"DEFAULT_DURATION" : 54000, // 45 × 60 × 20 = 45 minutes in ticks
"SPLASH_DURATION" : 18000, // 15 × 60 × 20 = 15 minutes in ticks
"LINGER_DURATION" : 9600, // 8 × 60 × 20 = 8 minutes in ticks
"TIPPED_DURATION" : 3600 // 3 × 60 × 20 = 3 minutes in ticks
}
}
Removing a potion from the config disables the duration injection logic for that potion.
评论 0
登录后参与评分
还没有评论,来抢沙发吧