这个数据包添加了 2 种新弓,并允许在弓上使用快速充能!
弓
短弓
短弓是一种充能速度快但威力较小且精度较低的弓。在充能短弓时,玩家仍然可以冲刺,但速度会降低。它由 3 根木棍和 1 根线合成。

长弓
长弓是一种强力弓,具有高伤害、射程更远且更精准的特点,但充能时间更长。它由 3 根木棍、3 根线和 2 个铁粒合成。

附魔
快速充能
快速充能现在适用于弓了!然而,与普通快速充能不同,弓每级仅获得 11% 的充能时间减少量,而不是 25%。
力量
力量现在使远程伤害在第 1 级增加 50%,并在第 1 级之上每级增加 25%,以确保短弓和长弓都保持在预期的伤害范围内。这不会影响普通弓的伤害。
其他特性
弓的声音
弓在开始充能和完全充能时现在有声音效果。
修改后的箭矢伤害
箭矢无视伤害冷却(无敌帧),使得充能时间极短的弓仍能造成伤害,而无需担心伤害冷却问题。
自定义弓
此数据包允许通过向任何 minecraft:bow 物品的 minecraft:custom_data 组件添加一些数据来创建具有自定义属性的自定义弓。
示例自定义数据组件
{
"minecraft:custom_data": {
"ve": {
"components": {
"bow": {
"damage": 2,
"uncertainty": 1,
"power": 3,
"max_charge_time": 20,
"dynamic_animation": true,
"inherit_motion": true,
"inherit_motion_scale": 1,
"mob": {
"power_scale": 0.75,
"uncertainty_scale": 1,
"crit": false
},
"commands": {
"on_start_charging": "tellraw @a \"started charging!\"",
"on_charging": "tellraw @a \"charging!\"",
"on_fully_charged": "tellraw @a \"fully charged!\"",
"on_fired": "tellraw @a \"I shot a shot bow!\"",
"on_projectile_spawned": "tellraw @a \"arrow fired!\"",
"on_hit_event": "tellraw @a \"hit event!\"",
"on_hit_block": "tellraw @a \"hit a block!\""
}
}
}
}
}
}
配置
基本配置
基本的弓配置选项。此处可以省略任何值。
damage: 从该弓射出的箭的基础伤害。默认为 2.0
uncertainty: 弓的最大不精确度,以度为单位。默认为 1.0
power: 完全充能射击的速度,以每刻方块数为单位。默认为 3.0
max_charge_time: 弓完全充能所需的时间,以刻为单位。默认为 20。如果最大充能时间低于此值,该值将默认为最小值 3。
dynamic_animation: 弓是否应根据其充能时间动态播放拉弓动画。默认为 true。需要特定的物品模型配置才能正常工作。
inherit_motion: 由该弓射出的箭是否应继承射手的运动。默认为 true。
inherit_motion_scale: 如果 inherit_motion 设置为 true,则在将其应用到射出的箭之前缩放射手的运动。默认为 true。
生物特定配置
这些选项控制生物如何射击弓。请注意,生物不受弓的最大充能时间的影响,它们将始终以原版速率射击。
power_scale: 当生物射击时缩放弓的 power 值。默认为 0.55。
uncertainty_scale: 当生物射击时缩放弓的 uncertainty 值。默认为 2.0。
crit: 持有此弓的生物射出的箭是否为暴击箭。默认为 false。
命令
所有通过此自定义组件运行的命令都可以访问存储在存储 dynamicbows:temp bow 中的弓的数据,除了 on_hit_event 和 on_hit_block,在这种情况下,数据存储在箭实体数据下的 data.ve.shot_data 中。
谓词 dynamicbows:fully_charged 可用于玩家和箭,以检测其弓是否已完全充能。
on_start_charging: 玩家首次充能该弓时每刻运行的命令。
on_charging: 玩家充能该弓时每刻运行的命令。
on_fully_charged: 玩家将该弓充能到 max_charge_time 字段指定的时间时运行的命令。
on_fired: 在发射弓的实体上运行的命令。
on_projectile_spawned: 弓发射时,在由该弓射出的箭上运行的命令。
on_hit_event: 当弓射出的箭击中实体时运行的命令。在受害者实体上执行。
on_hit_block: 当弓射出的箭击中方块时运行的命令。在箭实体上执行。
命中事件特定功能
在 on_hit_event 函数标签中运行的命令可以访问额外的谓词,这些谓词允许选择所有涉及的实体。
dynamicbows:hit_event/is_arrow: 测试实体是否是命中期间使用的箭。
dynamicbows:hit_event/is_attacker: 测试实体是否是命中期间射击弓的实体。
dynamicbows:hit_event/is_victim: 测试实体是否是使用弓攻击其他实体的受害者。如果受害者在攻击中被杀死,则无法通过目标选择器选择受害者,因此如果在受害者身上运行任何命令,且受害者被杀死,则必须使用 @s 选择器。
dynamicbows:hit_event/victim_killed: 测试受害者在命中期间是否被杀死。
函数标签
自定义弓配置中的每个命令字段都对应一个相应的函数标签,可以在数据包中加以利用。这些函数标签总是在弓专属命令之后运行,并且无论使用何种弓都会执行。此外还包含了一些不具备弓专属事件的额外标签。在这些函数标签中的任意一个中,都可以通过运行 dynamicbows:bow/get_current_bow_data 函数来获取弓数据,该函数会将当前蓄力弓的数据输出到 dynamicbows:temp bow 存储中;但 on_hit_event 和 on_hit_block 除外,在这两种情况下,数据会存储在箭实体数据的 data.ve.shot_data 和 weapon 下。
on_start_charging: 在玩家首次开始给弓蓄力的那一刻运行的函数。
on_charging: 在玩家持续给弓蓄力的每一刻运行的函数。
on_fully_charged: 当玩家将弓充能至 max_charge_time 字段所指定的时间时运行的函数。
on_fired: 在射出弓的实体上运行的函数。
on_projectile_spawned: 在弓发射出的箭矢上运行的函数。
on_hit_event: 当弓射出的箭击中实体时运行的函数。作为受害者实体执行并作用于该实体。所有命中事件相关的功能均适用于此标签。
on_hit_block: 当弓射出的箭击中方块时运行的函数。在箭实体处执行。
modifies_charge_time: 修改最大充能时间的函数。这些函数应修改正在为弓蓄力的玩家的 dynamicbows.bow.charge_time.max 分数。
on_reset: 当弓停止蓄力 或 被射出时运行的函数。
使用动态动画
如果弓启用了动态动画,则必须通过 custom_model_data 专门设置物品模型以支持动态动画。建议还将 hand_animation_swap 设置为 false,以防止在切换帧时物品产生晃动。与原版弓类似,需要 4 个独立的模型:3 个用于各个蓄力阶段,1 个用于基础物品。
示例模型
{
"model": {
"type": "minecraft:select",
"property": "minecraft:custom_model_data",
"index": 0,
"cases": [
{
"when": "0",
"model": {
"type": "minecraft:model",
"model": "minecraft:item/bow_pulling_0"
}
},
{
"when": "1",
"model": {
"type": "minecraft:model",
"model": "minecraft:item/bow_pulling_1"
}
},
{
"when": "2",
"model": {
"type": "minecraft:model",
"model": "minecraft:item/bow_pulling_2"
}
}
],
"fallback": {
"type": "minecraft:condition",
"on_false": {
"type": "minecraft:model",
"model": "minecraft:item/bow"
},
"on_true": {
"type": "minecraft:range_dispatch",
"entries": [
{
"model": {
"type": "minecraft:model",
"model": "minecraft:item/bow_pulling_0"
},
"threshold": 0.1
},
{
"model": {
"type": "minecraft:model",
"model": "minecraft:item/bow_pulling_1"
},
"threshold": 0.65
},
{
"model": {
"type": "minecraft:model",
"model": "minecraft:item/bow_pulling_2"
},
"threshold": 0.9
}
],
"fallback": {
"type": "minecraft:model",
"model": "minecraft:item/bow"
},
"property": "minecraft:use_duration",
"scale": 0.05
},
"property": "minecraft:using_item"
}
},
"hand_animation_on_swap": false
}
This datapack adds 2 new bows and allows quick charge to be used on a bow!
Bows
Shortbow
The Shortbow is a fast charging but weaker and less accurate bow. While charging a Shortbow, players can still sprint but at a reduced speed. It is crafted with 3 sticks and 1 string.

