Skip to content

Commit

Permalink
Fix custom bows being unusable by monsters extending `AbstractSkeleto…
Browse files Browse the repository at this point in the history
…n` (#1827)
  • Loading branch information
dhyces authored Jan 5, 2025
1 parent 3de035b commit 66ffb03
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
@@ -163,7 +_,7 @@
@@ -163,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();
@@ -188,9 +_,11 @@

@Override
Expand Down

0 comments on commit 66ffb03

Please sign in to comment.