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

Solved Set block in ItemFrame

Discussion in 'Development' started by SMLR, Aug 13, 2017.

  1. SMLR

    SMLR Creeper

    Messages:
    3
    GitHub:
    samalero
    Hi! How can i set or remove block inside ItemFrame.
     
    Last edited: Aug 13, 2017
  2. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    Use ItemFrame::setItem()
     
    jasonwynn10 likes this.
  3. SMLR

    SMLR Creeper

    Messages:
    3
    GitHub:
    samalero
    [18:33:37] [Server thread/CRITICAL]: Неможливо запустити подію 'pocketmine\event\player\PlayerInteractEvent' до 'SMLR v9999': Call to undefined method pocketmine\block\ItemFrame::setItem() на smlr\smlrlistener
    [18:33:37] [Server thread/CRITICAL]: Error: "Call to undefined method pocketmine\block\ItemFrame::setItem()" (EXCEPTION) in "plugins/SMLR_v9999/src/smlr/games/smlrttt" at line 183

    $player->getLevel()->getBlock(new Vector3($x, $y, $z))->setItem(Item::SNOW_BLOCK);
     
  4. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    Use ItemFrame::setItem()
     
    SMLR likes this.
  5. SMLR

    SMLR Creeper

    Messages:
    3
    GitHub:
    samalero
    Thnx. Solved.
     
  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.