Compatibility
Minecraft: Java Edition
1.20.5–1.20.6
Platforms
Supported environments
Creators
Details
Licensed Apache-2.0
Published 2 months ago
Updated 2 days ago
Changelog
In this preview version the weapon item behaviour was expanded significantly, with some changes to entity behaviour on top of it.
Changes
Entities
- Mobs that don't have a base attack damage of 1 will now deal less damage when using weapons.
- The only exception to this currently is for Piglins, Piglin Brutes and Zombified Piglins when they use one of the following items as a weapon:
- Golden Axe
- Golden Hoe
- Golden Pickaxe
- Golden Shovel
- Golden Sword
- The only exception to this currently is for Piglins, Piglin Brutes and Zombified Piglins when they use one of the following items as a weapon:
Item Behaviour Components
minecraft:weapon
- Made changes to the
attack_damagefield:- It now uses rules instead of a hard amount, similar to the mining speed rules in
minecraft:tool.- Format:
default_damage: A non-negative double. The default damage to deal to an entity. This value is absolute and thus consistent for all weapon users, unless specified so by the rules.rules: A list of weapon rules. See the weapon rules section below for more information.
- Its value for a specific item stack may be overwritten with the new
minecraft:weapon_attack_damagedata component.
- Format:
- It now uses rules instead of a hard amount, similar to the mining speed rules in
- Made changes to the
attack_speedfield:- It is now a multiplier instead of a relative amount.
- Format: A non-negative double.
- Its value for a specific item stack may be overwritten with the new
minecraft:attack_speed_multiplierdata component.
- Its value for a specific item stack may be overwritten with the new
- Note that while it can be set to 0, this does not prevent a Player from using the weapon altogether, just from loading the weapon to its full power. To prevent attacking, use an attack damage of 0 instead.
- Both of these fields are now taken into account separately and are no longer attribute modifiers.
An example based on the minecraft:golden_sword item that sets the damage to 0 when the durability is 1:
{
"minecraft:weapon": {
"attack_damage": {
"default_damage": 4.0,
"rules": [
{
"add_base": false,
"damage": 0.0,
"item": {
"predicates": {
"minecraft:damage": {
"durability": 1
}
}
}
},
{
"add_base": true,
"damage": 3.0,
"entities": "#minecraft:proficient_with_golden_weapons"
}
]
},
"attack_speed": 0.4
}
}
Data Components
- Added the following data components:
minecraft:attack_speed_multiplierminecraft:weapon_attack_damage
minecraft:attack_speed_multiplier
- Specified and used by the
minecraft:weaponbehaviour component. - If removed, a multiplier of 1 will be used instead.
- Its value is a non-negative double.
minecraft:weapon_attack_damage
- Specified and used by the
minecraft:weaponbehaviour component. - If removed, the base attack damage from its user will be used instead.
- Its value is the same as the
attack_damagefield from theminecraft:weaponbehaviour component.
Example:
{
"default_damage": 4.0,
"rules": [
{
"add_base": true,
"damage": 3.0,
"entities": "#minecraft:proficient_with_golden_weapons"
}
]
}
Weapon Rules
A weapon rule dictates what damage amount should be used and whether it should add the entity's base attack damage on top of the weapon's damage or not.
Fields
entities: An optional entity type, list of entity types or hash-prefixed entity type tag. When specified, has to be used by the entity types specified in order for the rule to be used.item: An optional item predicate. When specified, the item stack has to match the predicate in order for the rule to be used.damage: An optional non-negative double. When specified, will be used as the weapon's damage instead of the default amount.add_base: An optional boolean. When specified, determines whether to add its user's baseminecraft:generic.attack_damageattribute value to the weapon's damage.
Example
{
"add_base": true,
"damage": 3.0,
"entities": "#minecraft:proficient_with_golden_weapons"
}
Dependencies
Files
Metadata
Release channel
BetaVersion number
0.2.0-preview.3Loaders
Game versions
1.20.5–1.20.6Downloads
4Publication date
December 5, 2025 at 6:10 PMPublisher
ErrorCraft
Member


