PHPackages                             wolvesfortress/libcamera - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. wolvesfortress/libcamera

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

wolvesfortress/libcamera
========================

A small library for handling camera instructions in PocketMine-MP

0.1.0(10mo ago)12152[2 PRs](https://github.com/WolvesFortress/libcamera/pulls)GPL-3.0-or-laterPHP

Since Jul 14Pushed 10mo ago3 watchersCompare

[ Source](https://github.com/WolvesFortress/libcamera)[ Packagist](https://packagist.org/packages/wolvesfortress/libcamera)[ RSS](/packages/wolvesfortress-libcamera/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

[![libcamera icon](https://github.com/WolvesFortress/libcamera/raw/master/libcamera.png)](https://github.com/WolvesFortress/libcamera/raw/master/libcamera.png)

libcamera
=========

[](#libcamera)

A small library for handling camera instructions added in Minecraft Bedrock Edition 1.19.30.

See [the official documentation](https://learn.microsoft.com/en-us/minecraft/creator/documents/camerasystem/cameracommandintroduction?view=minecraft-bedrock-stable)for more information.

Installation
------------

[](#installation)

### Composer

[](#composer)

To install this library through composer, run the following command:

`composer require wolvesfortress/libcamera`

### Virion as Phar

[](#virion-as-phar)

The virion for this library can be found [on Poggit](https://poggit.pmmp.io/ci/WolvesFortress/libcamera/).

Usage
-----

[](#usage)

Here is a basic example on how this library is used:

### Registering the virion

[](#registering-the-virion)

In your main plugin file, register the virion like so:

```
use muqsit\libcamera\libcamera;
use pocketmine\plugin\PluginBase;

class MyPlugin extends PluginBase{

	public function onEnable() : void{
		if(!libcamera::isRegistered()){
			libcamera::register($this);
		}
	}

	// ...
}
```

### Sending instructions

[](#sending-instructions)

To send instructions to the camera, use the following code:

- Set

```
use muqsit\libcamera\libcamera;
use muqsit\libcamera\CameraInstruction;
use pocketmine\network\mcpe\protocol\types\camera\CameraPreset;
use pocketmine\network\mcpe\protocol\types\camera\CameraSetInstructionEase;
use pocketmine\network\mcpe\protocol\types\camera\CameraSetInstructionEaseType;
use pocketmine\network\mcpe\protocol\types\camera\CameraSetInstructionRotation;
use pocketmine\network\mcpe\protocol\types\camera\Vector3;
use pocketmine\player\Player;

// ...
if($player instanceof Player && $player->isOnline()){
	/**
	 * @phpstan-param CameraPreset $preset
	 * @phpstan-param CameraSetInstructionEase|null $ease
	 * @phpstan-param Vector3|null $camera_pos
	 * @phpstan-param CameraSetInstructionRotation|null $rot
	 * @phpstan-param Vector3|null $facing_pos
	 */
	CameraInstruction::set(
		preset: libcamera::getPresetRegistry()->registered["target"],
		ease: new CameraSetInstructionEase(
			CameraSetInstructionEaseType::IN_OUT_CUBIC,
			(float) 5.0 // duration (sec)
		),
		camera_pos: null,
		rot: new CameraSetInstructionRotation(
			(float)20.0, //pitch
			(float)180.0 //yaw
		),
		facing_pos: null
	)->send($player);
}
```

- Fade

```
use muqsit\libcamera\libcamera;
use muqsit\libcamera\CameraInstruction;
use pocketmine\network\mcpe\protocol\types\camera\CameraFadeInstructionColor;
use pocketmine\network\mcpe\protocol\types\camera\CameraFadeInstructionTime;
use pocketmine\player\Player;

// ...
if($player instanceof Player && $player->isOnline()){
	/**
	 * @phpstan-param CameraFadeInstructionColor|null $color
	 * @phpstan-param CameraFadeInstructionTime|null $time
	 */
	CameraInstruction::fade(
		color: new CameraFadeInstructionColor((float)$r,(float)$g,(float)$b),
		time: new CameraFadeInstructionTime((float)$fadeInTime,(float)$stayTime,(float)$fadeOutTime)
	)->send($player);
}
```

- Target

```
use muqsit\libcamera\libcamera;
use muqsit\libcamera\CameraInstruction;
use pocketmine\network\mcpe\protocol\types\camera\CameraTargetInstruction;
use pocketmine\math\Vector3;
use pocketmine\player\Player;

// ...
if($player instanceof Player && $player->isOnline()){
	/**
	 * @phpstan-param Vector3|null $targetCenterOffset
	 * @phpstan-param int $actorUniqueId
	 */
	CameraInstruction::target(
		targetCenterOffset: Vector3::zero(), // no offset
		actorUniqueId: $player->getId() // for example target the player
	)->send($player);
}
```

- Remove Target

```
use muqsit\libcamera\libcamera;
use muqsit\libcamera\CameraInstruction;
use pocketmine\player\Player;

// ...
if($player instanceof Player && $player->isOnline()){
	CameraInstruction::removeTarget()->send($player);
}
```

- Clear

```
use muqsit\libcamera\libcamera;
use muqsit\libcamera\CameraInstruction;
use pocketmine\player\Player;

// ...
if($player instanceof Player && $player->isOnline()){
	CameraInstruction::clear()->send($player);
}
```

- Multi

```
use muqsit\libcamera\libcamera;
use muqsit\libcamera\CameraInstruction;
use pocketmine\network\mcpe\protocol\types\camera\CameraFadeInstructionColor;
use pocketmine\network\mcpe\protocol\types\camera\CameraFadeInstructionTime;
use pocketmine\math\Vector3;
use pocketmine\player\Player;

// ...
if($player instanceof Player && $player->isOnline()){
	CameraInstruction::multi(
		CameraInstruction::target(
			targetCenterOffset: Vector3::zero(),
			actorUniqueId: $player->getId()
		),
		CameraInstruction::fade(
			color: new CameraFadeInstructionColor((float)$r,(float)$g,(float)$b),
			time: new CameraFadeInstructionTime((float)$fadeInTime,(float)$stayTime,(float)$fadeOutTime)
		)
	)->send($player);
}
```

Roadmap
-------

[](#roadmap)

At the moment, there are a few improvements that can be/or are being worked on. Here is a list of some of those improvements:

- Allow registering new camera presets

Issues
------

[](#issues)

Any issues/suggestion can be reported [here](https://github.com/WolvesFortress/libcamera/issues).

Credits
-------

[](#credits)

- [Muqsit](https://github.com/Muqsit): Creator of the library
- [inxomnyaa](https://github.com/inxomnyaa): Current maintainer

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance54

Moderate activity, may be stable

Popularity14

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity26

Early-stage or recently created project

 Bus Factor1

Top contributor holds 87.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

308d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/247134f60bf8c5c7c8a2f06b0ecea431a052614283aac5093b57bde51039e34a?d=identicon)[muqsit](/maintainers/muqsit)

![](https://www.gravatar.com/avatar/cf0d401aaa8f3041cb3dee39916b961e93ba7af178e4ddf3dae9535f0f98f340?d=identicon)[inxomnyaa](/maintainers/inxomnyaa)

---

Top Contributors

[![inxomnyaa](https://avatars.githubusercontent.com/u/8733998?v=4)](https://github.com/inxomnyaa "inxomnyaa (7 commits)")[![poggit-bot](https://avatars.githubusercontent.com/u/22427965?v=4)](https://github.com/poggit-bot "poggit-bot (1 commits)")

---

Tags

cameracamera-apicomposer-packageminecraftpocketminepocketmine-mppocketmine-mp-virionvirion

### Embed Badge

![Health badge](/badges/wolvesfortress-libcamera/health.svg)

```
[![Health](https://phpackages.com/badges/wolvesfortress-libcamera/health.svg)](https://phpackages.com/packages/wolvesfortress-libcamera)
```

###  Alternatives

[muqsit/invmenu

A PocketMine-MP virion to create and manage virtual inventories!

2234.2k1](/packages/muqsit-invmenu)[muqsit/simple-packet-handler

Handle specific data packets (virion for PMMP API 4.0.0)

426.1k3](/packages/muqsit-simple-packet-handler)[dktapps/pmforms

Form API library for PocketMine-MP plugins

522.3k1](/packages/dktapps-pmforms)[muqsit/asynciterator

A virion that simplifies writing tasks that traverse iterators

182.9k](/packages/muqsit-asynciterator)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
