Created
February 11, 2017 00:44
-
-
Save kvizdos/dce51d1fea3cc28dd0324d9452bc7a3a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void onEnable() { | |
Bukkit.getServer().getPluginManager().registerEvents(this, this); | |
} | |
@EventHandler | |
public void onPlayerBreakBlockEvent(BlockBreakEvent e) { | |
Player p = e.getPlayer(); | |
p.sendMessage("You broke a " + ChatColor.GREEN + e.getBlock().getType()); | |
// TODO: THEN TEST!!!!!!!!!!!!!!!!!!! | |
if(e.getBlock().getType().equals(Material.STONE)) { | |
p.sendMessage("NO BREAKING STONE!"); | |
e.setCancelled(true); | |
} else { | |
p.sendMessage("You broke a " + ChatColor.GREEN + e.getBlock().getType()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment