Serializable Events Request

I am planning on making a plugin that needs to save and play back events. It would be nice if the Event interface could implement Serializable so I can save and load events. Another use for this could be for a plugin that logs events to see which players are misbehaving. This seems easy to implement and could be very useful to some plugins.

Thanks,
edggy

The problem I can see is that there’s not just one way to serialize the event. You could serialize the entire object structure, including lists of entities (which in turn would serialize their attributes etc), or you could serialize just the bits you’re interested in (like just the UUID and type of entity).

At the same time, custom events can be a cause for trouble as well.

Basically I would want to serialize enough to replay an event later. Here it says you can fire events using the event bus.
Here’s an example of what I would like to do:
As players do things and fire events they would be saved into a database.
Later, if the mods need to see what occurred they start up a new copy of the world and run the events when they where triggered from the database and observe what actually happened at the location in question.

If events are Serializable this would be easy to implement (I think) since I could just use the stored events.

So in terms of serialization, you only need to serialize what is necessary to save it so when it is reloaded it can be fired

Also this has nothing to do with custom events, but my idea still works with them too.

Thanks,
edggy