mojira.dev
MC-169167

Slimes, magma cubes, pufferfish, and ender dragons can consume the durability of shields within seconds

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:

  1. Summon a large slime by using the command provided below.

    /summon minecraft:slime ~ ~ ~ {Size:4,Attributes:[{Base:0.0d,Name:"minecraft:generic.movement_speed"}]}
  1. Switch into survival mode, obtain a shield, start blocking with it, and slowly approach the slime.

  2. Wait for it to begin attacking you.

  3. Look at the durability of your shield closely.

  4. 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.

Linked issues

MC-295853 Blocking some damage sources using a shield with a custom blocks_attacks component ignores invincibility frames, breaking it within seconds Resolved MC-279955 Magma Cube Shield Breaker Resolved MC-272453 Shield breaks extremely quickly when it is held up while player visits pause menu Resolved MC-265819 When a player is attacked by Slime, the speed of shield loss is very fast. Resolved MC-263959 Shield blocks attack from Magma Cube every tick. Resolved

Attachments

Comments 21

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.

11 more comments

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);
      }
   }

}

Can confirm in 1.21.8 (bruh)

El_Redstoniano

Avoma

(Unassigned)

Confirmed

Gameplay

Important

Combat, Mob behaviour

ender_dragon, magma_cube, mojang_internal_1, pufferfish, shield, slime

Minecraft 1.14, 1.15.1, 1.15.2, 20w13b, 20w17a, ..., 1.21.3, 1.21.4, 25w08a, 1.21.7, 1.21.10

Retrieved