Oh what am I saying… I mean
Can confirm in 25w42a
Can confirm in 25w41a
Besides, the title description seems not quite accurate. The enchantment used during the attack is indeed that of the current item. The main mistake lies in the fact that attributes and attack charges were not updated in a timely manner.
Perhaps it is necessary to add the spear to the bug description as well. When switching from a sword to a spear, it can deal sword damage at a greater distance. This will be more broken than the previous mace because the cost of the spear is very low.
This is because the NoAI entities have velocity but don’t move. You can try /data get entity xxx Motion
I've found the reason. Entities with the NoAI tag will accumulate speed but will not make actual movements. This leads to the continuous accumulation of the entity's speed. Higher damage can be dealt in the direction where the entity's speed is directly opposite (even the attacker can deal damage without moving), while lower damage is dealt in the direction where the speed is opposite
Can confirm in 25w41a
Can confirm in 25w42a