Check if block placed has a name

Discussion in 'Plugin Development' started by RainoBoy97, Feb 2, 2013.

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

    RainoBoy97

    How do i check if a block thats placed has a name?
    Can't seem to figure it out :(

    -Raino
     
  2. Offline

    EnvisionRed

    Couldn't you get the BlockMeta of the block and use the BlockMeta's method for getting a name? I haven't used blockmeta and I'm not sure if BlockMeta has any such method, but it's worth a shot.
     
  3. Offline

    RainoBoy97

    Cant find any methods like that
     
  4. Offline

    chasechocolate

    No such thing as BlockMeta, you are probably thinking of ItemMeta :p.
    Code:java
    1. ItemMeta im = item.getItemMeta();
     
  5. Offline

    RainoBoy97

    getItemMeta isnt a method for a Block
     
  6. Offline

    ZeusAllMighty11

    When you give a block a meta, and place it, it's reset
     
  7. Offline

    RainoBoy97

    I know..
    How would i give a block MetaData "turtle"? and then check it onBlockPlace?
     
  8. Offline

    microgeek

    event.getPlayer.getItemInHand()?
     
  9. Offline

    RainoBoy97

    I know how to get the block :p

    Edit: dude, thats smart, ill try tomorrow
     
  10. Offline

    danthonywalker

    Just do event.getPlayer().getItemInHand().hasItemMeta() then. Pretty sure if it's in your inventory it's counted as an item, not a block.
     
  11. Offline

    RainoBoy97

    Thanks, worked :D
     
Thread Status:
Not open for further replies.

Share This Page