Events

Discussion in 'Plugin Development' started by baugh70, Dec 8, 2013.

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

    baugh70

    Is there a way to get the name of a block that was put down, or get the name of the block after renaming a block?

    Any help would be appreciated. Thanks!
     
  2. Offline

    Wolfey

    BlockPlaceEvent, event.getBlock().getType();
     
  3. Offline

    baugh70

    Wolfey

    Not the type of block, but the name itself. Like the name I gave it when I used an anvil to change the name.
     
  4. Offline

    Garris0n

    Get the item in the player's hand on the BlockPlaceEvent.
     
  5. Offline

    Wolfey

    baugh70 The displayName of the item's meta is what you're looking for.
    Code:java
    1.  
    2. @EventHandler
    3. public void onPlace(BlockPlaceEvent e) {
    4. ItemStack item = new ItemStack(e.getBlock().getType());
    5. item.getItemMeta().getDisplayName();
    6. }
    7.  
     
  6. Offline

    baugh70

    Wolfey
    Thank you very much! :D
     
  7. Offline

    Wolfey

    Anytime!
     
Thread Status:
Not open for further replies.

Share This Page