EntityPropertyRegistry 5.46.0
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 = 2TYPE_ENUM
php
public const TYPE_ENUM = 3TYPE_FLOAT
php
public const TYPE_FLOAT = 1TYPE_INT
php
public const TYPE_INT = 0Methods
__construct()
php
public function __construct()encodeValue()
php
public function encodeValue(string $entityId, int $index, int|bool|string $value) : intConverts 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) : intReturns the number of properties of the entity type.
getIndex()
php
public function getIndex(string $entityId, string $name) : ?intReturns 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() : arrayhasProperties()
php
public function hasProperties(string $entityId) : boolregisterBool()
php
public function registerBool(string $entityId, string $name) : voidregisterEnum()
php
public function registerEnum(string $entityId, string $name, array $values) : voidregisterInt()
php
public function registerInt(string $entityId, string $name, int $min, int $max) : void