-
Bug
-
Resolution: Works As Intended
-
None
-
23w51a, 1.20.6, 24w19b, 24w20a, 24w21b
-
None
-
Confirmed
-
Items
-
Low
-
1236106
-
Expansion A
The Bug:
Wolf armor spawns at wolves' feet when their armor is sheared.
The wolf armor technically spawns below its visual model which isn't correct and I believe it should instead spawn higher up, possibly at the top of the wolf's bounding box
Steps to Reproduce:
- Tame the wolf, equip it with some wolf armor, and obtain some shears.
- Freeze the world so you can easily observe where the wolf armor item spawns by using the command provided below.
/tick freeze
- Shear the wolf and observe where the wolf armor spawns.
Observed Behavior:
The wolf armor item spawns at the bottom of the wolf's bounding box.
Expected Behavior:
The wolf armor item would spawner higher up.
Code Analysis:
Code analysis by Avoma can be found below.
The following is based on a decompiled version of 24w21b using Mojang mappings.
public class Wolf extends TamableAnimal implements NeutralMob, VariantHolder<Holder<WolfVariant>> { ... public InteractionResult mobInteract(Player player, InteractionHand interactionHand) { ... if (this.isTame()) { ... if (itemStack.is(Items.SHEARS) && this.isOwnedBy(player) && this.hasArmor() && (!EnchantmentHelper.has(this.getBodyArmorItem(), EnchantmentEffectComponents.PREVENT_ARMOR_CHANGE) || player.isCreative())) { itemStack.hurtAndBreak(1, player, Wolf.getSlotForHand(interactionHand)); this.playSound(SoundEvents.ARMOR_UNEQUIP_WOLF); ItemStack itemStack2 = this.getBodyArmorItem(); this.setBodyArmorItem(ItemStack.EMPTY); this.spawnAtLocation(itemStack2); return InteractionResult.SUCCESS; } ...
If we look at the above class, we can see that when a wolf wearing wolf armor is sheared, the wolf armor spawns at the wolf's position. This is evident through the following line of code:
this.spawnAtLocation(itemStack2);
- relates to
-
MC-262667 Items spat from foxes are spawned too high and are offset from the said fox's position
- Open
-
MC-271739 Scute items from a baby turtle growing up are spawned too high
- Open
-
MC-269147 Shearing a bogged spawns mushrooms at the bogged's feet
- Resolved
-
MC-270213 Scutes from brushing an armadillo spawn at the entity's feet
- Resolved
-
MC-271976 Ejected items from horizontal item frames spawn too high
- Resolved