Hello, i'm a newbie that trying to create a PMMP Pocketmine Plugin, but when i try to make this plugins, i recently get error message Call to a member function getDataPropertyManager() on null" and here is my code PHP: $aimPos = $ev->getPlayer()->getDirectionVector(); $nbt = new CompoundTag("", [ "Pos" => new ListTag("Pos", [ new DoubleTag("", $ev->getPlayer()->x), new DoubleTag("", $ev->getPlayer()->y + $ev->getPlayer()->getEyeHeight()), new DoubleTag("", $ev->getPlayer()->z) ]), "Motion" => new ListTag("Motion", [ new DoubleTag("", $aimPos->x), new DoubleTag("", $aimPos->y), new DoubleTag("", $aimPos->z) ]), "Rotation" => new ListTag("Rotation", [ new FloatTag("", $ev->getPlayer()->yaw - 75), new FloatTag("", $ev->getPlayer()->pitch) ]), "Health" => new ShortTag("Health", 5), "Item" => new CompoundTag("Item", [ "id" => new ShortTag("id", Item::DIAMOND_SWORD), "Damage" => new ShortTag("Damage", 0), "Count" => new ByteTag("Count", 1), ]), "PickupDelay" => new ShortTag("PickupDelay", 0x7F), ]);//initEntity() $player = $ev->getPlayer(); $sword = Entity::createEntity("SwordThrowTask", $ev->getPlayer()->getLevel(), $nbt, $ev->getPlayer()); $sword->getDataPropertyManager()->setByte(Entity::DATA_ARMOR_STAND_POSE_INDEX, 8); $sword->setMotion($sword->getMotion()->multiply(1.5)); $sword->spawnToAll(); $player->getInventory()->setItemInHand(Item::get(Item::AIR));
If the entity you're trying to spawn isn't registered, Entity::createEntity will return null https://github.com/pmmp/PocketMine-...cddf085/src/pocketmine/entity/Entity.php#L373
It's an armor stand, right? I don't think armor stands are registered in pmmp by default, you probably need to make your own ArmorStand class.