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 usingTAG_ByteArray
instead ofTAG_String
. This is a backwards-incompatible change, earlier versions will raise errors if you haveHuman
entities in your world after upgrading.Human
s 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.1pocketmine/math
v0.1.0pocketmine/nbt
v0.1.0pocketmine/raklib
v0.11.0pocketmine/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 instanceofEntityDamageEvent
) and also be able to register a separate handler specifically forEntityDamageByEntityEvent
. - 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()
, andonRandomUpdate()
. The associatedLevel::BLOCK_UPDATE_*
constants have been removed.
Commands
Command->getPermissionMessage()
is now permitted to returnnull
.ConsoleCommandSender->isPlayer()
has been removed.
Entity
Item
,PrimedTNT
andFallingSand
have been moved toobject\ItemEntity
,object\PrimedTNT
andobject\FallingBlock
respectively.- Classes
entity\object\Painting
andentity\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 intoEffect
(type) andEffectInstance
. Methods relating to instance-specific things ofEffect
have been moved toEffectInstance
. See dc3bf85 for implementation examples.
Events
PlayerCreationEvent->getClientId()
has been removed.- Added new events
ProjectileHitBlockEvent
andProjectileHitEntityEvent
. - 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 acceptsCraftingGrid, Item[]
instead ofItem[][], Item, Item[]
- removed the following:
CraftingTransaction
- All API methods have been removed and are now handled in
CraftItemEvent
- All API methods have been removed and are now handled in
CraftItemEvent
- added the following:
getInputs()
,getOutputs()
,getRepetitions()
- added the following:
Recipe
interface:- Removed
getResult()
(because individual recipes may handle this differently)
- Removed
CraftingRecipe
interface- removed the following:
matchItems()
,getExtraResults()
,getAllResults()
,requiresCraftingTable()
,getId()
,setId()
- added the following:
getResultsFor(CraftingGrid)
,getIngredientList()
,matchesCraftingGrid(CraftingGrid)
- removed the following:
ShapedRecipe
- constructor now accepts
string[], Item[], Item[]
- constructor now accepts
ShapelessRecipe
- constructor now accepts
Item[], Item[]
- constructor now accepts
Item
ItemFactory::init()
no longer callsItem::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
andevent\TextContainer
have been moved to thelang
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 theBlock
object given as a parameter, fixes unexpected behaviour with setting blocks inBlockPlaceEvent
usingBlockPlaceEvent->getBlock()
.MovingObjectPosition
has been removed.
Player
Player->__construct()
no longer accepts aclientID
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 ofplugin.yml
. PluginLoader
interface now requires the implementation ofcanLoadPlugin(string) : bool
.
Scheduler
- Throwables thrown from
AsyncTask->onCompletion()
will no longer crash the server.
Server
Server->updatePlayerListData()
now has an extraxuid
parameter before theplayers
parameter.Server->getResourceManager()
has been renamed toServer->getResourcePackManager()
Server->addPlayer()
now accepts aPlayer
as its only parameter.Server->addRecipe()
has been removed. UseServer->getCraftingManager()->registerRecipe()
instead.Server->getConfigBoolean()
has been removed in favour ofServer->getConfigBool()
.Server->getDifficultyFromString()
has been removed in favour of its corresponding method inLevel
.- Added API methods
Server->getPlayerByUUID()
andServer->getPlayerByRawUUID()
.
Utils
- All generic utility functions have been moved from
PocketMine.php
to theUtils
class. - Timezone-related functions have been moved to
pocketmine\utils\Timezone
. TextFormat::toANSI()
has been moved toTerminal
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.