LoliColleen
- LoliColleen
- JIRAUSER747827
- Europe/Stockholm
- Yes
- No
Please link
MC-278088to this.Some items do not act synchronously in time after switching items.
Reproduce:
- Prepare 2 different items in hot bar.
- Switch item A to item B.
- Perform the following operations through the item B immediately.
Tested operations:
Attack:Item A: Fire aspect enchanted wooden sword
Item B: Diamond sword without enchantment
- Spawn a villager and give it fire resistance to prevent fire damage changing the result
Hold the wooden sword and wait for 100% chargeSwitch to the diamond sword and attack immediatelyResult:
/data get entity @n[type=minecraft:villager] Health
The villager takes 100% damage of 4 Not meeting expectations
The villager isn't ignited Meet expectations
Item B 's durability decreases Meet expectations
Attack 2:
Item A: Diamond sword without enchantment
Item B: Fire aspect enchanted wooden sword
- Spawn a villager and give it fire resistance to prevent fire damage changing the result
- Hold the diamond sword and wait for 100% charge
- Switch to the wooden sword and attack immediately
Result:
/data get entity @n[type=minecraft:villager] Health
The villager takes 100% damage of 7 Not meeting expectations
The villager is ignited Meet expectations
Item B 's durability decreases Meet expectations
Drop:
Item A: Diamond sword
Item B: Wooden sword
- Hold the diamond sword
- Switch to the wooden sword and drop immediately
Result:
(This must be tested in survival mode)
The wooden sword in hot bar disappears Meet expectations
But the dropped item on the ground is diamond sword Not meeting expectations
And I click the diamond sword slot, the diamond sword disappears.
I click the wooden sword slot, the wooden sword appears.
Building:
Tested items: dirt and stone, lava bucket and water bucket
Meet expectations
Using:
Tested items: egg and snowball, creeper spawner egg and zombie spawner egg, diamond hoe and wooden shovel
Meet expectations
Predicitons:
In my opinion, when switching items, the game did not reset the player's attack charging in a timely manner, nor did it modify the impact of items on the player's attributes in a timely mannerPlease link
MC-278088to this.Some items do not act synchronously in time after switching items.
Reproduce:
- Prepare 2 different items in hot bar.
- Switch item A to item B.
- Perform the following operations through the item B immediately.
Tested operations:
Attac
:Item A: Fire aspect enchanted wooden sword
Item B: Diamond sword without enchantment
- Spawn a villager and give it fire resistance to prevent fire damage changing the result
- Hold the wooden sword and wait for 100% charge
- Switch to the diamond sword and attack immediately
Result:
/data get entity @n[type=minecraft:villager] Health
The villager takes 100% damage of 4 Not meeting expectations
The villager isn't ignited Meet expectations
Item B 's durability decreases Meet expectations
Attack 2:
Item A: Diamond sword without enchantment
Item B: Fire aspect enchanted wooden sword
- Spawn a villager and give it fire resistance to prevent fire damage changing the result
- Hold the diamond sword and wait for 100% charge
- Switch to the wooden sword and attack immediately
Result:
/data get entity @n[type=minecraft:villager] Health
The villager takes 100% damage of 7 Not meeting expectations
The villager is ignited Meet expectations
Item B 's durability decreases Meet expectations
Drop:
Item A: Diamond sword
Item B: Wooden sword
- Hold the diamond sword
- Switch to the wooden sword and drop immediately
Result:
(This must be tested in survival mode)
The wooden sword in hot bar disappears Meet expectations
But the dropped item on the ground is diamond sword Not meeting expectations
And I click the diamond sword slot, the diamond sword disappears.
I click the wooden sword slot, the wooden sword appears.
Building:
Tested items: dirt and stone, lava bucket and water bucket
Meet expectations
Using:
Tested items: egg and snowball, creeper spawner egg and zombie spawner egg, diamond hoe and wooden shovel
Meet expectations
Predicitons:
In my opinion, when switching items, the game did not reset the player's attack charging in a timely manner, nor did it modify the impact of items on the player's attributes in a timely manner
Please link
MC-278088to this.Some items do not act synchronously in time after switching items.
Reproduce:
- Prepare 2 different items in hot bar.
- Switch item A to item B.
- Perform the following operations through the item B immediately.
Tested operations:
Attac
:Item A: Fire aspect enchanted wooden sword
Item B: Diamond sword without enchantment
- Spawn a villager and give it fire resistance to prevent fire damage changing the result
- Hold the wooden sword and wait for 100% charge
- Switch to the diamond sword and attack immediately
Result:
/data get entity @n[type=minecraft:villager] Health
The villager takes 100% damage of 4 Not meeting expectations
The villager isn't ignited Meet expectations
Item B 's durability decreases Meet expectations
Attack 2:
Item A: Diamond sword without enchantment
Item B: Fire aspect enchanted wooden sword
- Spawn a villager and give it fire resistance to prevent fire damage changing the result
- Hold the diamond sword and wait for 100% charge
- Switch to the wooden sword and attack immediately
Result:
/data get entity @n[type=minecraft:villager] Health
The villager takes 100% damage of 7 Not meeting expectations
The villager is ignited Meet expectations
Item B 's durability decreases Meet expectations
Drop:
Item A: Diamond sword
Item B: Wooden sword
- Hold the diamond sword
- Switch to the wooden sword and drop immediately
Result:
(This must be tested in survival mode)
The wooden sword in hot bar disappears Meet expectations
But the dropped item on the ground is diamond sword Not meeting expectations
And I click the diamond sword slot, the diamond sword disappears.
I click the wooden sword slot, the wooden sword appears.
Building:
Tested items: dirt and stone, lava bucket and water bucket
Meet expectations
Using:
Tested items: egg and snowball, creeper spawner egg and zombie spawner egg, diamond hoe and wooden shovel
Meet expectations
Predicitons:
In my opinion, when switching items, the game did not reset the player's attack charging in a timely manner, nor did it modify the impact of items on the player's attributes in a timely mannerPlease link
MC-278088to this.Some items do not act synchronously in time after switching items.
Reproduce:
- Prepare 2 different items in hot bar.
- Switch item A to item B.
- Perform the following operations through the item B immediately.
Tested operations:
Attack:
Item A: Fire aspect enchanted wooden sword
Item B: Diamond sword without enchantment
- Spawn a villager and give it fire resistance to prevent fire damage changing the result
- Hold the wooden sword and wait for 100% charge
- Switch to the diamond sword and attack immediately
Result:
/data get entity @n[type=minecraft:villager] Health
The villager takes 100% damage of 4 Not meeting expectations
The villager isn't ignited Meet expectations
Item B 's durability decreases Meet expectations
Attack 2:
Item A: Diamond sword without enchantment
Item B: Fire aspect enchanted wooden sword
- Spawn a villager and give it fire resistance to prevent fire damage changing the result
- Hold the diamond sword and wait for 100% charge
- Switch to the wooden sword and attack immediately
Result:
/data get entity @n[type=minecraft:villager] Health
The villager takes 100% damage of 7 Not meeting expectations
The villager is ignited Meet expectations
Item B 's durability decreases Meet expectations
Drop:
Item A: Diamond sword
Item B: Wooden sword
- Hold the diamond sword
- Switch to the wooden sword and drop immediately
Result:
(This must be tested in survival mode)
The wooden sword in hot bar disappears Meet expectations
But the dropped item on the ground is diamond sword Not meeting expectations
And I click the diamond sword slot, the diamond sword disappears.
I click the wooden sword slot, the wooden sword appears.
Building:
Tested items: dirt and stone, lava bucket and water bucket
Meet expectations
Using:
Tested items: egg and snowball, creeper spawner egg and zombie spawner egg, diamond hoe and wooden shovel
Meet expectations
Predicitons:
In my opinion, when switching items, the game did not reset the player's attack charging in a timely manner, nor did it modify the impact of items on the player's attributes in a timely manner






