Hi, so I want to create a custom entity, but I still have no idea about creating it. I've search on the other forum but what I found is still on api 3 while I want for the api 4. It would be great if someone can help me to make this possible, cuz I need it to my server, thank you
---------------------------------------------------------- here is an example if you want: ----------------------------------------------------------- PHP: <?phpnamespace NewEntity;use pocketmine\data\bedrock\EntityLegacyIds;use pocketmine\entity\EntitySizeInfo;use pocketmine\entity\Living;Class NewEntity extends Living{ protected function getInitialSizeInfo(): EntitySizeInfo { return new EntitySizeInfo(1.8, 0.6); } public static function getNetworkTypeId(): string { //replace it by the entity that you want return EntityLegacyIds::ARMOR_STAND; } public function getName(): string { return "Armor Stand"; } public function getDrops(): array { return []; } public function getXpDropAmount(): int { return 2; }}
Now, how to summon the entity ? for example, when you break any block, the entities appeared 5 blocks in front of you
I won't give an example code, but you can manipulate x y z on break block event, take position/location. you can add x y z as you like. all available in that class. what about after manipulating?. you just need to pass the first parameter (if I'm not mistaken) with the location you've manipulated