Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cancelling PlayerReadyArrowEvent for crossbow desyncs the item #11678

Open
Chaosdave34 opened this issue Nov 27, 2024 · 1 comment
Open

Cancelling PlayerReadyArrowEvent for crossbow desyncs the item #11678

Chaosdave34 opened this issue Nov 27, 2024 · 1 comment
Labels

Comments

@Chaosdave34
Copy link

Chaosdave34 commented Nov 27, 2024

Expected behavior

Cancelling PlayerReadyArrowEvent for a crossssbow shoud lead to the arroww/firework rocket not beeing loaded into the crossbow.

Observed/Actual behavior

For the player the crossbow seems to be loaded with a projectile. However, relogging or interacting with the player inventory "resets" the item to show it's actually not loaded.

Steps/models to reproduce

@EventHandler
fun preventCrossbowFromShooting(event: PlayerReadyArrowEvent) {
    if (event.bow.type == Material.CROSSBOW) 
        event.isCancelled = true
    }
}

This only happens when there is no other itemstack in the player inventory which could be used as projectile.

Plugin and Datapack List

Plugins: Only my own plugin
Datapacks: only built-in

Paper version

This server is running Paper version 1.21.3-66-master@afb5b13 (2024-11-27T14:32:35Z) (Implementing API version 1.21.3-R0.1-SNAPSHOT)

Other

No response

@Chaosdave34
Copy link
Author

Maybe only fire the event for bows, because crossbows already have LoadCrossbowEvent?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

No branches or pull requests

1 participant