For Minecraft: Bedrock Edition 1.2.7, 1.2.8, 1.2.9
New gameplay features, level I/O handling refactor, NBT refactor, changes to enchantments
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-ALPHA11.
Please use our issue tracker to report bugs.
Notable changes
Core
General
- Fixed
__FILE__
and__LINE__
being interpreted as C++ macros on Jenkins builds. This did not cause any noticeable bugs, but was still undesirable. - The NBT library has been moved to its own Composer library, along with
pocketmine\utils\Binary
andpocketmine\utils\BinaryStream
. - Instabreak anti-cheat has been removed from the core code. A plugin implementing this can be found at https://github.com/pmmp/AntiInstaBreak
- Fixed a race condition causing log messages to not be written to
server.log
when the server crashes. - Fixed a crash when using /dumpmemory to dump AsyncWorker global variables.
- Fixed memory dumps not including core class static properties.
Blocks
- Fixed a crash when the right half of a double chest was destroyed while being viewed.
Commands
- Fixed
/teleport
crash when extra spaces are placed between arguments.
Entities
- Fixed a crash reading
CustomNameVisible
NBT tag from versions prior to API 3.0.0-ALPHA6.
Network
- Added configuration option
network.max-mtu-size
to allow restricting the maximum byte size of packets sent without being split up. This may be useful to mitigate connection problems.
Level
- Fixed ghost blocks bugs due to the block cache not getting cleared when chunks are replaced.
- Fixed Region-based worlds leaking file resources (region GC was broken).
- Entities are no longer close()d when changing levels. This fixes myriad bugs in plugins and finally properly resolves the age-old chunk unload memory leak without undesired behaviour.
- Players joining LevelDB worlds with folder names that don't match the world display name will now not spawn up at y=32767.
Resource packs
- Errors decoding pack manifests will now raise appropriate error messages instead of
TypeError
s.
API
Block
- Added API methods
Block->getDropsForCompatibleTool()
andBlock->getSilkTouchDrops()
. Block->canBeBrokenWith()
has been renamed toisCompatibleWithTool()
.
Enchantments
- Enchantments have been split into enchantment types (
Enchantment
) and enchantment instances (EnchantmentInstance
).EnchantmentInstance
s should now be used for applying enchantments to items. This change permits various optimizations, and allows separation of immutable type data (such as ID, max level, applicable items, etc) and mutable instance data (such as a specific enchantment's level on an item).
Entity
- XP API has undergone significant changes. Generic math-only XP logic functions have been moved to
ExperienceUtils
fromHuman
. - Added the following
Human
API methods:addXpLevels()
,subtractXpLevels()
,getCurrentTotalXp()
,setCurrentTotalXp()
,addXp()
,subtractXp()
,getLifetimeTotalXp()
andsetLifetimeTotalXp()
. - Added API methods
Entity->isInvisible()
andEntity->setInvisible()
. - Data-property handling has undergone significant changes, see #1876 for details.
- Added API method
Living->getArmorInventory()
Events
PlayerPreLoginEvent
is now called before whitelist and banlist checks are done. This fixes backwards incompatibilities with older plugins which broke after a previous update.- Cancelling
EntityEffectRemoveEvent
will now throw an exception if the effect's duration has expired. - Removed
EntityEatEvent
and subclasses. These events didn't make sense because of their hunger-centric nature, meaning that they only applied to Players regardless.
Inventory
- Added a
$send
parameter toInventory->clearAll()
- Added a
$includeEmpty
parameter toInventory->getContents()
- Removed
Inventory->getHolder()
. Inventories no longer require that you give them anInventoryHolder
. A holder is now optional to be implemented by subclasses and is not required to be anInventoryHolder
. - Armor handling has been removed from
PlayerInventory
and separated into its ownArmorInventory
class.- All armor-related methods have been removed from
PlayerInventory
ArmorInventory
now contains armor-specific logic. All living entities have an armor inventory.
- All armor-related methods have been removed from
- Fixed
Player->removeWindow()
breaking client-sided GUI.
Item
- Added API method
Item->getEnchantmentLevel()
, which returns the level of the enchantment on the item with the given ID, or 0 if it does not have the enchantment. - Removed
Item->getMaxDurability()
- this has been moved toDurable
where it belongs.
Level
- Added API method
Level->addGlobalPacket()
, which allows queuing a packet to be broadcasted to everyone in the level at the end of the tick, similar to howaddChunkPacket()
works. - Added API method
Level->dropExperience()
, which drops a given amount of XP as XP orbs into the world. LevelProvider
s are no longer dependent on Levels. This is a significant change because it makes it possible to constructLevelProvider
s on threads without aLevel
, which opens up future possibilities to do many cool things:- Super-simple world format conversion
- Asynchronous chunk I/O
(DISCLAIMER: These things are NOT implemented yet, but are examples of things that COULD be done.)
- The
LevelProvider
interface has undergone significant changes. Unused or redundant methods have been stripped out, and the remaining methods have significant changes:loadChunk()
now directly returns aChunk
object read from disk.saveChunk()
now directly accepts aChunk
object instead of coordinates.__construct()
now only accepts astring $path
, theLevel
parameter has been removed.- The following methods have been obsoleted, and therefore removed:
getChunk()
,setChunk()
,saveChunks()
,unloadChunk()
,unloadChunks()
,isChunkLoaded()
,getLoadedChunks()
,isChunkGenerated()
,isChunkPopulated()
andgetLevel()
getServer()
method has been removed fromBaseLevelProvider
.
Math
- Added
Math::solveQuadratic()
- Fixed
Vector2
's coordinates magically incrementing whenceil()
is used repeatedly - Added
VoxelRayTrace
containing two generator functions, which allow iterating over blocks on a line between two points. - Removed Math module dependency on
Level
(AxisAlignedBB
depended onMovingObjectPosition
). - Added
RayTraceResult
, which contains data for AxisAlignedBB ray trace results.
NBT
- NBT read/write logic (streams) have been moved to
NBTStream
and its descendents. NBT
class is now abstract.- Removed
network
parameters and endianness fields from NBT stream handling. These are now encapsulated in separate implementations ofNBTStream
(BigEndianNBTStream
,LittleEndianNBTStream
,NetworkLittleEndianNBTStream
).
Permission
- Added
BanList->getEntry()
Resource packs
- Added API method
ResourcePackManager->getPath()
, which returns the path to the server's resource packs directory.
Utils
- The public constant
TextFormat::EOL
has been added. This should be used instead ofPHP_EOL
when preparing messages to send to players, sincePHP_EOL
is platform-dependent. - API method
TextFormat::colorize()
has been added (see #1837 for details). BlockIterator
has been removed in favour ofmath\VoxelRayTrace
.
Gameplay
Blocks
- Block break times will now display correctly when an incorrect or not good enough tool is used to break a block.
- Fixed beds dropping in creative (#1525)
- Fixed chest items getting rearranged when creating a double chest.
Effects
- Hunger effect now applies as expected with high amplifiers.
- Implemented the following effects: Saturation, Fatal Poison (used for parrots).
- Levitation effect no longer triggers anti-flight.
Entities
- Fixed all currently-known occurrences of blocks like fire burning mobs when they are not actually intersecting with the block.
- Armour is now useful for damage types other than PvP.
- Non-player entities can now wear armour (with the help of plugins).
Items
- Implemented Potion effects
- Implemented Chorus Fruit
- Added sounds for Buckets
- Buckets now show the correct liquid inside when used on still liquids
- Empty buckets now stack to 16
- Implemented the following enchantments: Respiration, Silk Touch, Efficiency, Unbreaking, Protection, Fire Protection, Blast Protection, Feather Falling, Projectile Protection.
Player
- Fixed players' knockback being messed up.
- Crafting grid contents is no longer dumped into the player's inventory after respawning.
- Fixed interaction anti-cheat false-positives when doing the following (see #983):
- Standing on the corner of a block and breaking it/placing it (player was further than 0.5 blocks from block centre directionally)
- Breaking/placing blocks "behind" self by looking down and using multi-touch mode with mining circle on mobile devices.
- Breaking blocks right at the end of the survival reach distance.
- Adventure mode no longer prevents interacting with blocks.
- Implemented experience and experience orbs.