I've annotated the code block for understanding, so check it out
In 1.20.4
Can confirm in 1.21.1
The new way to trigger this bug seems different from the previous methods. Please check this ticket:
MC-276926By the way, as what I mentioned in that ticket, this bug may be related to an old bug which hasn't been fixed for several years. I think the old bug has been reported, but I can't find it in Mojira, please help find it.
Can confirm in 1.21.2 pre 2
@BugTracker I think that ticket doesn't fully describe the bug. If there isn't any ticket fully describes, I will modify this ticket and add some details.
Can confirm in 24w44a
I tested again and found MC-28289 can describe this issue.
I originally thought that the bug on the server that caused the item error was also due to this. But vanilla didn't seem to have the problem with that server
Can we close the old ticket and reopen this one? Because the old one didn't mention that the impact of the bug on the behaviours more than combat. The community consensus of that ticket is also just about combat.
In addition, the melee attack charging does not reset in time
Thanks
Although the ticket was marked as a "community consensus", I still need to explain more about the impact of the bug on the game
Why should this bug be fixed?:
This ticket can be closed because MC-28289 can describe how the problem can be caused again
I tested and checked out the src, finally found out the solution.
The attributes of living entites only refresh when entities' mob effects change or by tick.
So we can refresh players' attributes when they change their selected item.
Can confirm in 24w45a
Can confirm in 25w04a
I tested with this command:
/give @s minecraft:diamond_sword[minecraft:blocks_attacks={block_delay_seconds:0.0,disable_cooldown_scale:0.0,damage_reductions:[
{base:0.0,factor:0.5}],block_sound:"minecraft:entity.zombie.attack_iron_door"}]
It works fine. Are you mistaken?