material stone_slab

Discussion in 'Plugin Development' started by Badwolf330, Oct 18, 2015.

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

    Badwolf330

    this is a stupid question. but i want the material of a stone slab xD
    for this:
    Code:
     getType() == Material. 
     
  2. Offline

    Scimiguy

  3. Offline

    Reynergodoy

    STONE_SLAB?
     
  4. Offline

    Badwolf330

    @Reynergodoy
    that does not exist ....

    @Scimiguy thats a anouther bock :(

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Oct 29, 2015
  5. Offline

    Badwolf330

    @megamichiel Material.STEP works but now al of the slabs works is there a spesific???
     
  6. Offline

    Badwolf330

  7. Offline

    Chloe-chan

    For me, I'm using a deprecated method of directly setting the data value of the block.
    Code:
    block.setData((byte) 1);
    This isn't an elegant method, but it works. As for the data values, try here.
     
  8. Offline

    Badwolf330

    @Chloe-chan doesn't work .....
    Code:
           if (e.getClickedBlock().getRelative(0, 1, 0).getType() == Material.STEP.getData((byte) 0)){
     
  9. Offline

    Chloe-chan

    Code:
    Block block = event.getClickedBlock().getRelative(0, 1, 0);
    int typeId = block.getTypeId();
    byte data = block.getData();
    if (typeId == 44 && data == 0)
    {
        // Do something here
    }
    NOTE: These methods are deprecated and may be removed in the future. Use with caution.
    EDIT: If there is anyone else with a better method to replace mine, please use theirs instead.
     
  10. Offline

    Badwolf330

    @Chloe-chan this won't work for 1.8 :( thanks for helping....
     
  11. @Badwolf330
    It will work, and for
    Please learn some more about java
     
  12. Offline

    Badwolf330

    @megamichiel thats not working for my, maby for you but not for me... and i know java but i don't know that
     
  13. Offline

    hammy2899

    Code:
                
    
    x = data value
    if((item.getType() == Material.STEP) && (item.getDurability() == x)) {
           // code        
    }
    
    
     
  14. @Badwolf330
    When using
    What part doesn't work?
     
  15. @Badwolf330 Material.getMaterial(44); print that for the Material.
     
Thread Status:
Not open for further replies.

Share This Page