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

Solved getting random power when breaking bed

Discussion in 'Development' started by Fludixx, Aug 6, 2018.

  1. Fludixx

    Fludixx Creeper

    Messages:
    4
    GitHub:
    fludixx
    When I break a Bed I get a random power instead of the actual one.
    Code:
    PHP:
    public function onBreak(BlockBreakEvent $event) {
       
    $block $event->getBlock();
       if(
    $block->getId() == Item::BED_BLOCK) {
          
    $this->getLogger()->info($block->getDamage());
       }
    }
     
  2. BLOCKSTORM

    BLOCKSTORM Witch

    Messages:
    67
    Can you give some more Information?
     
  3. DaPigGuy

    DaPigGuy Slime

    Messages:
    86
    GitHub:
    DaPigGuy
    I think he is trying to say that when he breaks a colored bed, the dropped bed is not the same color as the colored bed that was just broken.
     
  4. dktapps

    dktapps Administrator Staff Member PMMP Team

    Messages:
    774
    GitHub:
    dktapps
    Bed colour is not stored in the damage. The damage stores the rotation.

    The colour is stored in the bed tile.
     
  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.