Solved Skull Block On Ground

Discussion in 'Plugin Development' started by Elimnator, Jan 11, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    Elimnator

    How do I make a skull block on the ground? When I set the block to a skull its floating in mid air.
     
  2. Offline

    nverdier

    @Elimnator Are you using WorldEdit to do it? Are you making a plugin for this?
     
  3. Offline

    Elimnator

    @nverdier
    Not world edit, I am making a plugin and I want it to make a skull on the ground.
     
  4. Offline

    NathanWolf

  5. Offline

    Elimnator

    @NathanWolf
    When I tried:
    Code:
    l.getBlock().setType(Material.SKULL);
    Skull s = (Skull) l.getBlock().getState();
    s.setRotation(BlockFace.UP);
    
    I got: EventException: Caused by: java.lang.IllegalArgumentException: Invalid BlockFace rotation: UP
     
  6. Offline

    TheCodingCat

    You can not set a skull to look up or down@Elimnator
    You must set it to one of the other enum values.
     
  7. Offline

    unrealdesign

    Then
    Code:
    s.setRotation(BlockFace.UP);
    gave you the error and it needs a different argument, check what your IDE tells you that you need. If it still asks for that, then try other directions
     
  8. Offline

    Elimnator

    I got it to work: skull.setRawData((byte) 1);
     
    NathanWolf likes this.
  9. Offline

    NathanWolf

    Hm.. sorry, yeah that looks like it sets the "Rotation" of the skull, versus the "facing" (per MC wiki) .. and I don't see how to set the facing via API.

    EDIT: Ah, you got it! Well, shame there isn't a better way to do this via the API.
     
Thread Status:
Not open for further replies.

Share This Page