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

Can't place block if there was an entity

Discussion in 'Plugin Help' started by NovaDev, Apr 4, 2021.

  1. NovaDev

    NovaDev Spider

    Messages:
    7
    GitHub:
    hmm
    How to bypass that?
     
  2. DavyCraft648

    DavyCraft648 Spider Jockey

    Messages:
    40
    GitHub:
    DavyCraft648
    You can override the block (not recommended)
    PHP:
    <?php

    namespace DavyCraft648\MyTestPlugin\block;

    use 
    pocketmine\block\Dirt as PMDirt;
    use 
    pocketmine\math\AxisAlignedBB;

    class 
    Dirt extends PMDirt
    {
        protected function 
    recalculateBoundingBox() : ?AxisAlignedBB{
            return 
    null;
        }
    }
    PHP:
    <?php

    namespace DavyCraft648\MyTestPlugin;

    use 
    DavyCraft648\MyTestPlugin\block\Dirt;
    use 
    pocketmine\block\BlockFactory;
    use 
    pocketmine\plugin\PluginBase;

    class 
    Main extends PluginBase
    {
        public function 
    onLoad() {
            
    BlockFactory::registerBlock(new Dirt(), true);
        }
    }
     
    Last edited: Apr 4, 2021
  3. NovaDev

    NovaDev Spider

    Messages:
    7
    GitHub:
    hmm
    is there any other way besides this?
     
  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.