-
Notifications
You must be signed in to change notification settings - Fork 2
Developer API
This page does get forgotten about so if something doesn't work as it should please let me know so I can update this page.
-
To start off you would probably want to add McInfected to either your plugin's depends or softdepends.
depend: [McInfected]
orsoftdepend: [McInfected]
-
McInfected mcInfected = (McInfected)(Bukkit.getPluginManager().getPlugin("McInfected")
Lobbies are probably going to be the main thing that you need to get/use.
McInfected#getLobbyManager().getLobby("LobbyName")
will return the LobbyManager instance. From here you can get the lobby.
In order to get an arena you'll need to get the ArenaManager from the Lobby.
McInfected#getLobbyManager().getLobby("LobbyName").getArenaManager()
From there you can get the arena's info.
In McInfected players get saved as an IPlayer
. You can get the player's IPlayer by getting the LobbyManager and then getting the IPlayer.
McInfected#getLobbyManager().getIPlayer(player)
To get a player's stats you'll need to get their IStats, there are two ways to do this.
- Use
IPlayer#getIStats()
- Create a new IStats.
IStats stats = new IStats("playername")
This will check if the player is in the lobby and if the answer is yes it will grab their IStats instead of making a brand new one.
McInfected has a few events that you can listen to:
- McInfectedGameEndEvent--Called when the game ends
- McInfectedGameScoreboardUpdateEvent--Called when the scoreboard gets updated
- McInfectedGameTimerEvent--Called when the game type changes
- McInfectedPlayerDeathEvent--Called when a player dies
- McInfectedPlayerEquipEvent--Called when a player gets equiped
- McInfectedPlayerInfectEvent--Called when a player gets infected
- McInfectedPlayerJoinEvent--Called when a player joins
- McInfectedPlayerLeaveEvent--Called when a player leaves
- McInfectedPlayerResetEvent--Called when a player gets reset
- McInfectedPlayerRespawnEvent--Called when the player is respawned
- McInfectedPlayerRestoreEvent--Called when the player's inventory, etc is restored
- McInfectedReloadEvent--Called when McInfected reloads
- McInfectedPlayerExpChangeEvent --Called when a player's exp gets changed
- McInfectedPlayerRankChangeEvent --Called when a player's rank changes