Skip to content

EntityPropertyRegistry 5.46.0 ​

final class · pocketmine\entity\property\EntityPropertyRegistry · source

Actor properties ("minecraft:armadillo_state", "minecraft:has_nectar"...) of the entity types the server implements. Since 1.16.100 the server tells the client which properties each entity type has (SyncActorPropertyPacket, sent while the player joins); entity values are then sent as property indices in AddActor/SetActorData. Only properties with "client_sync": true in the vanilla behaviour pack are synced, in definition order (same as BDS and PowerNukkitX).

Constants ​

TYPE_BOOL ​

php
public const TYPE_BOOL = 2

TYPE_ENUM ​

php
public const TYPE_ENUM = 3

TYPE_FLOAT ​

php
public const TYPE_FLOAT = 1

TYPE_INT ​

php
public const TYPE_INT = 0

Methods ​

__construct() ​

php
public function __construct()

encodeValue() ​

php
public function encodeValue(string $entityId, int $index, int|bool|string $value) : int

Converts a property value to the integer sent to the client: enum values become their index, booleans 0/1.

getCount() ​

php
public function getCount(string $entityId) : int

Returns the number of properties of the entity type.

getIndex() ​

php
public function getIndex(string $entityId, string $name) : ?int

Returns the index of the property in its entity type's list, or null if the type doesn't have it.

getSyncPackets() ​

php
public function getSyncPackets() : array

hasProperties() ​

php
public function hasProperties(string $entityId) : bool

registerBool() ​

php
public function registerBool(string $entityId, string $name) : void

registerEnum() ​

php
public function registerEnum(string $entityId, string $name, array $values) : void

registerInt() ​

php
public function registerInt(string $entityId, string $name, int $min, int $max) : void

VanillaMine is a fork of PocketMine-MP, maintained by Luxury Nodes. Not affiliated with the PMMP team or Mojang.