mojira.dev
MC-106133

Stray / Wither Skeleton / Pillager with Tipped Arrow in Offhand No Longer Shoot Tipped Arrows

The bug

In 1.10, Mojang made it such that, if a Skeleton holds a tipped arrow in its offhand, it will shoot that tipped arrow when attacking. This no longer works in 16w32a and 16w32b.

How to reproduce

  1. Use the command:

    /summon minecraft:wither_skeleton ~ ~ ~  {HandItems:[{id:"minecraft:bow",Count:1b},{id:"minecraft:tipped_arrow",Count:1b,tag:{CustomPotionEffects:[{Id:18,Duration:100}]}}]}
  2. Get shot by it.
    → ❌ Notice that you don't get Weakness.

Code Analysis / Fix

Code analysis and fix by @unknown can be found in this comment.

Linked issues

Comments 12

A bug like this still exists in 1.11.2 but only for strays and wither skeletons - giving a stray tipped arrows in their offhand doesn't cause them to change to shooting that tipped arrow, they remain shooting their normal tipped arrow that inflicts slowness for 30 seconds. Giving a wither skeleton tipped arrows makes them shoot flame arrows that do nothing else.
Normal skeletons still work properly.

This bug still exists in 17w16a for wither skeletons and strays, and happens for illusioners as well.

Confirmed for 1.12-pre5

Confirmed for 1.12

Appears to be fixed in 1.12.1, I summoned a skeleton with the above command and its arrows gave me the Weakness effect.

Nevermind, I mistakenly used a regular skeleton (instead of a stray/wither) to test this. Confirmed for 1.12.1

2 more comments

The following is based on a decompiled version of MC 1.12 using mcp940.

Please link this in the description of the report.

In the method net.minecraft.entity.monster.EntityWitherSkeleton.func_190726_a()

are no checks for effects on arrows.

protected EntityArrow func_190726_a(float p_190726_1_) 
{
 EntityArrow entityarrow = super.func_190726_a(p_190726_1_);
 entityarrow.setFire(100);
 return entityarrow;
}

This can be easily fixed by replacing the code with, the code from net.minecraft.entity.monster.EntitySkeleton.func_190726_a() 

and ofcourse, adding the setFire like this:

protected EntityArrow func_190726_a(float p_190726_1_){     
ItemStack itemstack = this.getItemStackFromSlot(EntityEquipmentSlot.OFFHAND);
        
if (itemstack.getItem() == Items.SPECTRAL_ARROW){            
EntitySpectralArrow entityspectralarrow = new EntitySpectralArrow(this.world, this);            
entityspectralarrow.func_190547_a(this, p_190726_1_);            
entityspectralarrow.setFire(100);            
return entityspectralarrow;        
}
else
{            
EntityArrow entityarrow = super.func_190726_a(p_190726_1_);
            
if (itemstack.getItem() == Items.TIPPED_ARROW && entityarrow instanceof EntityTippedArrow) {                
((EntityTippedArrow)entityarrow).setPotionEffect(itemstack);            
}   
entityarrow.setFire(100);            
return entityarrow;      
}  
}

Hope this helps 🙂

Piyotato

coschevi

Confirmed

off-hand

Minecraft 16w32a, Minecraft 16w32b, Minecraft 1.11.2, Minecraft 17w16a, Minecraft 1.12 Pre-Release 5, ..., Minecraft 18w50a, Minecraft 19w02a, Minecraft 19w03a, Minecraft 19w03b, Minecraft 19w03c

Minecraft 16w33a, Minecraft 19w09a

Retrieved