Longbow
The Longbow is a powerful bow which deals high damage, shoots further, and is more accurate, but takes longer to charge. It is crafted with 3 sticks, 3 string, and 2 iron nuggets.

Enchantments
Quick Charge
Quick Charge now applies to bows! However, unlike normal Quick Charge, bows only gain a 11% charge time reduction per level instead of 25%.
Power
Power now increases ranged damage by 50% at level 1, and 25% for each level above 1 to ensure that both the Shortbow and Longbow stay within their intended damage ranges. This does not affect normal bow damage.
Other Features
Bow Sounds
Bows now have sounds when beginning to charge them and when fully charging them.
Modified Arrow Damage
Arrows bypass damage cooldown (immunity frames), allowing bows with very small charge times to still deal damage without needing to worry about damage cooldown.
Custom Bows
This datapack allows the creation of custom bows with custom stats by adding some data to the minecraft:custom_data component of any minecraft:bow item.
Example custom data component
{
"minecraft:custom_data": {
"ve": {
"components": {
"bow": {
"damage": 2,
"uncertainty": 1,
"power": 3,
"max_charge_time": 20,
"dynamic_animation": true,
"inherit_motion": true,
"inherit_motion_scale": 1,
"mob": {
"power_scale": 0.75,
"uncertainty_scale": 1,
"crit": false
},
"commands": {
"on_start_charging": "tellraw @a \"started charging!\"",
"on_charging": "tellraw @a \"charging!\"",
"on_fully_charged": "tellraw @a \"fully charged!\"",
"on_fired": "tellraw @a \"I shot a shot bow!\"",
"on_projectile_spawned": "tellraw @a \"arrow fired!\"",
"on_hit_event": "tellraw @a \"hit event!\"",
"on_hit_block": "tellraw @a \"hit a block!\""
}
}
}
}
}
}
Configuration
Basic Config
Basic bow configuration options. Any value here can be omitted.
damage: The base damage of the arrows fired from this bow. Defaults to 2.0
uncertainty: The maximum inaccuracy of the bow, in degrees. Defaults to 1.0
power: The velocity of fully charged shots, in blocks per tick. Defaults to 3.0
max_charge_time: The amount of time it takes for the bow to fully charge, in ticks. Defaults to 20. This value will default to a minimum of 3 if maximum charge time is below this value.
dynamic_animation: If the bow should dynamically play its draw animation based on its charge time. Defaults to true. Requires a specific item model configuration to work correctly.
inherit_motion: If arrows shot by this bow should inherit the motion of the shooter. Defaults to true.
inherit_motion_scale: Scales the motion of the shooter before applying it to shot arrows, if inherit_motion is set to true. Defaults to true.
Mob-Specific Config
These options control how mobs shoot the bow. Note that mobs are unaffected by the bow's max charge time, they will always fire at their vanilla rates.
power_scale: Scales the power value of the bow when shot by a mob. Defaults to 0.55.
uncertainty_scale: Scales the uncertainty value of the bow when shot by a mob. Defaults to 2.0.
crit: Whether or not arrows shot by mobs wielding this bow should be critical arrows. Defaults to false.
Commands
All commands run through this custom component have access to the bow's data, stored in the storage dynamicbows:temp bow, with the exception of on_hit_event and on_hit_block in which case it is stored in the arrow entity data under data.ve.shot_data.
The predicate dynamicbows:fully_charged can be used on players and arrows to detect if their bow is fully charged.
on_start_charging: Command to run on the first tick this bow is charged by a player.
on_charging: Command to run each tick the bow is charged by a player.
on_fully_charged: Command to run when the bow has been charged to the time specified in the max_charge_time field by a player.
on_fired: Command to run on the entity that fired the bow.
on_projectile_spawned : Command to run on arrows shot by the bow when it is fired.
on_hit_event: Command to run when an arrow from the bow hits an entity. Executes as and at the victim entity.
on_hit_block: Command to run when an arrow from the bow hits a block. Executes at the arrow entity.
Hit Event-Specific Functionality
Commands run in the on_hit_event function tag have access to extra predicates which allow for selection of all involved entities.
dynamicbows:hit_event/is_arrow: Tests if an entity is the arrow that was used during a hit.
dynamicbows:hit_event/is_attacker: Tests if an entity is the entity that shot the bow during a hit.
dynamicbows:hit_event/is_victim: Tests if an entity is the victim of an attack from another entity using the bow. The victim cannot be selected by a target selector if it was killed in the attack, so any commands run on the victim must use the @s selector if they were killed.
dynamicbows:hit_event/victim_killed: Tests if the victim was killed during a hit.
Function Tags
Each command field in custom bow configuration also has respective function tag, which can be taken advantage of in datapacks. These function tags always runs after bow-specific commands, and run regardless of the bow being used. Some extra tags are also included which do not have bow-specific events. Bow data can be retrieved in any of these function tags by running the dynamicbows:bow/get_current_bow_data function, which outputs the currently charged bow's data to the dynamicbows:temp bow storage, with the exception of on_hit_event and on_hit_block in which case it is stored in the arrow entity data under data.ve.shot_data and weapon.
on_start_charging: Functions to run on the first tick this bow is charged by a player.
on_charging: Functions to run each tick the bow is charged by a player.
on_fully_charged: Functions to run when the bow has been charged to the time specified in the max_charge_time field by a player.
on_fired: Functions to run on the entity that fired the bow.
on_projectile_spawned : Functions to run on arrows shot by the bow when it is fired.
on_hit_event: Functions to run when an arrow from the bow hits an entity. Executes as and at the victim entity. All hit event specific functionality applies to this tag.
on_hit_block: Functions to run when an arrow from the bow hits a block. Executes at the arrow entity.
modifies_charge_time: Functions that modify maximum charge time. These functions should modify the dynamicbows.bow.charge_time.max score of the player charging the bow.
on_reset: Functions to run when a bow has stopped charging or has been shot.
Using Dynamic Animations
Item models must be set up specifically to support dynamic animations if they are enabled on the bow, using custom_model_data. It is also suggested to set hand_animation_swap to false to prevent the item from bobbing when changing frames. Like the vanilla bow, 4 separate models are needed, 1 for each charging stage (3 total) and 1 for the base item.
Example Model
{
"model": {
"type": "minecraft:select",
"property": "minecraft:custom_model_data",
"index": 0,
"cases": [
{
"when": "0",
"model": {
"type": "minecraft:model",
"model": "minecraft:item/bow_pulling_0"
}
},
{
"when": "1",
"model": {
"type": "minecraft:model",
"model": "minecraft:item/bow_pulling_1"
}
},
{
"when": "2",
"model": {
"type": "minecraft:model",
"model": "minecraft:item/bow_pulling_2"
}
}
],
"fallback": {
"type": "minecraft:condition",
"on_false": {
"type": "minecraft:model",
"model": "minecraft:item/bow"
},
"on_true": {
"type": "minecraft:range_dispatch",
"entries": [
{
"model": {
"type": "minecraft:model",
"model": "minecraft:item/bow_pulling_0"
},
"threshold": 0.1
},
{
"model": {
"type": "minecraft:model",
"model": "minecraft:item/bow_pulling_1"
},
"threshold": 0.65
},
{
"model": {
"type": "minecraft:model",
"model": "minecraft:item/bow_pulling_2"
},
"threshold": 0.9
}
],
"fallback": {
"type": "minecraft:model",
"model": "minecraft:item/bow"
},
"property": "minecraft:use_duration",
"scale": 0.05
},
"property": "minecraft:using_item"
}
},
"hand_animation_on_swap": false
}
评论 0
登录后参与评分
还没有评论,来抢沙发吧