diff --git a/patches/minecraft/net/minecraft/world/item/CrossbowItem.java.patch b/patches/minecraft/net/minecraft/world/item/CrossbowItem.java.patch new file mode 100644 index 0000000000..21cd1908a7 --- /dev/null +++ b/patches/minecraft/net/minecraft/world/item/CrossbowItem.java.patch @@ -0,0 +1,10 @@ +--- a/net/minecraft/world/item/CrossbowItem.java ++++ b/net/minecraft/world/item/CrossbowItem.java +@@ -243,6 +_,7 @@ + } + + public static void m_40887_(Level p_40888_, LivingEntity p_40889_, InteractionHand p_40890_, ItemStack p_40891_, float p_40892_, float p_40893_) { ++ if (p_40889_ instanceof Player player && net.minecraftforge.event.ForgeEventFactory.onArrowLoose(p_40891_, p_40888_, player, 1, true) < 0) return; + List list = m_40941_(p_40891_); + float[] afloat = m_40923_(p_40889_.m_21187_()); + diff --git a/src/main/java/net/minecraftforge/event/entity/player/ArrowLooseEvent.java b/src/main/java/net/minecraftforge/event/entity/player/ArrowLooseEvent.java index a59ccb5e4b..0ae9faf394 100644 --- a/src/main/java/net/minecraftforge/event/entity/player/ArrowLooseEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/player/ArrowLooseEvent.java @@ -25,6 +25,7 @@ import javax.annotation.Nonnull; *
* This event is {@link Cancelable}.
* If this event is canceled, the player does not stop using the bow.
+ * For crossbows, the charge will always be 1; Set it to -1 in order to prevent firing the arrow.
*
* This event does not have a result. {@link HasResult}
*