Released 5th December 2024.
This is a minor feature release, including new gameplay features, internals improvements, API additions and deprecations, and improvements to timings.
Plugin compatibility: Plugins for previous 5.x versions will run unchanged on this release, unless they use internal APIs, reflection, or packages like the pocketmine\network\mcpe
or pocketmine\data
namespace.
Do not update plugin minimum API versions unless you need new features added in this release.
WARNING: If your plugin uses the pocketmine\network\mcpe
namespace, you're not shielded by API change constraints.
Consider using the mcpe-protocol
directive in plugin.yml
as a constraint if you're using packets directly.
/timings
now supports collecting timings from async task workers. These new timings will be shown alongsideFull Server Tick
timings, but will not be counted in total load.- Added
/xp
command. start.sh
will now emit warnings when the server process exits with an unusual exit code. This helps to detect unexpected segmentation faults and other kinds of native errors.
- Added the following new items:
- End Crystal
- Goat Horn (all variants)
- Ice Bomb (from Education Edition)
- Recovery Compass
- Added the following enchantments:
- Frost Walker
- Sugarcane now self-destructs when there is no water adjacent to the base block.
- Added basic support for middle-clicking on entities to get their spawn eggs.
- Added sounds when drinking potions.
- Eating food is now allowed in creative mode and in peaceful difficulty.
- Extracted
MultiAnyFacingTrait
andMultiAnySupportTrait
fromGlowLichen
to enable reuse in other blocks. - The following API methods have been deprecated:
Campfire->getInventory()
- this was added by mistake and can't be well-supported given the way that blocks work
- The following classes have been added:
ClosureCommand
- allows registering a closure to execute a command
- Added APIs to
PlayerInteractEvent
to allow toggling item and block interactions.- This allows various customisations, such as allowing interactions when sneaking, selectively disabling item or block reactions, etc.
- If both item and block interactions are disabled, the event is not cancelled (blocks can still be placed).
- The following API methods have been added:
public PlayerInteractEvent->setUseBlock(bool $useBlock) : void
public PlayerInteractEvent->setUseItem(bool $useItem) : void
public PlayerInteractEvent->useBlock() : bool
- returns whether the block can respond to the interaction (toggling levers, opening/closing doors, etc).public PlayerInteractEvent->useItem() : bool
- returns whether the item can respond to the interaction (spawn eggs, flint & steel, etc).
- The following new classes have been added:
player\PlayerEntityPickEvent
- called when a player middle-clicks on an entity
- The following API methods have been deprecated:
InventoryAction->onAddToTransaction()
- The following API methods have been deprecated:
PermissionManager->getPermissionSubscriptions()
PermissionManager->subscribeToPermission()
PermissionManager->unsubscribeFromAllPermissions()
PermissionManager->unsubscribeFromPermission()
- The following classes have been deprecated:
DiskResourceProvider
ResourceProvider
Promise::all()
now accepts zero promises. This will return an already-resolved promise with an empty array.
- Added PHPStan generic types to
TaskHandler
and related APIs inTaskScheduler
andTask
. - The following API methods have been deprecated
AsyncTask->publishProgress()
AsyncTask->onProgressUpdate()
- Timings can now notify other code when timings are enabled/disabled, reloaded, or collected.
- The intent of this is to facilitate timings usage on other threads, and have the results collected into a single timings report.
- Timings cannot directly control timings on other threads, so these callbacks allow plugins to use custom mechanisms to toggle, reset and collect timings.
- PocketMine-MP currently uses this to collect timings from async task workers. More internal threads may be supported in the future.
- The following API methods have been added:
public static TimingsHandler::getCollectCallbacks() : ObjectSet<\Closure() : list<Promise<list<string>>>
- callbacks for (asynchronously) collecting timings (typically from other threads). The returned promises should be resolved with the result ofTimingsHandler::printCurrentThreadRecords()
.public static TimingsHandler::getReloadCallbacks() : ObjectSet<\Closure() : void>
- callbacks called when timings are resetpublic static TimingsHandler::getToggleCallbacks() : ObjectSet<\Closure(bool $enable) : void>
- callbacks called when timings are enabled/disabledpublic static TimingsHandler::requestPrintTimings() : Promise<list<string>>
- asynchronously collects timing results from all threads and assembles them into a single report
- The following API methods have been deprecated:
TimingsHandler::printTimings()
- this function cannot support async timings collection. UseTimingsHandler::requestPrintTimings()
instead.Timings::getAsyncTaskErrorTimings()
- internal method that is no longer needed
- The following constants have been deprecated:
Timings::GROUP_BREAKDOWN
- no longer used
- The following API methods have been added:
public static Utils::getRandomFloat() : float
- returns a random float between 0 and 1. Drop-in replacement forlcg_value()
in PHP 8.4.
- Blocks are now always synced with the client during a right-click-block interaction. This clears mispredictions on the client in case the new
PlayerInteractEvent
flags were customized by plugins. VanillaBlocks
andVanillaItems
now use reflection to lookup TypeId constants by registration name, instead of requiring TypeIds to be manually specified.- While this is obviously a hack, it prevents incorrect constants from being used when adding new blocks, and guarantees that the names of constants in
BlockTypeIds
andItemTypeIds
will match their corresponding entries inVanillaBlocks
andVanillaItems
respectively. - It also significantly improves readability of
VanillaBlocks
andVanillaItems
, as well as eliminating ugly code likeWoodLikeBlockIdHelper
. - In PM6, the team is exploring options to redesign
VanillaBlocks
andVanillaItems
to eliminate the need for defining separate TypeIds entirely.
- While this is obviously a hack, it prevents incorrect constants from being used when adding new blocks, and guarantees that the names of constants in
ConsoleReader
now uses socket support inproc_open()
to transmit IPC messages to the server process. Previously, a temporary socket server was used, which was unreliable in some conditions.- Event handler tests have been converted to PHPUnit tests by mocking
Server
andPlugin
instances. Previously, these required integration tests for these dependencies. - Fixed various deprecation warnings in PHP 8.4.
netresearch/jsonmapper
is now used at5.0.0
. The PMMP fork of this library has been removed, as it is no longer needed.
Released 5th December 2024.
- Fixed signs not creating a tile when placed.
- Improved blockstate consistency check to detect tiles disappearing during refactors.
Released 9th December 2024.
- Updated translations for Russian and Korean.
- Fixed server build number.
- Fixed some crashes being misreported as plugin-involved.
- Removed legacy
build/make-release.php
script. This script is no longer used, as all releases should now follow the PR workflow.