BroadCast blockbreak's!

Discussion in 'Plugin Development' started by Marius A. Winsjansen, Sep 23, 2011.

Thread Status:
Not open for further replies.
  1. Greetings,

    I am currently working on my first plugin, adding so that if some1 breaks an diamond ore it will broadcast it and give the player messege about it!

    Here is my currently code, that doesnt work:


    Code:
    public void onBlockBreak(BlockBreakEvent event){
            Player p = event.getPlayer();
            String playername = p.getName();
            Server s = p.getServer();
            if(event.getBlock().getType() == Material.DIAMOND_ORE) {
            s.broadcastMessage(ChatColor.RED + playername + ChatColor.YELLOW + " has broken an" + ChatColor.RED + " DIAMOND_ORE");
            p.sendMessage(ChatColor.YELLOW + playername + ", you have just breaked an" + ChatColor.RED + " DIAMOND_ORE!" + ChatColor.YELLOW + " If you break to manny in a short matter of time, you might get listed as an user of the client mod: X-Ray!");
            }
        }
    if you whant to see the HOLE code for the plugin let me know, but there is many other things in the plugin that works, is just this part!:)

    Hope some1 can help me!
     
  2. Offline

    Pandemoneus

    Hurr durr, it doesn't work!
    What doesn't work? What error message do you get?
     
Thread Status:
Not open for further replies.

Share This Page