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

tiles

Discussion in 'Facepalm' started by Teamblocket, Jun 6, 2017.

  1. Teamblocket

    Teamblocket Zombie

    Messages:
    301
    GitHub:
    teamblocket
    hey, how can i remove a tile the player is standing on
     
  2. corytortoise

    corytortoise Skeleton

    Messages:
    825
    GitHub:
    corytortoise
    PHP:
     /** @var Player $player */
     
    $player->level->removeTile($player->level->getTile($player->subtract(01)));
    In practice, you would want to confirm that there is a tile below the player before trying to remove it, or you may get an error.
    (source)
     
  3. Teamblocket

    Teamblocket Zombie

    Messages:
    301
    GitHub:
    teamblocket
    now , is it possible to get a tile which is a chest tile and remove or clear the chest inventory ?
     
  4. corytortoise

    corytortoise Skeleton

    Messages:
    825
    GitHub:
    corytortoise
    If you have a Chest tile, you can get the Inventory from it and do whatever you would typically do with a ChestInventory. (source)
     
  5. Teamblocket

    Teamblocket Zombie

    Messages:
    301
    GitHub:
    teamblocket
    thanks
     
  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.