Cancel EntityShootBowEvent or PlayerReadyArrowEvent, the number of arrows in the player's inventory will not be reduced
Observed/Actual behavior
The number of arrows will decrease until you click on the arrow in the inventory to synchronize
Steps/models to reproduce
@EventHandler
public void onEntityShootBow(final @NotNull EntityShootBowEvent e) {
e.setCancelled(true); // or e.setConsumeItem(false);
}
@EventHandler
public void onPlayerReadyArrow(final @NotNull PlayerReadyArrowEvent e) {
e.setCancelled(true);
// It should not be necessary for plugins to use this method. If it is required for some reason, it is probably a bug.
// e.getPlayer().updateInventory();
}
Plugin and Datapack List
Blank
Paper version
This server is running Paper version git-Paper-280 (MC: 1.20.2) (Implementing API version 1.20.2-R0.1-SNAPSHOT) (Git: 4675152)
You are running the latest version
Expected behavior
Cancel EntityShootBowEvent or PlayerReadyArrowEvent, the number of arrows in the player's inventory will not be reduced
Observed/Actual behavior
The number of arrows will decrease until you click on the arrow in the inventory to synchronize
Steps/models to reproduce
Plugin and Datapack List
Blank
Paper version
This server is running Paper version git-Paper-280 (MC: 1.20.2) (Implementing API version 1.20.2-R0.1-SNAPSHOT) (Git: 4675152) You are running the latest version
Other
No response