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

Add API for Sculker GameEvents #2356

Open
zml2008 opened this issue May 23, 2021 · 2 comments
Open

Add API for Sculker GameEvents #2356

zml2008 opened this issue May 23, 2021 · 2 comments

Comments

@zml2008
Copy link
Member

zml2008 commented May 23, 2021

In 1.17, Mojang has introduced their own concept of game events.

These are triggered at a location, notifying any listeners within a certain radius. They are used by the sculk sensor block only at the moment.

rough design

API that exposes these events would probably be similar to how sound or particle APIs look currently -- a registry of event types, with a way to play these events on viewers.

Plugins should be able to define custom game events. This would allow something like a spells plugin to trigger sculk sensors from casting a sensor, or have a curse that causes a player to emit periodic game events that prevent them from moving silently.

Vanilla allows suppressing some game events by sneaking -- plugins should be able to customize that suppression as well.

Should plugins be able to listen to game events? Event listeners are registered for particular positions in the world, rather than the global scope of Sponge's own concept for events.

concerns

I'm not sure how stable this API would be, since game events are quite undeveloped at the moment. It may make sense to hold off on exposing these to API until we see what mojang wants to do with them.

There is some naming overlap between the traditional events system that Sponge has already had, and Mojang's game events. There is potential for confusion on the part of plugin devs. There are also different directions a comparison could go:

  • game events are a more limited version of normal events
  • game events are like normal events but with location-scoped listeners

I'm not sure which/either of these is useful.

@LogicFan
Copy link

How about wrap the game event inside a normal sponge event. Especially considering the fact that this mojang event system is not currently widely used and is more limited.

@reflqct
Copy link

reflqct commented Nov 21, 2021

I agree, Sponge's variety of events will probably be large enough to match all GameEvents. I think implementing a GameEvents API where they are called in their corresponding sponge event would work.

@gabizou gabizou changed the title Add API for 1.17 GameEvents Add API for Sculker GameEvents Dec 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants