Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cosmoverse/mcmmo
Port of mcMMO-Dev/mcMMO for PocketMine-MP
https://github.com/cosmoverse/mcmmo
cosmicpe mcmmo plugin pmmp pocketmine
Last synced: 3 months ago
JSON representation
Port of mcMMO-Dev/mcMMO for PocketMine-MP
- Host: GitHub
- URL: https://github.com/cosmoverse/mcmmo
- Owner: Cosmoverse
- License: unlicense
- Created: 2019-11-08T18:04:17.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-03-13T07:04:58.000Z (10 months ago)
- Last Synced: 2024-10-09T23:04:07.206Z (3 months ago)
- Topics: cosmicpe, mcmmo, plugin, pmmp, pocketmine
- Language: PHP
- Homepage: https://poggit.pmmp.io/ci/Cosmoverse/mcMMO
- Size: 107 KB
- Stars: 41
- Watchers: 7
- Forks: 9
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mcMMO
## API
### Player API
To fetch an `McMMOPlayer` instance of an online player
```php
/** @var Player $player */
$mcmmo_player = mcMMO::getInstance()->getPlayerManager()->get($player);
```
As the player data is fetched asynchronously, `$mcmmo_player` will be null at the time the player data is being fetched from the database, so you must do a null check.To increase the player's acrobatics skill experience
```php
$mcmmo_player->increaseSkillExperience(SkillManager::get(SkillIds::ACROBATICS), 125);
```To increase the player's acrobatics skill level by 3
```php
$mcmmo_player->increaseSkillLevel(SkillManager::get(SkillIds::ACROBATICS), 3);
```Note that `increaseSkillExperience` and `increaseSkillLevel` return a boolean indicating whether `McMMOPlayerSkillExperienceChangeEvent` was not cancelled (returns true if the event wasn't cancelled).
### Events API
#### McMMOPlayerAbilityActivateEvent
Called when player activates an ability (f.e: giga drill breaker).
```php
/**
* Returns the skill ability that is being activated.
* @return Ability
*/
McMMOPlayerAbilityActivateEvent::getAbility() : Ability;/**
* How long the ability lasts (in seconds).
* @return int
*/
McMMOPlayerAbilityActivateEvent::getDuration() : int;/**
* Change how long the ability lasts
* @param int $duration (in seconds)
*/
McMMOPlayerAbilityActivateEvent::setDuration(int $duration) : void;
```
#### McMMOPlayerSkillExperienceChangeEvent
Called when a player gains experience in a skill.
```php
/**
* Returns the old experience value.
* @return int
*/
McMMOPlayerSkillExperienceChangeEvent::getOldExperience() : int;/**
* Returns the new experience value.
* @return int
*/
McMMOPlayerSkillExperienceChangeEvent::getNewExperience() : int;/**
* Returns the old experience level.
* @return int
*/
McMMOPlayerSkillExperienceChangeEvent::getOldLevel() : int;/**
* Returns the new experience level.
* @return int
*/
McMMOPlayerSkillExperienceChangeEvent::getNewLevel() : int;/**
* Sets the new experience value.
* @param int $value
*/
McMMOPlayerSkillExperienceChangeEvent::setNewExperience(int $value) : void;
```