Giter Site home page Giter Site logo

mcmmo's Introduction

mcMMO

API

Player API

To fetch an McMMOPlayer instance of an online player

/** @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

$mcmmo_player->increaseSkillExperience(SkillManager::get(SkillIds::ACROBATICS), 125);

To increase the player's acrobatics skill level by 3

$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).

/**
 * 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.

/**
 * 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;

mcmmo's People

Contributors

muqsit avatar poggit-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

mcmmo's Issues

server crash

[11:17:56.888] [Server thread/CRITICAL]: Error: "Non-static method pocketmine\item\ItemFactory::get() cannot be called statically" (EXCEPTION) in "plugins/mcMMO.phar/src/cosmicpe/mcmmo/integration/BlockHorizonsFireworkWrapper" at line 28
[11:17:56.889] [Server thread/CRITICAL]: #0 plugins/mcMMO.phar/src/cosmicpe/mcmmo/skill/gathering/GatheringAbilityTrait(16): cosmicpe\mcmmo\integration\BlockHorizonsFireworkWrapper->spawn(object pocketmine\world\Position#89038, integer 0, integer 1)
[11:17:56.892] [Server thread/CRITICAL]: #1 plugins/mcMMO.phar/src/cosmicpe/mcmmo/skill/gathering/excavation/GigaDrillBreakerAbility(40): cosmicpe\mcmmo\skill\gathering\excavation\GigaDrillBreakerAbility->parentOnAdd(object pocketmine\player\Player#24988, object cosmicpe\mcmmo\player\McMMOPlayer#89491, object skh6075\netheriteloader\item\NetheriteShovel#88431)
[11:17:56.894] [Server thread/CRITICAL]: #2 plugins/mcMMO.phar/src/cosmicpe/mcmmo/skill/listener/McMMOSubSkillListener(38): cosmicpe\mcmmo\skill\gathering\excavation\GigaDrillBreakerAbility->onAdd(object pocketmine\player\Player#24988, object cosmicpe\mcmmo\player\McMMOPlayer#89491, object skh6075\netheriteloader\item\NetheriteShovel#88431)
[11:17:56.896] [Server thread/CRITICAL]: #3 plugins/mcMMO.phar/src/cosmicpe/mcmmo/skill/listener/McMMOSkillListener(109): cosmicpe\mcmmo\skill\listener\McMMOSubSkillListener::cosmicpe\mcmmo\skill\listener{closure}(object pocketmine\event\player\PlayerItemUseEvent#88068, object pocketmine\player\Player#24988, object cosmicpe\mcmmo\player\McMMOPlayer#89491, object cosmicpe\mcmmo\skill\listener\McMMOExperienceToller#88429)
[11:17:56.898] [Server thread/CRITICAL]: #4 pmsrc/src/event/RegisteredListener(75): cosmicpe\mcmmo\skill\listener\McMMOSkillListener::cosmicpe\mcmmo\skill\listener{closure}(object pocketmine\event\player\PlayerItemUseEvent#88068)
[11:17:56.900] [Server thread/CRITICAL]: #5 pmsrc/src/event/Event(62): pocketmine\event\RegisteredListener->callEvent(object pocketmine\event\player\PlayerItemUseEvent#88068)
[11:17:56.904] [Server thread/CRITICAL]: #6 pmsrc/src/player/Player(1373): pocketmine\event\Event->call()
[11:17:56.906] [Server thread/CRITICAL]: #7 pmsrc/src/network/mcpe/handler/InGamePacketHandler(403): pocketmine\player\Player->useHeldItem()
[11:17:56.908] [Server thread/CRITICAL]: #8 pmsrc/src/network/mcpe/handler/InGamePacketHandler(232): pocketmine\network\mcpe\handler\InGamePacketHandler->handleUseItemTransaction(object pocketmine\network\mcpe\protocol\types\inventory\UseItemTransactionData#88307)
[11:17:56.910] [Server thread/CRITICAL]: #9 pmsrc/vendor/pocketmine/bedrock-protocol/src/InventoryTransactionPacket(106): pocketmine\network\mcpe\handler\InGamePacketHandler->handleInventoryTransaction(object pocketmine\network\mcpe\protocol\InventoryTransactionPacket#88372)
[11:17:56.912] [Server thread/CRITICAL]: #10 pmsrc/src/network/mcpe/NetworkSession(383): pocketmine\network\mcpe\protocol\InventoryTransactionPacket->handle(object pocketmine\network\mcpe\handler\InGamePacketHandler#87835)
[11:17:56.914] [Server thread/CRITICAL]: #11 pmsrc/src/network/mcpe/NetworkSession(346): pocketmine\network\mcpe\NetworkSession->handleDataPacket(object pocketmine\network\mcpe\protocol\InventoryTransactionPacket#88372, string[54] ...............................<Cr=.B...C.............)
[11:17:56.917] [Server thread/CRITICAL]: #12 pmsrc/src/network/mcpe/raklib/RakLibInterface(188): pocketmine\network\mcpe\NetworkSession->handleEncoded(string[61] ..cb.................>[email protected]..1.....)
[11:17:56.921] [Server thread/CRITICAL]: #13 pmsrc/vendor/pocketmine/raklib-ipc/src/RakLibToUserThreadMessageReceiver(42): pocketmine\network\mcpe\raklib\RakLibInterface->onPacketReceive(integer 0, string[70] ......1>..........Xfy.u.KD.[.Q.V...H...*.....{..FY=......:E...tJ13.v..)
[11:17:56.923] [Server thread/CRITICAL]: #14 pmsrc/src/network/mcpe/raklib/RakLibInterface(122): raklib\server\ipc\RakLibToUserThreadMessageReceiver->handle(object pocketmine\network\mcpe\raklib\RakLibInterface#23390)
[11:17:56.925] [Server thread/CRITICAL]: #15 pmsrc/vendor/pocketmine/snooze/src/SleeperHandler(123): pocketmine\network\mcpe\raklib\RakLibInterface->pocketmine\network\mcpe\raklib{closure}()
[11:17:56.927] [Server thread/CRITICAL]: #16 pmsrc/vendor/pocketmine/snooze/src/SleeperHandler(82): pocketmine\snooze\SleeperHandler->processNotifications()
[11:17:56.928] [Server thread/CRITICAL]: #17 pmsrc/src/Server(1526): pocketmine\snooze\SleeperHandler->sleepUntil(double 1631387876.8933)
[11:17:56.931] [Server thread/CRITICAL]: #18 pmsrc/src/Server(1081): pocketmine\Server->tickProcessor()
[11:17:56.937] [Server thread/CRITICAL]: #19 pmsrc/src/PocketMine(300): pocketmine\Server->__construct(object BaseClassLoader#2, object pocketmine\utils\MainLogger#3, string[27] C:\MCPE Servers\PMMP 4.0.0, string[35] C:\MCPE Servers\PMMP 4.0.0\plugins)
[11:17:56.939] [Server thread/CRITICAL]: #20 pmsrc/src/PocketMine(323): pocketmine\server()
[11:17:56.941] [Server thread/CRITICAL]: #21 pmsrc(11): require(string[71] phar://C:/MCPE Servers/PMMP 4.0.0/PocketMine-MP.phar/src/PocketMine.php)
[11:17:56.944] [Server thread/EMERGENCY]: An unrecoverable error has occurred and the server has crashed. Creating a crash dump
[11:17:56.956] [Server thread/EMERGENCY]: Please upload the "C:/MCPE Servers/PMMP 4.0.0/crashdumps/Sat_Sep_11-11.17.56-AKDT_2021.log" file to the Crash Archive and submit the link to the Bug Reporting page. Give as much info as you can.
[11:17:57.236] [Server thread/EMERGENCY]: The crash dump has been automatically submitted to the Crash Archive. You can view it on https://crash.pmmp.io/view/5186577 or use the ID #5186577.

Crash

Error: "Typed property cosmicpe\mcmmo\McMMO::$
database must not be accessed before initialization" (EXCEPTION) in "plugins/mcMMO_dev-
21.phar/src/cosmicpe/mcmmo/McMMO" at line 52
[04:20:50.820] [Server thread/CRITICAL]: #0 pmsrc/src/plugin/PluginBase(142): cosmicpe
mcmmo\McMMO->onDisable()
[04:20:50.820] [Server thread/CRITICAL]: #1 pmsrc/src/plugin/PluginManager(422): pocket
mine\plugin\PluginBase->onEnableStateChange(false)
[04:20:50.821] [Server thread/CRITICAL]: #2 pmsrc/src/plugin/PluginManager(411): pocket
mine\plugin\PluginManager->disablePlugin(object cosmicpe\mcmmo\McMMO#22415)

Error

  1. Error: "Call to a member function close() on null" (EXCEPTION) in "plugins/mcMMO_dev20.phar/src/cosmicpe/mcmmo/McMMO" at line 58
  2. Error: "Class 'BlockHorizons\Fireworks\item\Fireworks' not found" (EXCEPTION) in "plugins/mcMMO_dev-20.phar/src/cosmicpe/mcmmo/integration/IntegrationManager" at line 23

issue

the plugin nor plugin data actually loads which means the commands dont load either

PM 4.0

How to get PocketMine API 4.0?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.