The Bug:
Slimes, magma cubes, pufferfish, and ender dragons can consume the durability of shields within seconds.
This most likely has something to do with how these mobs have little to no attack cooldown.
Steps to Reproduce:
Summon a large slime by using the command provided below.
/summon minecraft:slime ~ ~ ~ {Size:4,Attributes:[{Base:0.0d,Name:"minecraft:generic.movement_speed"}]}
Switch into survival mode, obtain a shield, start blocking with it, and slowly approach the slime.
Wait for it to begin attacking you.
Look at the durability of your shield closely.
Take note as to whether or not slimes, magma cubes, pufferfish, and ender dragons can consume the durability of shields within seconds.
Observed Behavior:
Slimes, magma cubes, pufferfish, and ender dragons can consume the durability of shields within seconds.
Expected Behavior:
Slimes, magma cubes, pufferfish, and ender dragons would not be able to consume the durability of shields within seconds.
Related issues
is duplicated by
relates to
Attachments
Comments


Duplicate of MC-151359
Using this ticket as parent instead.
This can be a problem when defending against magma cubes in basalt deltas. This problem is worse with MC-147694, as magma cubes don't get repelled, and continue to disintegrate the shield.

The loud sound scared me so much ._.
Confirmed for ender dragons. When flying into your shield, they damage the shield way too much.
Can confirm in 21w03a.
Can confirm in 21w06a.
Can confirm in 21w13a.

In 1.17 per MC-229302.

Can confirm in 1.17.1 Release Candidate 1.
I'd like to request ownership of this ticket since the current reporter has been inactive for over a year. I'm willing to keep this ticket updated and will continue to provide all of the necessary details.

Can confirm in 21w38a.

Can Confirm in 1.19.2
@unknown, 1.19.2 has already been marked as an affected version. 🙂

It's worth noting that the steps to reproduce call for summoning a size 5 slime (the NBT value counts from 0, so 4 really means 5), which never appears in game. Only sizes 1, 2, and 4 occur naturally. However, the glitch still occurs with size 4 slimes. Strangely, size 2 slimes don't damage shields at all.

This also affects pufferfish.

Can confirm in 24w20a

Can confirm in 1.21.

This report may be benefited from being renamed to "Slimes, magma cubes, pufferfish, and ender dragons have no attacking delay, quickly draining the durability of shields", to clarify why this issue happens and how it would be fixed (giving these mobs appropriate delays between attacks like other mobs).

Ender dragon has a 2 tick cooldown on attack (checks when was the last time the entity was hit) but only for wings. Head attack has no cooldown so you (well, your shield) take damage 20 times / sec.
This can be easily fixed.
Minecraft 1.20.1 using Parchment mappings.
private void knockBack(List<Entity> pEntities) {
double d0 = (this.body.getBoundingBox().minX + this.body.getBoundingBox().maxX) / 2.0D;
double d1 = (this.body.getBoundingBox().minZ + this.body.getBoundingBox().maxZ) / 2.0D;
for(Entity entity : pEntities) {
if (entity instanceof LivingEntity) {
double d2 = entity.getX() - d0;
double d3 = entity.getZ() - d1;
double d4 = Math.max(d2 * d2 + d3 * d3, 0.1D);
entity.push(d2 / d4 * 4.0D, (double)0.2F, d3 / d4 * 4.0D);
// if (!this.phaseManager.getCurrentPhase().isSitting() && ((LivingEntity)entity).getLastHurtByMobTimestamp() < entity.tickCount - 2) { original check
if (!this.phaseManager.getCurrentPhase().isSitting() && (((LivingEntity)entity).getLastHurtByMobTimestamp() < entity.tickCount - 10 || ((LivingEntity)entity).getLastHurtByMob() != this)) {
entity.hurt(this.damageSources().mobAttack(this), 5.0F);
this.doEnchantDamageEffects(this, entity);
}
}
}
}
As for the head damage, a new conditions must be added like the one above
private void hurt(List<Entity> pEntities) {
for(Entity entity : pEntities) {
// if (entity instanceof LivingEntity) { original
if (entity instanceof LivingEntity && (((LivingEntity)entity).getLastHurtByMobTimestamp() < entity.tickCount - 10 || ((LivingEntity)entity).getLastHurtByMob() != this)) {
entity.hurt(this.damageSources().mobAttack(this), 10.0F);
this.doEnchantDamageEffects(this, entity);
}
}
}