[Solved] Bed object.

Discussion in 'Spigot Plugin Development' started by Eliminator, Jul 1, 2015.

  1. How do I get a Bed object from a bed block? I tried:
    Bed b = (Bed) e.getBlock().getState();
    But it throws a cast error.

    Anyone know?
     
  2. Try doing
    Bed b = (Bed) e.getBlock().getState().getData();
     
  3. OK, it worked, thanks.