2022-01-22 02:23:06 +00:00

6.0 KiB

For Minecraft: Bedrock Edition 1.18.0

Note about API versions

Plugins which don't touch the protocol and compatible with any previous 4.x.y version will also run on these releases and do not need API bumps. Plugin developers should only update their required API to this version if you need the changes in this build.

WARNING: If your plugin uses the protocol, you're not shielded by API change constraints. You should consider using the mcpe-protocol directive in plugin.yml as a constraint if you do.

4.1.0-BETA1

Released 22nd January 2022.

General

  • Game mode names (e.g. survival, creative) may now be used for the gamemode property in server.properties.
  • Increased default maximum render distance to 16 chunks. Players with a render distance smaller than this will notice no difference.
  • The setup wizard now prompts for a maximum render distance value.
  • The setup wizard now prompts for an IPv6 port selection. Previously it would always use 19133.
  • chunk-ticking.disable-block-ticking now accepts block names like those used in the /give command.
  • The /clear command now behaves more like vanilla:
    • The order of inventories is now the same as Bedrock.
    • The cursor and offhand inventories are now cleared if necessary.

Technical

  • PlayerAuthInputPacket is now used instead of MovePlayerPacket for processing movements. This improves position and rotation accuracy.
  • && and || are now always used instead of and and or.
  • New version of pocketmine/errorhandler is used by this version, adding support for ErrorToExceptionHandler::trap(). This enables reliably capturing E_WARNING and E_NOTICE from functions such as yaml_parse() and friends.
  • New dependency versions are required by this version:
    • pocketmine/bedrock-protocol has been updated from 7.1.0 to 7.3.0.
    • pocketmine/errorhandler has been updated from 0.3.0 to 0.6.0.

API

Block

  • The following classes have been added:
    • Lectern
    • Pumpkin
  • The following public API methods have been added:
    • Block->getTypeId() : int - returns an integer which uniquely identifies the block type, ignoring things like facing, colour etc.
    • VanillaBlocks::LECTERN()

Entity

  • The following classes have been added:
    • animation\ItemEntityStackSizeChangeAnimation
  • The following public API methods have been added:
    • object\ItemEntity->isMergeable(object\ItemEntity $other) : bool
    • object\ItemEntity->setStackSize(int $size) : void
    • object\ItemEntity->tryMergeInto(object\ItemEntity $other) : bool
    • ExperienceManager->canAttractXpOrbs() : bool
    • ExperienceManager->setCanAttractXpOrbs(bool $v = true) : void
    • Entity->getSize() : EntitySizeInfo
    • Living->isGliding() : bool
    • Living->isSwimming() : bool
    • Living->setGliding(bool $value = true) : void
    • Living->setSwimming(bool $value = true) : void
  • The following protected API methods have been added:
    • Entity->getBlocksIntersected(float $inset) : \Generator<int, Block, void, void>

Event

  • BlockSpreadEvent is now called when fire spreads to the positions of blocks it burns away.
  • BlockFormEvent is now called when concrete powder turns into concrete due to contact with water.
  • The following classes have been added:
    • BlockMeltEvent - called when ice or snow melts
    • ChestPairEvent - called when two chests try to form a pair
    • PlayerToggleGlideEvent - called when a player starts or stops gliding
    • PlayerToggleSwimEvent - called when a player starts or stops swimming

Item

  • The following public API methods have been added:
    • SplashPotion->getType() : PotionType
    • VanillaItems::AIR()
  • The following API methods have been deprecated:
    • ItemFactory::air() - use VanillaItems::AIR() instead

Player

  • The following public API methods have been added:
    • Player->hasBlockCollision() : bool
    • Player->setHasBlockCollision(bool $value) - allows controlling spectator-like no-clip behaviour without changing game mode
    • Player->toggleSwim(bool $swim) : bool - called by the network system when the client tries to start/stop swimming
    • Player->toggleGlide(bool $glide) : bool - called by the network system when the client tries to start/stop gliding

Server

  • The following public API constants have been added:
    • Server::DEFAULT_SERVER_NAME
    • Server::DEFAULT_MAX_PLAYERS
    • Server::DEFAULT_PORT_IPV4
    • Server::DEFAULT_PORT_IPV6
    • Server::DEFAULT_MAX_VIEW_DISTANCE

Utils

  • Config parsing errors are now always represented by ConfigLoadException and include the path to the file in the message.
  • Added TextFormat::MINECOIN_GOLD, and support for it to the various TextFormat methods.
  • The following public API methods have been added:
    • Utils::assumeNotFalse() - static analysis crutch to silence PHPStan errors without using ignoreErrors or @phpstan-ignore-line, which are both too coarse.
  • The following public API properties have been added:
    • Terminal::$COLOR_MINECOIN_GOLD
  • The following classes have been added:
    • ConfigLoadException
  • Fixed Random->nextSignedInt() to actually return a signed int. Previously it would return any integer value between 0 and 4,294,957,295.
  • Fixed Random->nextSignedFloat() to return a float between -1.0 and 1.0. Previously it would return any value between 0.0 and 2.0.
  • VersionString->getNumber() output is now structured differently to fix overflow issues caused by the old format.

World

  • The following classes have been added:
    • sound\ItemUseOnBlockSound
    • sound\LecternPlaceBookSound

Gameplay

Blocks

  • Fire now spreads.
  • Implemented lectern blocks.
  • Added missing sounds for hoeing grass and dirt.
  • Added missing sounds for using a shovel on grass to create grass path.
  • Pumpkins can now be carved using shears.

Items

  • Dropped items of the same type now merge with each other.

Misc

  • Implemented player swimming.