Minecraft
  1. Minecraft
  2. MC-24336

Withers are harmed by the explosions of their Wither Skulls

    Details

    • Confirmation Status:
      Confirmed

      Description

      Withers can harm them self and other Withers with the explosion created by the impact of a Wither Skull. This causes a Wither to severely damage it self or other Withers over time. The Wither Skull itself cannot harm a Wither.

      Steps to Reproduce:
      1. Make a new Creative world.
      2. Spawn a Wither. Make sure there are no mobs in the area.
      3. Once it has spawned, spawn an Iron Golem.
      4. Notice that when the Wither fires at it, it will sometimes flash red despite the Iron Golem not being able to reach that high.

      A Wither at half health or below will be able to hurt itself as well, although more frequently.


      Code analysis: https://bugs.mojang.com/browse/MC-24336?focusedCommentId=300671&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-300671

        Activity

        Hide
        Sam Bone added a comment -

        Confirmed.

        Show
        Sam Bone added a comment - Confirmed.
        Hide
        Marcono1234 added a comment -

        Confirmed for

        • 16w15b
        Show
        Marcono1234 added a comment - Confirmed for 16w15b
        Hide
        Marcono1234 added a comment - - edited

        Please link to this comment in the description

        The following is based on a decompiled version of Minecraft 1.9 using MCP 9.24 beta.

        The reason why this happens is because WitherBosses are only imune to damage dealt by other WitherBosses. The problem is that for explosions the method net.minecraft.world.Explosion.getExplosivePlacedBy() returns the EntityLivingBase who created the explosion. Currently it is not using the net.minecraft.entity.projectile.EntityFireball.shootingEntity field for subclasses of the class EntityFireball.

        /**
         * Returns either the entity that placed the explosive block, the entity that caused the explosion or null.
         */
        public EntityLivingBase getExplosivePlacedBy()
        {
            // Replaced this
            // Imported net.minecraft.entity.projectile.EntityFireball
            //return this.exploder == null ? null : (this.exploder instanceof EntityTNTPrimed ? ((EntityTNTPrimed)this.exploder).getTntPlacedBy() : (this.exploder instanceof EntityLivingBase ? (EntityLivingBase)this.exploder : null));
            if (this.exploder == null) {
                return null;
            }
            else if (this.exploder instanceof EntityTNTPrimed) {
                return ((EntityTNTPrimed) this.exploder).getTntPlacedBy();
            }
            else if (this.exploder instanceof EntityFireball) {
                return ((EntityFireball) this.exploder).shootingEntity;
            }
            else if (this.exploder instanceof EntityLivingBase) {
                return (EntityLivingBase) this.exploder;
            }
            else {
                return null;
            }
        }
        
        Show
        Marcono1234 added a comment - - edited Please link to this comment in the description The following is based on a decompiled version of Minecraft 1.9 using MCP 9.24 beta. The reason why this happens is because WitherBosses are only imune to damage dealt by other WitherBosses. The problem is that for explosions the method net.minecraft.world.Explosion.getExplosivePlacedBy() returns the EntityLivingBase who created the explosion. Currently it is not using the net.minecraft.entity.projectile.EntityFireball.shootingEntity field for subclasses of the class EntityFireball . /** * Returns either the entity that placed the explosive block, the entity that caused the explosion or null . */ public EntityLivingBase getExplosivePlacedBy() { // Replaced this // Imported net.minecraft.entity.projectile.EntityFireball // return this .exploder == null ? null : ( this .exploder instanceof EntityTNTPrimed ? ((EntityTNTPrimed) this .exploder).getTntPlacedBy() : ( this .exploder instanceof EntityLivingBase ? (EntityLivingBase) this .exploder : null )); if ( this .exploder == null ) { return null ; } else if ( this .exploder instanceof EntityTNTPrimed) { return ((EntityTNTPrimed) this .exploder).getTntPlacedBy(); } else if ( this .exploder instanceof EntityFireball) { return ((EntityFireball) this .exploder).shootingEntity; } else if ( this .exploder instanceof EntityLivingBase) { return (EntityLivingBase) this .exploder; } else { return null ; } }

          People

          • Assignee:
            [Mojang] Dinnerbone (Nathan Adams)
            Reporter:
            Unused Account
          • Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              CHK: