Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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 BlockApplyEffectsEvent #10137

Closed
cometcake575 opened this issue Jan 5, 2024 · 1 comment · May be fixed by #10288
Closed

Add BlockApplyEffectsEvent #10137

cometcake575 opened this issue Jan 5, 2024 · 1 comment · May be fixed by #10288
Labels
status: accepted Disputed bug is accepted as valid or Feature accepted as desired to be added. type: feature Request for a new Feature.

Comments

@cometcake575
Copy link

cometcake575 commented Jan 5, 2024

Is your feature request related to a problem?

Yes, I am trying to apply potion effects to players outside of water when there is a nearby conduit in water, but currently there is no good way to test for an active conduit trying to give effects.

Describe the solution you'd like.

A BlockApplyEffects event, for beacons and conduits, containing a getBlock() method and a getPower() method for the size of the conduit prismarine structure or beacon pyramid.

This event would be called when a beacon or conduit is about to iterate over players to apply effects, firing once each time regardless of if no players are going to be given the effect.

Describe alternatives you've considered.

Looping through nearby blocks for an active conduit or beacon, however this would not work as it would have to often loop through large amounts of blocks, likely causing the server to crash or slow down by a lot as it wouldn't be fast enough to handle searching through so many nearby blocks

Other

Another name for the event might be better, as BlockApplyEffects may suggest that effects are actually being applied rather than the game being about to try applying them, I suggested it with that name since the method for trying to apply effects in the game source code is applyEffects()

@cometcake575 cometcake575 added status: needs triage type: feature Request for a new Feature. labels Jan 5, 2024
@Machine-Maker
Copy link
Member

I like the concept for this event. I think the name probably needs some work to further distinguish it from BeaconEffectEvent which is fired for each player an effect is being applied to for beacons.

We have a similar PR open for spawners adding SpawnerPlayerSearchEvent, allowing plugins to change how spawners detect players in range and I think a similar approach for this would be good.

@Machine-Maker Machine-Maker added status: accepted Disputed bug is accepted as valid or Feature accepted as desired to be added. and removed status: needs triage labels Jan 6, 2024
@PaperMC PaperMC locked and limited conversation to collaborators Apr 28, 2024
@kashike kashike converted this issue into discussion #10517 Apr 28, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
status: accepted Disputed bug is accepted as valid or Feature accepted as desired to be added. type: feature Request for a new Feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants