garbagemule / MobArena

MobArena plugin for Minecraft
GNU General Public License v3.0
196 stars 151 forks source link

[Suggestion] Additional API Events #800

Open Valorless opened 2 months ago

Valorless commented 2 months ago

Feature request

Short description

Additional API events which our plugins can listen to :) Like for example:

Implementation details

ArenaLobbyStart

Function Returns Description
getArena() Arena Returns the arena in question.

ArenaPlayerLobbyJoin

Function Returns Description
getArena() Arena Returns the arena.
getPlayer() Player Returns the player.

ArenaPlayerClassSelect

Function Returns Description
getArena() Arena Returns the arena.
getPlayer() Player Returns the player.
getClass() ArenaClass Returns the chosen class.

ArenaPlayerSpectate

Function Returns Description
getArena() Arena Returns the arena.
getPlayer() Player Returns the player.

ArenaBossAbilityEvent

Function Returns Description
getArena() Arena Returns the arena.
getBoss() MABoss Returns the Boss.
getAbility() Ability Returns the ability.
getTarget() Player Returns the boss' target, if any.

Additional info

We spoke about it briefly on Discord :)

Valorless commented 1 month ago

I thought I'd add it here too, copied from Discord

ArenaLobbyStart

The way I go about with my plugin, is to create an "arena instance" inside my plugin using ArenaStartEvent, which is thrown when the arena starts and not created. Due to this I'm unable to do any checks until the arena is started. Dont think this event should be cancellable personally.

ArenaPlayerLobbyJoin

I could use this to send customized titles, and add effects while players are in the lobby. As stated, I'm unsure if ArenaPlayerJoinEvent already does this, but without ArenaLobbyStart, I currently cant use that 😅 I guess this could be cancelled, which would cancel the player joining the lobby. (Like if a player or group cant use a specific arena)

ArenaPlayerClassSelect

I could use this to add sounds when classes are selected, and also heal players which gets the Health Boost effect, as Minecraft doesn't do this by default. I could also use it to send the specific player information regarding the class, to not have a wall of signs ^^ Cannot be cancelled, would only be used to get info.

ArenaPlayerSpectate

I cant currently think of a way to utilize this one atm, but thought it might be useful for something in the future :)

ArenaBossAbility

I could use this to optionally show titles or play sound effects for the ability. I could also use it for example, if the lobby has a specific class, they could negate specific abilities. Can be cancelled, which would act like essentially shooting blanks. No ability is used, but the ability cooldown still triggers.

While these do benefit me, I thought of them with potential future plugins in mind, by myself or others :) As I have fuckall clue whether or not these are difficult to make, I have no issue if they can't be done, but would appreciate them ^^