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

How to break block by program?

Comments in 'Plugin Development' started by zxl777, Dec 23, 2015.

  1. zxl777
    Offline

    zxl777 New Member

    Joined:
    Mar 3, 2015
    Posts:
    1
    Minecraft User:
    power
    I want to break the glass block by program , like the SkyWars do.

    How to do that?
  2. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    PHP:
    Level::setBlock();
  3. AndrewBit
    Offline

    AndrewBit Notable Member

    Joined:
    Jun 18, 2015
    Posts:
    435
    Minecraft User:
    AndrewBit4
    You know what's the ID 0?
    This is the answer you're looking for.
    iDirtPlayzMC and PocketKiller like this.
  4. PocketKiller
    Offline

    PocketKiller Notable Member

    Joined:
    Jul 20, 2015
    Posts:
    741
    PHP:
    \pocketmine\level\Level::setBlock(new Vector3($x$y$z), Block::get(0));
    Last edited: Dec 25, 2015
  5. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    :facepalm:
    The second parameter of Level::setBlock requires a Block object, not a block ID. Use Block::get(0) instead.
    And in your example, you are showing example code instead of referring to a function declaration, so please don't use the static call.

Share This Page

Advertisement