github pmmp/PocketMine-MP api/3.0.0-ALPHA12
PocketMine-MP 1.7dev-937 with API 3.0.0-ALPHA12

latest releases: 5.21.1, 5.21.0, 5.20.1...
pre-release6 years ago

For Minecraft: Bedrock Edition 1.2.13
Event handler inheritance changes, crafting rewrite, gameplay additions, API changes.
This version is an alpha - it is not feature complete. Please do not create issues for missing gameplay features.

This build has breaking API changes, so the API has been bumped to version 3.0.0-ALPHA12.

Please use our issue tracker to report bugs.

Notable changes

Core

General

  • start.cmd will now pause when the server exits with a non-zero exit code, to allow viewing any errors.
  • Adding ban entries with ridiculous date values is no longer permitted and will no longer crash the server on restart. This works around a bug in the date extension in PHP which permits format() to create dates which it cannot parse.
  • Memory dumps are now created in a separate memory_dumps directory.

Commands

  • /dumpmemory no longer requires a token to create a memory dump - instead it uses the current time to identify the dump.

Network

  • Query packet responses are now sent only to the originating interface, not all interfaces.
  • Decreased on-join load by reducing size of CraftingDataPacket.
  • Fixed unhandled packet debug spam when armour items are set from the server side.

World saves

  • Region-based worlds will now no longer be loaded if there are a mixture of types of region files in their region directory. This would previously cause astonishing undefined behaviour which was dependent on the default level format. An error will now be emitted instead: Cannot identify format of world.
  • Human skins now save their skin data using TAG_ByteArray instead of TAG_String. This is a backwards-incompatible change, earlier versions will raise errors if you have Human entities in your world after upgrading.
  • Humans now save their cape data, geometry model and geometry data in their NBT.
  • Fixed a huge number of bugs relating to entities being saved on incorrect chunks in negative coordinates.
  • Fixed a bug in Region handling that caused incomplete corrupted regions to be retained and later crash the server.
  • Fixed chunks getting saved to disk twice on shutdown.

Player

  • Exploits relating to players quitting to main menu on death have been patched.
  • Players can no longer modify item frames or signs inside spawn protection.

Dependency libraries

Requires the following libraries:

  • pocketmine/binaryutils v0.0.1
  • pocketmine/math v0.1.0
  • pocketmine/nbt v0.1.0
  • pocketmine/raklib v0.11.0
  • pocketmine/spl v0.3.0

API

WARNING: API changes to dependent libraries are not documented here. See individual library releases for notes on their changes.

Event handler inheritance changes

This is a new major feature of this release, which makes the hierarchy of event handling much more flexible and versatile. See #1792 for details on this.
Highlights:

  • public static $handlerList is no longer required in event declarations.
  • Any non-abstract event can have a handler registered to it - for example, you can now register handlers for both EntityDamageEvent (which will receive any instanceof EntityDamageEvent) and also be able to register a separate handler specifically for EntityDamageByEntityEvent.
  • Abstract events may be handled using the above rules if they declare the @allowHandle PhpDoc annotation.
  • Handlers will always handle all subclasses of an event. This slightly differs from existing behaviour, where handlers would only receive subclass events which did not declare their own handler lists.

Block

  • Block->onUpdate() hook has been removed, and is replaced by several new methods: onScheduledUpdate(), onNearbyBlockChange(), and onRandomUpdate(). The associated Level::BLOCK_UPDATE_* constants have been removed.

Commands

  • Command->getPermissionMessage() is now permitted to return null.
  • ConsoleCommandSender->isPlayer() has been removed.

Entity

  • Item, PrimedTNT and FallingSand have been moved to object\ItemEntity, object\PrimedTNT and object\FallingBlock respectively.
  • Classes entity\object\Painting and entity\object\PaintingMotive have been added.
  • Added hook for nearby block updates: Entity->onNearbyBlockChange().
  • Added API method Living->hasEffects() which returns if the entity has any active status effects.
  • Effect has been split into Effect (type) and EffectInstance. Methods relating to instance-specific things of Effect have been moved to EffectInstance. See dc3bf85 for implementation examples.

Events

  • PlayerCreationEvent->getClientId() has been removed.
  • Added new events ProjectileHitBlockEvent and ProjectileHitEntityEvent.
  • Added new event PlayerExperienceChangeEvent.
  • Triggering a call to an event inside a handler of that event will no longer cause a segmentation fault. Instead, the maximum recursion depth for event calls has now been limited to 50 calls. Trying to go beyond this depth will cause an exception to be thrown.

Inventory

  • BigCraftingGrid has been removed. Instead, CraftingGrid now accepts a grid size in the constructor.
  • Added API method Inventory->isSlotEmpty().
  • Optimized BaseInventory->getContents() method.
  • DropItemAction no longer requires a source item in the constructor (this was useless anyway).
  • InventoryAction->getCreationTime() has been removed.

Crafting

