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

Setblock command: ( /setblock )

Discussion in 'Requests' started by PsyOps, Jul 14, 2017.

  1. PsyOps

    PsyOps Silverfish

    Messages:
    16
    I have tried looking through pocketmine sites for an equivalent command for /setblock command and can't seem to find a plugin to do it. When I do searches I usually get development type links that shows the php and people using the command in the code for a certain task in a mod/plugin. I am simply looking for a way to either send the command myself "/setblock" or to have another plugin send it like slapper or taptodo. I can see people hesitant to make plugins for it because maybe it will eventually work itself into the core of pocketmine maybe? I just cant seem to find an answer to why it hasn't been implemented as a core command or plugin.

    I did try to do research on it, so if it is buried in some thread somewhere I am sorry.
     
    Thunder33345 likes this.
  2. WinterBuild7074

    WinterBuild7074 Zombie Pigman

    Messages:
    693
    GitHub:
    winterbuild7074
    PsyOps likes this.
  3. PsyOps

    PsyOps Silverfish

    Messages:
    16
    oh man thnx. I will try it out. I am a noob coder and have done some stuff in c#,java,js,lua and some other stuff, but not much in php. If this works out maybe i can mod it for ~ and whatever else. I just never knew how to get started. Let me try it out, many thnx.
     
  4. PsyOps

    PsyOps Silverfish

    Messages:
    16
    looking over code, see if i can do anything ( doubtful hehe, i r noob )

    [19:04:05] [Server thread/CRITICAL]: Unhandled exception executing command 'setblock 278 8 223 sand' in setblock: Call to undefined method pocketmine\Player::hasPermisson()
    [19:04:05] [Server thread/CRITICAL]: Error: "Call to undefined method pocketmine\Player::hasPermisson()" (EXCEPTION) in "/SetBlock_v1.0.0.phar/src/WinterBuild7074/SetBlock/Main" at line 23

    I think it's this line: if($sender->hasPermisson("setblock"))
     
  5. PsyOps

    PsyOps Silverfish

    Messages:
    16
    OH spelling maybe? trying to repack it, if so sorry hehe. let's see if it is as simple as that.

    Update: Works after spelling change! thnx bud. Ill try and maybe add stuff and work off of this. I appreciate the help. Even as simple as this, it will help me make better maps. Thnx again.
     
    Last edited: Jul 16, 2017
    SalmonDE likes this.
  6. PsyOps

    PsyOps Silverfish

    Messages:
    16
    I don't know if I will get to try out code for "/fill" but the code I added so far is basically
    $x = $args[0] == "~" ? (int)$sender->getX() : $args[0];
    $y = $args[1] == "~" ? (int)$sender->getY() : $args[1];
    $z = $args[2] == "~" ? (int)$sender->getZ() : $args[2];
    with the rest of the code reflecting this change and it has ~ working ( so far anyways ). So thnx again bud.
    Since there is no redstone/lever/command blocks working in pocketmine I figured that using taptodo would give me options for doors to open and close by setting/deleting blocks. We will see how far this goes.
     
  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.