Advertisement
Guest User

Untitled

a guest
Jun 17th, 2012
10,188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.77 KB | None | 0 0
  1. package me.Adamki11s.Example;
  2.  
  3. import org.bukkit.block.Block;
  4. import org.bukkit.entity.Player;
  5. import org.bukkit.event.Listener;
  6. import org.bukkit.event.EventHandler;
  7. import org.bukkit.event.block.BlockPlaceEvent;
  8.  
  9. /* Example Template
  10.  * By Adamki11s
  11.  * Plugin Tutorial
  12.  */
  13.  
  14. public class ExampleBlockListener implements Listener {
  15.  
  16.     public Example plugin;
  17.    
  18.     public ExampleBlockListener(Example instance) {
  19.         plugin = instance;
  20.     }
  21.  
  22.         @EventHandler
  23.     public void onBlockPlace(BlockPlaceEvent event){
  24.         Player player = event.getPlayer();
  25.         Block block = event.getBlock();
  26.         Material mat = block.getType();
  27.  
  28.         player.sendMessage("You placed a block with ID : " + mat);//Display a message to the player telling them what type of block they placed.
  29.  
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement