Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package fr.vitalys.bukkit;
- import org.bukkit.ChatColor;
- import org.bukkit.block.Block;
- import org.bukkit.entity.Player;
- import org.bukkit.event.EventHandler;
- import org.bukkit.event.Listener;
- import org.bukkit.event.block.BlockBreakEvent;
- public class EventClass implements Listener{
- public MainClass plugin;
- public EventClass(MainClass main){
- this.plugin = main;
- }
- @EventHandler
- public void onBreajBlock(BlockBreakEvent e){
- Player p = e.getplayer();
- Block b = e.getBlock();
- p.sendMessage(ChatColor.GOLD+">>Vous avez déruit un bloc de"+b.getType()+" en x: "+b.getX()+" | en y :"+b.getY()+" | en z :"+b.getY());
- if(p.isOp() == true){
- e.setCancelled(false);
- }else{
- e.setCancelled(true);
- p.sendMessage(ChatColor.RED+">> Seul les Admins peuvent le faire !");
- }
- }
- }
Add Comment
Please, Sign In to add comment