Skip to content

Commit

Permalink
Backport to 1.21.1: Fix custom bows being unusable by monsters extend…
Browse files Browse the repository at this point in the history
…ing `AbstractSkeleton` (#1895)

Co-authored-by: dhyces <[email protected]>
  • Loading branch information
neoforged-automation[bot] and dhyces authored Jan 23, 2025
1 parent e4b879d commit 0b5f50c
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
--- a/net/minecraft/world/entity/monster/AbstractSkeleton.java
+++ b/net/minecraft/world/entity/monster/AbstractSkeleton.java
@@ -157,7 +_,7 @@
@@ -157,8 +_,8 @@
if (this.level() != null && !this.level().isClientSide) {
this.goalSelector.removeGoal(this.meleeGoal);
this.goalSelector.removeGoal(this.bowGoal);
- ItemStack itemstack = this.getItemInHand(ProjectileUtil.getWeaponHoldingHand(this, Items.BOW));
- if (itemstack.is(Items.BOW)) {
+ ItemStack itemstack = this.getItemInHand(ProjectileUtil.getWeaponHoldingHand(this, item -> item instanceof net.minecraft.world.item.BowItem));
if (itemstack.is(Items.BOW)) {
+ if (itemstack.getItem() instanceof net.minecraft.world.item.BowItem) {
int i = this.getHardAttackInterval();
if (this.level().getDifficulty() != Difficulty.HARD) {
i = this.getAttackInterval();
@@ -182,9 +_,11 @@

@Override
Expand Down

0 comments on commit 0b5f50c

Please sign in to comment.