Crafting-related things have been mostly rewritten in this release and have significant changes.

The following classes have been removed:

  • CraftingTransferMaterialAction
  • CraftingTakeResultAction

The following classes have significant changes:

  • CraftingManager
    • removed the following: getRecipe(UUID), getRecipes()
    • matchRecipe() now accepts CraftingGrid, Item[] instead of Item[][], Item, Item[]
  • CraftingTransaction
    • All API methods have been removed and are now handled in CraftItemEvent
  • CraftItemEvent
    • added the following: getInputs(), getOutputs(), getRepetitions()
  • Recipe interface:
    • Removed getResult() (because individual recipes may handle this differently)
  • CraftingRecipe interface
    • removed the following: matchItems(), getExtraResults(), getAllResults(), requiresCraftingTable(), getId(), setId()
    • added the following: getResultsFor(CraftingGrid), getIngredientList(), matchesCraftingGrid(CraftingGrid)
  • ShapedRecipe
    • constructor now accepts string[], Item[], Item[]
  • ShapelessRecipe
    • constructor now accepts Item[], Item[]

Item

  • ItemFactory::init() no longer calls Item::initCreativeItems().
  • ItemFactory::fromString() now throws exceptions on failure to parse a string as a valid item ID. Previously it would silently return an Air item.
  • Added API method Item->getVanillaName(), which returns the name of an item without any custom name NBT masking it.

Language

  • event\TranslationContainer and event\TextContainer have been moved to the lang namespace.

Level

  • Added API method Level->getRandomTickedBlocks().
  • Explosion->__construct() will now throw exceptions on invalid parameters.
  • Removed dead generator things Level->generateChunk(), Level->regenerateChunk(), GenerationTask.
  • Level->setBlock() now clones the Block object given as a parameter, fixes unexpected behaviour with setting blocks in BlockPlaceEvent using BlockPlaceEvent->getBlock().
  • MovingObjectPosition has been removed.

Player

  • Player->__construct() no longer accepts a clientID parameter.
  • Player->teleportImmediate() has been removed.
  • Player->getClientSecret() has been removed.
  • Player->getLastPlayed() no longer always returns when the player started their current session. In the future it will only return when they last quit the server (or the same as firstPlayed if they haven't played before), but existing save data will still cause the bug until the player next joins.

Plugin

  • Added API method PluginDescription->getMap() which returns an associative array of the contents of plugin.yml.
  • PluginLoader interface now requires the implementation of canLoadPlugin(string) : bool.

Scheduler

  • Throwables thrown from AsyncTask->onCompletion() will no longer crash the server.

Server

  • Server->updatePlayerListData() now has an extra xuid parameter before the players parameter.
  • Server->getResourceManager() has been renamed to Server->getResourcePackManager()
  • Server->addPlayer() now accepts a Player as its only parameter.
  • Server->addRecipe() has been removed. Use Server->getCraftingManager()->registerRecipe() instead.
  • Server->getConfigBoolean() has been removed in favour of Server->getConfigBool().
  • Server->getDifficultyFromString() has been removed in favour of its corresponding method in Level.
  • Added API methods Server->getPlayerByUUID() and Server->getPlayerByRawUUID().

Utils

  • All generic utility functions have been moved from PocketMine.php to the Utils class.
  • Timezone-related functions have been moved to pocketmine\utils\Timezone.
  • TextFormat::toANSI() has been moved to Terminal since it directly pertains to the terminal output and has platform-dependent output.

Gameplay

Blocks

  • Fixed a block-updating race-condition bug causing ghost blocks to sometimes appear on the client-side.

Commands

  • Commands with aliases are now shown correctly on the client-side. Previously only the aliases would be visible and the original command would be missing.

Entities

  • Entity teleporting now is now correctly visible to players.
  • Regeneration effect no longer permits more than 2 sets of incoming damage per second on mobs.
  • Implemented Paintings.
  • Projectiles now use ray tracing for movement. This significantly improves movement of projectiles, particularly fixing arrows getting stuck in mid-air and clipping through the corners of blocks.
  • Arrows now make the correct collision sound and shake on impact.
  • Taking damage with Resistance levels >5 will no longer give the subject absorption hearts.
  • Falling blocks are no longer moved by liquid currents.

Items

  • Implemented Ender Pearls, Splash Potions and Bottle o' Enchanting.
  • Bows and throwable projectiles now make the correct sound when used.
  • Implemented armour durability.
  • Added some missing food items.
  • Fixed mess of incorrectly-registered Fish items.

Player

  • Xbox Live icons are now shown on the server list.
  • Fixed a slot count offset bug that caused changes to player armour not to be visible in the inventory.
  • Implemented critical hits.
  • Players can no longer eat food requiring hunger when in creative mode.
  • Fixed block placement bugs due to AABB floating-point inaccuracies.

Don't miss a new PocketMine-MP release

NewReleases is sending notifications on new releases.