CombatEdit
一个服务端 Fabric 模组,将 1.8 风格的战斗机制带回现代版本的 Minecraft!此外还可配置所有实体和物品的默认属性以及物品默认组件。
要求
此模组无需客户端安装,也不依赖 Fabric API(所需的 Fabric API 模块已随模组打包),但若要通过图形界面配置属性,则需要 Mod Menu 来打开配置屏幕。
功能
本模组的默认设置恢复了 1.8 风格的战斗。此外(自 2.1 版本起),以下选项可通过选项屏幕或配置文件进行配置(详见 Configuration):
- 生物实体的默认 实体属性(最大生命值、攻击伤害、攻击速度、移动速度等)
- 所有物品类型的默认 物品属性修饰符(额外攻击伤害、攻击速度等)
- 所有物品类型的默认 物品组件(耐久度、不可破坏性、附魔等)
- 应启用或禁用的攻击音效
- 是否启用 1.8 风格的击退效果
请注意,虽然在游戏世界中更改物品和实体的默认值是可行的,且我已尽力使其尽可能无缝衔接,但仍可能导致意外行为及(可能较小的)Bug。
配置
CombatEdit 使用不同的概念来进行自身配置:
设置文件
这是玩家配置模组的主要方式。在设置文件中进行的配置优先于基础配置文件和配置扩展文件的配置,并且设置文件决定了使用哪个基础配置。对于用户而言,主要配置设置的方式是通过 ModMenu 在模组列表中访问的 GUI 屏幕(选中 CombatEdit 后点击齿轮按钮)。设置文件保存在相对于 minecraft/server 目录的 config/combatedit/settings.json 中。
要在服务器上配置这些选项,你可以在客户端上使用配置屏幕创建并保存你的配置,然后将配置文件(位于 config/combatedit/settings.json)上传到服务器目录中的相同位置。
基础配置
基础配置决定了实体和物品属性的主要配置。CombatEdit 包含两个基础配置:
- 1.8 战斗配置 (
combatedit:1_8_combat),默认启用,将实体和物品属性值设置为类似于现代版 1.8 战斗的样子(使用与基岩版相同的伤害值) - 原版配置 (
combatedit:vanilla),保留默认的实体和物品属性不变。
数据包创作者可以提供自己的基础配置(见 Datapacks)以创建不同的基础配置。
配置扩展
配置扩展允许调整基础配置的参数(例如添加额外的物品修饰符或覆盖基础配置中设置的其它参数)。它们旨在为希望为基础配置提供不同物品或实体设置的模组开发者服务(例如,为了平衡起见,通过自定义物品上的攻击冷却缺失来调整 1.8 战斗配置下的伤害值)。更多信息请参阅 Mod Developers。
数据包
基础配置和配置扩展均可包含在数据包中。以下目录树描述了放置基础配置和配置扩展文件的位置。
data: 你数据包内的数据目录<your_namespace>: 你的自定义数据包命名空间combatedit: 所有 CombatEdit 相关的数据包文件都 reside 于此profile_extensions: 包含配置扩展。<profile_namespace><profile_name>: 包含.json配置扩展文件,用于扩展基础配置<profile_namespace>:<profile_name>
base_profiles: 包含基础配置的.json文件。在此处创建的名为<your_profile>.json的文件将创建一个 ID 为<your_namespace>:<your_profile>的基础配置。
模组开发者
模组开发者可以像数据包创作者一样以 JSON 格式包含基础配置,只需按照上述数据包的相同目录结构将文件放入其 data 资源目录中。此外,还可以通过编程方式提供配置扩展:只需创建一个实现 CombatEditInitListener 接口 的类,并在你的 fabric.mod.json 中将此实现指定为名称为 combatedit 的新入口点。
JSON 格式规范
本节解释了各种配置类型的 JSON 格式。可在 examples 目录中找到用于创建基础配置和配置扩展的示例数据包。
基础配置
JSON 格式的基础配置是一个包含以下键的 JSON 对象:
name: 你的基础配置的显示名称。可以是文本组件或简单字符串。description: 你的基础配置的描述。可以是文本组件或简单字符串。configuration: 此基础配置的功能配置。参见 Feature configuration。
配置扩展
JSON 格式的配置扩展是一个包含以下键的 JSON 对象:
priority: 一个整数,指定此配置扩展的优先级。如果多个配置扩展之间的覆盖发生冲突,更高的优先级值将使该配置扩展拥有优先权。configuration_overrides: 一个功能配置,指定此扩展所做的覆盖。参见 Feature configuration。
功能配置
功能配置格式在基础配置文件、配置文件扩展和设置文件中通用。它包含以下键:
configuration_version:一个整数,指定功能配置的版本,如果格式发生破坏性更改,该值可能会改变。当前配置版本为3。entity_attributes:实体属性 对象数组,用于指定特定实体类型的默认属性。item_attributes:物品属性 对象数组,用于指定物品的默认属性修改器。item_components:物品组件 对象数组,用于指定物品的默认组件。enabled_sounds:一个声音 ID 与布尔值的映射对,用于指定这些声音是否启用。目前可配置的声音如下:minecraft:entity.player.attack.nodamageminecraft:entity.player.attack.knockbackminecraft:entity.player.attack.weakminecraft:entity.player.attack.strongminecraft:entity.player.attack.sweepminecraft:entity.player.attack.crit
misc_options:一个配置 杂项选项 的对象。
实体属性
实体属性条目具有以下结构:
entity_id:要修改的实体类型的标识符base_values:属性基础值对象数组,其包含以下键:attribute:要更改值的属性的标识符base_value:用于指定属性的基础值
override_default:布尔选项。如果设置为true,则在应用此实体属性条目中指定的更改之前,移除实体的默认属性。
物品属性
物品属性条目具有以下结构:
item_id:要修改的物品的标识符modifiers:属性修改器对象数组,其结构如下:attribute:要添加修改器的属性modifier_id:属性修改器的唯一标识符。可选,如果未指定,则使用随机标识符value:修改器的值operation:修改器的操作类型。可以是以下之一:"add_value":将此修改器的值添加到实体的属性基础值中"add_multiplied_base":将属性的基础值乘以指定值,并将结果加到总属性值中"add_multiplied_total":将基础值与所有类型为"add_multiplied_base"的修改器之和相乘,并将结果加到总属性值中
slot:物品必须处于的位置才能使修改器生效。可以是以下之一:"any":在所有槽位中生效"mainhand":当物品在主手中持有时生效"offhand":当物品在主副手中持有时生效"hand":当物品在任何手中持有时生效"feet":当物品装备在靴子槽位时生效"legs":当物品装备在护腿槽位时生效"chest":当物品装备在胸甲槽位时生效"head":当物品装备在头盔槽位时生效"armor":当物品在任何护甲槽位(玩家或动物)装备时生效"body":当物品在动物身上装备时生效"saddle":当物品在马的鞍槽位装备时生效
override_default:布尔选项。如果设置为true,则在应用此条目指定的更改之前,移除物品的默认属性修改器。
物品组件
物品组件条目具有以下结构:
item_id:要修改其组件的物品的标识符changes:要进行的组件更改数组,其结构如下:component_type:要更改值的组件类型的标识符change_type:此条目要进行的更改,可以是:"set":如果要为此组件类型设置新值"remove":如果要从此物品中完全移除此组件的默认值
value:要为此组件设置的值。如果组件类型没有值或更改类型为"remove",则为可选。
杂项选项
enable_1_8_knockback:一个布尔值,指定是否启用 1.8 版本的击退效果,而不是现代 Minecraft 版本中的默认击退效果。disable_sweeping_without_enchantment:一个布尔值,指定如果使用的物品没有横扫之刃附魔,是否禁用横扫效果。
CombatEdit
A server-side Fabric mod that brings back 1.8-style combat to modern versions of Minecraft! Can additionally configure default attributes for all entities and items and default item components.
Requirements
This mod does not require client-side installation or the Fabric API (necessary Fabric API modules are bundled with the mod), however, to configure attributes with a GUI, Mod Menu is required to open the configuration screen.
Features
The default settings of this mod bring back 1.8-style combat. Additionally (since version 2.1), the following options are configurable either via the options screen or the configuration file (see Configuration):
- Default entity attributes for living entities (max health, attack damage, attack speed, movement speed, ...)
- Default item attribute modifiers for all item types (additional attack damage, attack speed, ...)
- Default item components for all item types (durability, unbreakability, enchantments, ...)
- Which attack sounds should be enabled or disabled
- Whether 1.8-style knockback should be enabled
Please note that although changing item and entity defaults while in a world is possible and I've tried my best to make it work as seamlessly as possible, it could potentially still lead to unexpected behaviour and (probably smaller) bugs.
Configuration
CombatEdit uses different concepts for configuring itself:
Settings file
This is the main way for players to configure the mod. Configurations made in the settings file take precedence over the
base profile and profile extension configurations, and the settings file determines which base profile is to be used.
For users, the main way to configure the settings is using the GUI screen accessible via ModMenu in the Mods list (by
clicking on the gear button once CombatEdit is selected). The settings file is saved in config/combatedit/settings.json
relative to the minecraft/server directory.
To configure these options on a server, you can create and save your configuration on the client using the configuration screen
and then upload the config file (in config/combatedit/settings.json) to the same directory inside the server directory.
Base profiles
Base profiles determine the main configuration for entity and item attributes. CombatEdit includes two base profiles:
- the 1.8 Combat Profile (
combatedit:1_8_combat), which is enabled by default and sets entity and item attributes values to resemble a modern version of 1.8 Combat (using the same damage values as Bedrock Edition) - the Vanilla profile (
combatedit:vanilla), which leaves default entity and item attributes untouched.
Datapack creators can provide their own base profiles (see Datapacks) to create different base configurations.
Profile extensions
Profile extensions allow adjusting the configuration of a base profile (such as adding addition item modifiers or overriding others set in the base profile). They are aimed at mod developers who want to provide different item or entity settings for base profiles (for example by changing damage values for the 1.8 Combat profile on custom items to compensate for the lack of any Attack Cooldown as a balancing measure). See Mod developers for more information.
Datapacks
Both base profiles and profile extension can be included in a datapack. The following directory tree describes where to place base profile and profile extension files.
data: the data directory within your datapack<your_namespace>: Your custom datapack namespacecombatedit: All CombatEdit-related datapack files reside within hereprofile_extensions: Contains profile extensions.<profile_namespace><profile_name>: Contains.jsonprofile extension files extending the base profile<profile_namespace>:<profile_name>
base_profiles: Contains base profile.jsonfiles. A file named<your_profile>.jsoncreated here will create a base profile with the ID<your_namespace>:<your_profile>.
Mod Developers
Mod developers can include base profiles in JSON format just like datapack creators by placing files inside their data
resource directory using the same directory structure as mentioned above for datapacks. Additionally, it is possible to
provide profile extensions programmatically: simply create a class implementing the
CombatEditInitListener interface and specify
this implementation as a new entrypoint with the name combatedit within your fabric.mod.json.
JSON Format specifications
This section explains the JSON formats of the various configuration types. Sample datapacks for base profile and profile extension creation can be found in the examples directory.
Base profiles
A base profile in JSON format is a JSON object containing the following keys:
name: The display name of your base profile. Can be a text component or a simple string.description: The description of your base profile. Can be a text component or a simple string.configuration: The feature configuration for this base profile. See Feature configuration.
Profile extensions
A profile extension in JSON format is a JSON object containing the following keys:
priority: An integer specifying the priority of this profile extension. A greater priority value results in this profile extension having priority over other profile extensions if overrides within them clash with each other.configuration_overrides: A feature configuration specifying the overrides this extension makes. See Feature configuration.
Feature configuration
The feature configuration format is common among base profiles, profile extensions and the settings file. It has the following keys:
configuration_version: An integer specifying the version of the feature configuration, which may change if breaking changes are made to the format. The current configuration version is3.entity_attributes: An array of Entity attribute objects specifying the default attributes for an entity type.item_attributes: An array of Item attribute objects specifying the default attribute modifiers for an item.item_components: An array of Item component objects specifying the default components for an item.enabled_sounds: A map of sound ID to boolean pairs specifying whether those sounds are enabled or not. Currently, the following sounds are configurable:minecraft:entity.player.attack.nodamageminecraft:entity.player.attack.knockbackminecraft:entity.player.attack.weakminecraft:entity.player.attack.strongminecraft:entity.player.attack.sweepminecraft:entity.player.attack.crit
misc_options: An object configuring Miscellaneous options.
Entity attribute
Entity attribute entries have the following structure:
entity_id: The identifier of the entity type to be modifiedbase_values: An array of attribute base value objects, which have the following keys:attribute: The identifier of the attribute whose value is changedbase_value: The base value to use for the specified attribute
override_default: Boolean option. If set totrue, the entity's default attributes are removed before applying the the changes specified in this entity attribute entry
Item attribute
Item attribute entries have the following structure:
item_id: The identifier of the item to be modifiedmodifiers: An array of attribute modifier objects, which have the following structure:attribute: The attribute for which to add a modifiermodifier_id: A unique identifier for the attribute modifier. Optional, if not specified, a random identifier is used insteadvalue: The value for the modifieroperation: Operation type for the modifier. Can be one of the following:"add_value": Adds the value of this modifier to the base value of the attribute for the entity"add_multiplied_base": Multiplies the base value for the attribute by the specified value and adds the result to the total attribute value"add_multiplied_total": Multiplies the sum of the base value and all modifiers of type"add_multiplied_base"and adds the result to the total attribute value
slot: The slot in which the item has to be for the modifier to apply. Can be one of the following:"any": Applies in all slots"mainhand": Applies when the item is held in the main hand"offhand": Applies when the item is held in the off hand"hand": Applies when the item is held in any hand"feet": Applies when the item is equipped in the boots slot"legs": Applies when the item is equipped in the leggings slot"chest": Applies when the item is equipped in the chestplate slot"head": Applies when the item is equipped in the helmet slot"armor": Applies when the item is equipped in any armor slot (on players or animals)"body": Applies when the item is equipped on an animal"saddle": Applies when the item is equipped on a horse's saddle slot
override_default: Boolean option. If set totrue, the item's default attribute modifiers are removed before applying the changes specified by this entry
Item component
Item component entries have the following structure:
item_id: The identifier of the item whose components are to be modifiedchanges: An array of component changes to be made, which have the following structure:component_type: The identifier of the component type for which to change the valuechange_type: The change to be made by this entry, which is either:"set"if a new value for this component type is to be set"remove"if the default value for this component is to be removed from the item entirely
value: The value to set for this component. Is optional if the component type does not have values or the change type is"remove"
Miscellaneous options
enable_1_8_knockback: A boolean specifying whether 1.8 knockback should be enabled instead of the default knockback in modern Minecraft versions.disable_sweeping_without_enchantment: A boolean specifying whether sweeping effects should be disabled if the used item does not have a sweeping enchantment.
下载 CombatEdit
下载 CombatEdit
下载 CombatEdit
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 CombatEdit
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 CombatEdit
下载 CombatEdit
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 CombatEdit
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 CombatEdit
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 CombatEdit
下载 CombatEdit
2.2.0 版本新增了类似 1.8 的剑格挡选项,并基于 YetAnotherConfigLib 引入了新的配置界面,旨在修复部分与 Cloth Config 相关的错误。
解决了 #10 。
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
可定制的鞘翅模组,支持装饰纹饰、旗帜图案等更多功能!
模组
让你能够在世界中的任何位置定位结构。
模组
一堆修复
模组
TerraFirmaCraft (TFC) 是一个全面转换模组,对生存模式进行了彻底的改造与重新设计。
模组
所有本应存在的事物
模组
为 Cobblemon 添加 Mega 进化、Z 招式、太晶化、超极巨化/超巨大化、究极爆击与融合!
评论 0
登录后参与评分
还没有评论,来抢沙发吧