api-old/API Main
Do you need to link your plugin with DungeonMaze ? Now you can with our API !
just import the API like this :
import com.timvisee.DungeonMaze.API.DungeonMazeAPI;
and hook to our plugin like this :
In your onEnable :
if (getDungeonMaze() != null) { //do something ( like register event , etc... ) }
And create a public function like this :
public DungeonMaze getDungeonMaze() { Plugin plugin = getServer().getPluginManager().getPlugin("DungeonMaze"); if (plugin == null && !(plugin instanceof DungeonMaze)) { return null; } return (DungeonMaze) plugin; }
and now you can use our simple API with some functions :
Method name | arguments | effect | |
---|---|---|---|
getDMWorlds | None | Return a List<String> with all DungeonMaze Worlds | |
getLoadedDMWorlds | None | Return a List<String> with all loaded DM Worlds | |
isDMWorld | World | Return true if the world is a DM World , false if it is not | |
isDMWorld | String(WorldName) | Return true if the name of the world is associated to a DM Worlds, false if it is not | |
isInDMWorld | Player | Return true if the player is in a DM World, false if not | |
getDMWorld | Player | Return a string with the DM World where is the player if he is one, return null if he isn't in a DMW | |
getDMWorldName | Player | Return the world where is the player, return null if he isn't in a DMW | |
canBuildInDMWorld | (String(WorldName),Player) | Return true if the player can build in the given DM World , return true too if he isn't in a DMW | |
isPlayerAllowedOnDMWorldSurface | (String(WorldName),Player) | Return true if the player can acces to the DM World surface , return true too if he isn't in a DMW | |
isInWhiteList | Object(item type ID (int)) | Return true if the item is in the white list from config, return false if it isn't | |
allowMobSpawner | String (MobName) | Return true if the mob spawner is allow , return false if it isn't | |
getDMLevel | Block (block) | Get the Dungeon Maze level a block is on |
Default WhiteList : null
Default MobSpawner List :
- Blaze
- Creeper
- Enderman
- Ghast
- MagmaCube
- Pig
- PigZombie
- Silverfish
- Skeleton
- Spider
- Zombie
API Events
Dungeon Maze does have it's own events, witch are very easy to listen to. Please go to this page to find out more information about the Dungeon Maze events.
Comments