1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Object could not be converted to string

Discussion in 'Plugin Help' started by Pekshik, May 8, 2019.

  1. Pekshik

    Pekshik Creeper

    Messages:
    3
    What is the problem?

    Error: Object of class Xaoc\MainClass could not be converted to string
    File: /src/pocketmine/command/Command
    Line: 85
    Type: E_RECOVERABLE_ERROR

    Code:
    [76] * @param string $name
    [77] * @param string $description
    [78] * @param string $usageMessage
    [79] * @param string[] $aliases
    [80] */
    [81] public function __construct($name, $description = "", $usageMessage = null, array $aliases = []){
    [82] $this->commandData = self::generateDefaultData();
    [83] $this->name = $this->nextLabel = $this->label = $name;
    [84] $this->setDescription($description);
    [85] $this->usageMessage = $usageMessage === null ? "/" . $name : $usageMessage;
    [86] $this->setAliases($aliases);
    [87] $this->timings = new TimingsHandler("** Command: " . $name);
    [88] }
    [89]
    [90] /**
    [91] * Returns an \stdClass containing command data
    [92] *
    [93] * @return \stdClass
    [94] */
    [95] public function getDefaultCommandData() : \stdClass{
     
  2. GamakCZ

    GamakCZ Zombie Pigman

    Messages:
    598
    GitHub:
    GamakCZ
    you aren't constructing class with string or null but with MainClass
     
  3. Pekshik

    Pekshik Creeper

    Messages:
    3
    It's difficult for me
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.