It would be amazing if we could have an event when a DataHolder has a DataManipulator added or removed or modified. It would be helpful for things like ItemStacks if their DurabilityData is changed for any reason (usually we would have a Cause for these kind of things).
Resolving this would eliminate the need for a ToolDurabilityEvent as suggested in #593.
There are countless applications that can be useful for this, including:
Sounds great!
I just worry that this could cause a whole lot of events being created on modded servers if DataManipulators are created for ticking machines or pipes. Is there any chance of optimizing what events get signed up for, in order to reduce the amount of event spam?
This would also cover #497
To reduce the spam we should separate/subclass the event for entity/item/block targets.
Item targets also need the containing inventory in the event.
Does ChangeDataHolderEvent resolve this issue or is there still more to add?
@simon816
It does, closing (we'll add sub events for more direct actions)
@Zidane I'm going to go ahead and re-open this as an issue for the various sub events with direct actions as there's some discussion I would like on where the events themselves would be located (somewhat partial to them being under the api.event.data package).
Currently, what I have in mind:
NameTag itemMobSpawner to use a different eggCommandBlock's command?I'm sure there are more that we'll be thinking of when adding the events and implementing them.
When an entity catches on fire?
When a player starts crouching?
When a player starts crouching, please :P
Hoping for this. Would help to check food level changes
Related to https://github.com/SpongePowered/SpongeCommon/issues/742. I started working on an implementation some time ago (see that issue), but I'm waiting for some bleeding changes to be (hopefully) merged into what will eventually be API 7. As bleeding is still for API 6, which is solely for Minecraft updates, the PR I need is still on hold.
Going to close this for now due to https://github.com/SpongePowered/SpongeAPI/pull/1728 - If anyone would still like changes or additions, please create a new issue.
Most helpful comment
@Zidane I'm going to go ahead and re-open this as an issue for the various sub events with direct actions as there's some discussion I would like on where the events themselves would be located (somewhat partial to them being under the
api.event.datapackage).Currently, what I have in mind:
NameTagitemMobSpawnerto use a different eggCommandBlock's command?I'm sure there are more that we'll be thinking of when adding the events and implementing them.