Skip to content

Conversation

@btwonion
Copy link

@btwonion btwonion commented Dec 5, 2025

Changes Block#breakNaturally function call to Player#breakBlock where a player is available. This adds the ability for other plugins to tinker with the breaking logic, in my case the item dropping.

@KartoffelChipss
Copy link
Member

It seems like the player#breakBlock() method applies damage for every block broken by the plugin (additionally to the damage manually applied by the plugin).
And it seems to somehow break the break animation: https://share.cleanshot.com/jtpPPlzr

@KartoffelChipss
Copy link
Member

I've looked at your plugin and I was thinking that maybe it would be a better approach to make TimberZ fire a cancellable event right before cutting down a tree that contains all the information about which blocks will be broken and what durability cost etc will be.

@btwonion
Copy link
Author

btwonion commented Dec 7, 2025

This would be a valid option as well, yes.
I didn't realize the animation was broken before.. so this may be the only valid choice.

@btwonion
Copy link
Author

btwonion commented Dec 7, 2025

We might as well use my DropEvent. This way the compatibility is added as well.
If you want to add a way for other plugins as well, your way is better.

@btwonion
Copy link
Author

btwonion commented Dec 8, 2025

If you are fine with my event being implemented, I will edit this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants