| 
    PocketMine-MP 5.37.1 git-cef37e7835c666594588f957a47b27d521c6a58e
    
   | 
 
 Collaboration diagram for pocketmine\entity\EntityFactory:Public Member Functions | |
| createFromData (World $world, CompoundTag $nbt) | |
| getSaveId (string $class) | |
| injectSaveId (string $class, CompoundTag $saveData) | |
| isRegistered (string $class) | |
| register (string $className, \Closure $creationFunc, array $saveNames) | |
Public Attributes | |
| const | TAG_IDENTIFIER = "identifier" | 
| const | TAG_LEGACY_ID = "id" | 
This class manages the creation of entities loaded from disk. You need to register your entity into this factory if you want to load/save your entity on disk (saving with chunks).
Definition at line 70 of file EntityFactory.php.
| pocketmine\entity\EntityFactory::__construct | ( | ) | 
Definition at line 87 of file EntityFactory.php.
| pocketmine\entity\EntityFactory::createFromData | ( | World | $world, | 
| CompoundTag | $nbt ) | 
Creates an entity from data stored on a chunk.
| SavedDataLoadingException | 
Definition at line 259 of file EntityFactory.php.
| pocketmine\entity\EntityFactory::getSaveId | ( | string | $class | ) | 
@phpstan-param class-string<Entity> $class
Definition at line 292 of file EntityFactory.php.
| pocketmine\entity\EntityFactory::injectSaveId | ( | string | $class, | 
| CompoundTag | $saveData ) | 
Definition at line 281 of file EntityFactory.php.
| pocketmine\entity\EntityFactory::isRegistered | ( | string | $class | ) | 
@phpstan-param class-string<Entity> $class
Definition at line 249 of file EntityFactory.php.
| pocketmine\entity\EntityFactory::register | ( | string | $className, | 
| \Closure | $creationFunc, | ||
| array | $saveNames ) | 
Registers an entity type into the index.
| string | $className | Class that extends Entity | 
| string[] | $saveNames | An array of save names which this entity might be saved under. @phpstan-param class-string<Entity> $className @phpstan-param list<string> $saveNames @phpstan-param \Closure(World $world, CompoundTag $nbt) : Entity $creationFunc | 
NOTE: The first save name in the $saveNames array will be used when saving the entity to disk.
InvalidArgumentException
Definition at line 228 of file EntityFactory.php.
| const pocketmine\entity\EntityFactory::TAG_IDENTIFIER = "identifier" | 
Definition at line 73 of file EntityFactory.php.
| const pocketmine\entity\EntityFactory::TAG_LEGACY_ID = "id" | 
Definition at line 74 of file EntityFactory.php.