Skip to content

Complex minigames All components

Martin Eisengardt edited this page Jul 23, 2016 · 3 revisions

----- (wiki is still under construction) ----- (original wiki)

Now to create minigames that actually have some content in them and aren't just a raw arena system with enabled pvp we'll need to override the default Arena class as this API doesn't work like the Bukkit API with Events. It's as easy though if you know how overrides work.

These are all functions in the Arena class with a small explanation on what they do. There are a few more components you can override like the default ArenaListener or some Config classes, I'll add them later on.

Function Explanation
void joinPlayerLobby(String playername) Called when a player joins an arena through command or by clicking a sign
void leavePlayer(final String playername, boolean fullLeave) Called when a player leaves the arena or the server; fullLeave determines whether player left the server or not
void spectate(String playername) Called when a player turns into a spectator (through death or similar events)
void startLobby(final boolean countdown) Called when enough players joined and the lobby starts to countdown; the boolean determines whether to skip countdown or not
void start(boolean tp) Called when the lobby countdown finished, now the ingame countdown starts and everyone gets teleported to the arena
void started() Called when the game finally started, that's an empty function just to be overriden when you need functions to be run after the game started
void stop() Called when the arena is stopped because someone won or all left or it was forced by command
void reset() Called from the stop function to regenerate the arena map if needed
void onEliminated(String playername) Called when someone is eliminated by any means (death, fallen to void)

There's more to come here!

Clone this wiki locally