Dev Events: Difference between revisions

From MBedwars
Jump to navigation Jump to search
No edit summary
No edit summary
Line 58: Line 58:
''This event will be executed when a player changing the beds coordinates of a team.''<br />
''This event will be executed when a player changing the beds coordinates of a team.''<br />
<br />
<br />
'''Constructor:''' BedBreakEvent(Player player, Arena arena, Team team, Location loc)<br />
'''Constructor:''' BedPlaceEvent(Player player, Arena arena, Team team, Location loc)<br />
'''Methods:'''
'''Methods:'''
* void setCancelled(boolean bool)
* void setCancelled(boolean bool)
Line 87: Line 87:
* ArenaStatus getStatusBefore()
* ArenaStatus getStatusBefore()
* ArenaStatus getStatus()
* ArenaStatus getStatus()
== PlayerRespawnEvent ==
''This event will be executed when a player is respawning (while he is playing MBedwars)''
<br />
'''Constructor:''' PlayerRespawnEvent(Player player, Arena arena, boolean kick)
'''Methods:'''
* void kickPlayer(boolean bool)
* Player getPlayer()
* Arena getArena()
* boolean willKick()
== OutOfArenaEvent ==
''This event will be executed when a player is teleporting himself outside the arena (while he is playing MBedwars)''
<br />
'''Constructor:''' OutOfArenaEvent(Player player, Arena arena, boolean kick)
'''Methods:'''
* void kickPlayer(boolean bool)
* Player getPlayer()
* Arena getArena()
* boolean willKick()

Revision as of 15:43, 19 November 2016

As any other plugin this plugin also supports events.
You don't need to change much at your code,
you simply add a MBedwars event like the way you did with the Bukkit/Spigot events.
Currently these MBedwars events exists:

PlayerJoinArenaEvent

This event will be executed when a player is entering an arena.

Constructor: PlayerJoinArenaEvent(Player player, Arena arena, boolean success)
Methods:

  • Player getPlayer()
  • Arena getArena()
  • boolean wasSuccessfull()

PlayerQuitArenaEvent

This event will be executed when a player is leaving an arena.

Constructor: PlayerJoinArenaEvent(Player player, Arena arena, boolean success)
Methods:

  • Player getPlayer()
  • Arena getArena()
  • boolean wasSuccessfull()

PlayerJoinArenaSpectatorEvent

This event will be executed when a player is entering an arena as a spectator.

Constructor: PlayerJoinArenaSpectatorEvent(Player player, Arena arena)
Methods:

  • Player getPlayer()
  • Arena getArena()

PlayerQuitArenaSpectatorEvent

This event will be executed when a player is leaving an arena as a spectator.

Constructor: PlayerQuitArenaSpectatorEvent(Player player, Arena arena)
Methods:

  • Player getPlayer()
  • Arena getArena()

RoundStartEvent

@Deprecated: Please use de.marcely.api.ArenaStatusUpdateEvent instead
This event will be executed when an arena is starting.

Constructor: RoundStartEvent(Arena arena)
Methods:

  • Arena getArena()

RoundEndEvent

This event will be executed when an arena is ending.

Constructor: RoundEndEvent(List<Player> players, Arena arena, Team winnerteam)
Methods:

  • List<Player> getWinners()
  • Team getWinnerTeam()
  • Arena getArena()

BedPlaceEvent

This event will be executed when a player changing the beds coordinates of a team.

Constructor: BedPlaceEvent(Player player, Arena arena, Team team, Location loc)
Methods:

  • void setCancelled(boolean bool)
  • Player getWhoPlaced()
  • Arena getArena()
  • Team getTeam()
  • Location getLocation()
  • boolean isCancelled()

BedBreakEvent

This event will be executed when a player is breaking the bed by a team.

Constructor: BedBreakEvent(Player player, Arena arena, Team team, Location loc)
Methods:

  • void setSolution(BedBreakEventSolution solution)
  • Arena getArena()
  • Team getTeam()
  • Location getLocation()
  • Player getPlayer()
  • BedBreakEventSolution getSolution()

ArenaStatusUpdateEvent

This event will be executed when an arena is changing his status.

Constructor: ArenaStatusUpdateEvent(Arena arena, ArenaStatus before, ArenaStatus status)
Methods:

  • Arena getArena()
  • ArenaStatus getStatusBefore()
  • ArenaStatus getStatus()

PlayerRespawnEvent

This event will be executed when a player is respawning (while he is playing MBedwars)
Constructor: PlayerRespawnEvent(Player player, Arena arena, boolean kick) Methods:

  • void kickPlayer(boolean bool)
  • Player getPlayer()
  • Arena getArena()
  • boolean willKick()

OutOfArenaEvent

This event will be executed when a player is teleporting himself outside the arena (while he is playing MBedwars)
Constructor: OutOfArenaEvent(Player player, Arena arena, boolean kick) Methods:

  • void kickPlayer(boolean bool)
  • Player getPlayer()
  • Arena getArena()
  • boolean willKick()