Skip to content

Latest commit

 

History

History
82 lines (68 loc) · 6.63 KB

File metadata and controls

82 lines (68 loc) · 6.63 KB

5.41.0

Released 15th February 2026.

This is a minor feature release, including new gameplay and API features, performance improvements and network security improvements.

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.

General

  • The supported world format version has been bumped to 1.26.0 (display version 26.0). (@dktapps)
  • Introduced a new filtering system for game network packets to avoid decoding packets that aren't handled by the session's current handler. (@dktapps)
    • This substantially reduces the server's attack surface, and may also improve performance in some cases.
    • ⚠️ IMPORTANT! This will affect plugins using DataPacketReceiveEvent to handle packets. See the API section for notes on DataPacketReceiveEvent's changed behaviour.
    • While this change does negatively affect plugins, the tradeoff was deemed worth it for the major improvement in server security that this feature provides.

Gameplay

  • The following items have been added:
    • Music Disc - Lava Chicken (@dktapps)
  • The following blocks have been added:
    • Azalea and Flowering Azalea, along with the corresponding Azalea Tree (@Azvyl)
    • Block of Bamboo (+ stripped)
    • Bamboo buttons, hanging signs, doors, fences, fence gates, planks, pressure plates, signs, slabs, stairs, and trapdoors
    • Bamboo mosaic planks, stairs, and slabs
  • Fixed various blocks not dropping as items when destroyed by explosions. (@dktapps)

API

pocketmine\block

  • The following methods have signature changes:
    • BlockBreakInfo::__construct() now accepts an optional ?bool $explosionHarvestable parameter. If null, the block will be harvestable by explosions if it has BlockToolType::PICKAXE in the $toolType flags. (@dktapps)
  • The following methods have been added:
    • public BlockBreakInfo->isExplosionHarvestable() : bool (@dktapps)
    • Various public static generated methods added to VanillaBlocks for newly added blocks (see the Gameplay section)

pocketmine\event\player

  • The following methods have been added:
    • public PlayerItemConsumeEvent->getResidue() : list<Item> - returns leftover items, if any (@Wraith0x10, @dktapps)
    • public PlayerItemConsumeEvent->setResidue(list<Item> $items) : void - sets the leftover items to be returned to the player (@Wraith0x10, @dktapps)

pocketmine\event\server

  • DataPacketReceiveEvent will no longer receive all packets by default, as the server may discard packets that aren't handled by the session's current packet handler. (@dktapps)
    • If your plugin needs to handle packets that are filtered, handle DataPacketDecodeEvent with a @handleCancelled annotation on your handler, and use uncancel(). This will allow the packet to be decoded and proceed to DataPacketReceiveEvent.

pocketmine\item

  • The following methods have been added:
    • public VanillaItems::RECORD_LAVA_CHICKEN() : Record

pocketmine\utils

  • The following classes have been deprecated:
    • RegistryTrait - superseded by RegistrySource
    • CloningRegistryTrait - superseded by RegistrySource (override RegistrySource->cloneResults())

pocketmine\world\generator\object

  • The following classes have been added:
    • AzaleaTree
  • The following enum cases have been added:
    • TreeType::AZALEA

Internals

  • The internal workings of VanillaBlocks, VanillaItems etc. have been overhauled. (@dktapps)
    • These registry classes are now fully generated.
    • When adding new members (or changing existing ones), their source classes (e.g. VanillaBlocksInputs) should be modified instead, and then composer update-codegen (or the build/codegen/registry-interface.php script) should be used to update the generated code.
    • Outwardly the API of these classes remains the same, so plugins are not affected (unless they use reflection on them, which is not an officially supported use case).
    • This new approach is significantly more performant, as well as being much more robust internally.
    • This also removes codegen-time dependencies between registries, allowing each class to be individually regenerated in any order, and permitting the deletion of the generated folder and running composer update-codegen to regenerate code from scratch.
    • registerDelayed may be used for cases that require interdependencies (to allow declaring the type for codegen without actually needing both registries to be present). This is needed to avoid dependencies for e.g. sign blocks & items.
  • All generated code files are now placed into the generated directory of the repo instead of src. (@dktapps)
  • All codegen-related build scripts have been moved to the build/codegen subdirectory and their generate- prefixes removed. (@dktapps)
  • Added build/codegen/check-file-collisions.php script to ensure that code files can't exist in both src and generated. (@dktapps)
  • The header for generated code files has been moved to build/codegen/templates/header.php. This avoids copy pasting it into every codegen script, as well as allowing it to be automatically kept up to date by PHP-CS-Fixer. (@dktapps)
  • Updated the NBT used for skull rotation saving. (@remminiscent)
  • NetworkSession now discards packets without decoding if the currently-assigned PacketHandler doesn't handle them, and if DataPacketDecodeEvent was not un-cancelled.
    • This significantly reduces the server's attack surface.
    • Un-cancelling DataPacketDecodeEvent will disable this behaviour, allowing plugins to receive unhandled packets in DataPacketReceiveEvent as before.
    • While we could disable this behaviour entirely if handlers for DataPacketReceiveEvent are detected, doing so would make the feature useless for a large number of servers, as many servers use plugins which use DataPacketReceiveEvent (e.g. anti cheats).
    • It may be worth allowing NetworkSession to have multiple PacketHandlers set in the future rather than doing this, but that's a debate for another time.
    • #[SilentDiscard] annotation may be used on PacketHandler classes to suppress debug messages about unhandled packets, without being forced to decode them.
    • PacketHandlerInspector class contains the logic used to examine PacketHandlers to decide if they will accept a packet.