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.

Related issues

MC-151359 Slime attack too quickly, breaking shields in seconds MC-199213 Shield gets spammed hit when defending against magma cube MC-208462 Magma Cube hitting sheild 50+ times in 1 sec MC-210306 Slimes instantly break shields MC-215718 shields break very fast whehn blocking slimes MC-229302 magma cubes can break your shield VERY fast MC-231768 Shield not working MC-233924 Magma cubes break shields very fast MC-240199 When an Magma Cube gets near a player with shield out it shreds the durability. MC-263959 Shield blocks attack from Magma Cube every tick. MC-265819 When a player is attacked by Slime, the speed of shield loss is very fast. MC-272453 Shield breaks extremely quickly when it is held up while player visits pause menu MC-279955 Magma Cube Shield Breaker MC-295853 Blocking some damage sources using a shield with a custom blocks_attacks component ignores invincibility frames, breaking it within seconds

Attachments

Comments

migrated
[media][media]
migrated

Duplicate of MC-151359

NeunEinser

Using this ticket as parent instead.

gaspoweredpick

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.

LaserSlimeHD

The loud sound scared me so much ._.

gaspoweredpick

Confirmed for ender dragons. When flying into your shield, they damage the shield way too much.

Avoma

Can confirm in 21w03a.

Avoma

Can confirm in 21w06a.

Avoma

Can confirm in 21w13a.

ampolive

In 1.17 per MC-229302.

ampolive

Can confirm in 1.17.1 Release Candidate 1.

Avoma

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.

ampolive

Can confirm in 21w38a.

migrated

Can Confirm in 1.19.2

Avoma

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

migrated

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.

syarumi

This also affects pufferfish.

Viradex

Can confirm in 24w20a

Libreh

Can confirm in 1.21.

SeaOfPixels

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

insane96mcp

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

}

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.1, 24w36a, 1.21.3, 1.21.4, 25w08a

Retrieved