Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Bedrock.php

Comments in 'Plugin Development' started by Radix, Dec 3, 2015.

  1. Radix
    Offline

    Radix Active Member

    Joined:
    Jul 2, 2015
    Posts:
    211
    Minecraft User:
    Dicks123
    Im editing PocketMine-MP.phar and I wanted to know if this would make it so tnt can destroy bedrock

    PHP:
    <?php

    /*
     *
     *  ____            _        _   __  __ _                  __  __ ____  
     * |  _ \ ___   ___| | _____| |_|  \/  (_)_ __   ___      |  \/  |  _ \ 
     * | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
     * |  __/ (_) | (__|   <  __/ |_| |  | | | | | |  __/_____| |  | |  __/ 
     * |_|   \___/ \___|_|\_\___|\__|_|  |_|_|_| |_|\___|     |_|  |_|_| 
     *
     * This program is free software: you can redistribute it and/or modify
     * it under the terms of the GNU Lesser General Public License as published by
     * the Free Software Foundation, either version 3 of the License, or
     * (at your option) any later version.
     *
     * @author PocketMine Team
     * @link http://www.pocketmine.net/
     * 
     *
    */

    namespace pocketmine\block;

    use 
    pocketmine\item\Item;

    class 
    Bedrock extends Solid{

        protected 
    $id self::BEDROCK;

        public function 
    __construct(){

        }

        public function 
    getName(){
            return 
    "Bedrock";
        }

        public function 
    getHardness(){
            return -
    1;
        }

        public function 
    getResistance(){
            return 
    1800;
        }

        public function 
    isBreakable(Item $item){
            return 
    true;
        }

    }
  2. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    Take a look at getHardness and getResistance.
  3. Thunder33345
    Offline

    Thunder33345 Notable Member

    Joined:
    Apr 3, 2014
    Posts:
    755
    Minecraft User:
    Thunder33345
    public function getHardness(){
    return 0;
    }

    public function getResistance(){
    return 0;
    }

    like that?
  4. thebigsmileXD
    Offline

    thebigsmileXD Banned

    Joined:
    May 19, 2015
    Posts:
    845
    Plugins:
    1
    Minecraft User:
    XenialDan
    Only 1 of them.. I think hardneds
  5. Kvetinac97
    Offline

    Kvetinac97 Active Member Plugin Developer

    Joined:
    Nov 17, 2014
    Posts:
    276
    Plugins:
    1
    Minecraft User:
    Kvetinac97
    Hardness has effect to how long will player be breaking the block.
    Resistance has effect to how many blocks near won't be destroyed by TNT/Creeper/Fireball explosion

Share This Page

Advertisement