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

Proposed event for items when damaged #6240

Open
wants to merge 2 commits into
base: stable
Choose a base branch
from
Open

Conversation

roimee6
Copy link

@roimee6 roimee6 commented Feb 4, 2024

Introduction

At the moment, when we want to modify the durability of an item, we have to override items

But overriding items can be inconvenient in several cases (sometimes)

The event here allows you to change the durability of items when they are damaged, but could be even more developed (for example, to modify durability via a position where the item is in use)

If you need more questions or additions to the event to be "more relevant", ask me

@dktapps
Copy link
Member

dktapps commented Feb 5, 2024

As I wrote on Discord, I don't think the event is useful in its current form.

It tells you that an item was damaged, and that's it. It doesn't tell you how the item was damaged, where the item is, who is using the item, what the target of the use was, etc.

I also don't think this event belongs in such a low-level function.

@kaxyum
Copy link

kaxyum commented Feb 10, 2024

good idea

@roimee6
Copy link
Author

roimee6 commented Feb 15, 2024

I don't know how to introduce, honestly, the player in the applydamage function, because that would mean that all plugins that use the "applydamage" function would have to add the player as an argument

if anyone has an idea, please suggest it

@ShockedPlot7560 ShockedPlot7560 added Category: API Related to the plugin API Type: Change Proposal RFCs (Request for Comments) on change ideas for PocketMine-MP Type: Enhancement Contributes features or other improvements to PocketMine-MP labels Feb 19, 2024
@dktapps
Copy link
Member

dktapps commented Mar 4, 2024

Players generally damage items via a proxy method in Living anyway, to allow sound generation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: API Related to the plugin API Status: Waiting on Author Type: Change Proposal RFCs (Request for Comments) on change ideas for PocketMine-MP Type: Enhancement Contributes features or other improvements to PocketMine-MP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants