BlockBreak Event not called

Discussion in 'Plugin Development' started by Xenation, Sep 27, 2014.

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

    Xenation

    Hi.
    I'm working on a plugin that saves every broken blocks in an HashMap. I use the BlockBreakEvent to save the blocks. It works fine except when a glass block is broken by a bullet from the Flan's Gun Mod. So I tested many different events and none of them works.
    I'd like to know what Event the mod calls or if Bukkit detects it or not.
     
  2. Offline

    Jimfutsu

    Im guessing the mod uses setblock, which will not trigger the block break event, instead listener to blockchangeevent.
     
  3. Offline

    Xenation

    Ok thanks I'm going to try.

    Edit: I can't find any BlockChangeEvent ^^
     
  4. Offline

    Jimfutsu

    EntityChangeBlockEvent
     
  5. Offline

    Xenation

    Here's how it looks like :
    Code:java
    1. @EventHandler(priority = EventPriority.HIGH)
    2. public void onBlockChange (EntityChangeBlockEvent event) {
    3. for (Player p: Bukkit.getServer().getOnlinePlayers()) {
    4. p.sendMessage(ChatColor.RED + "Block Change");
    5. }
    6. }


    But it doesn't seems to work.
     
  6. Offline

    HeavyMine13

    Are you registering the events?
     
  7. Offline

    Xenation

    Yes my BlockListener class contains 3 Events(Including the EntityChangeBlockEvent) and in the main class I've got this:
    Code:java
    1. PluginManager pm = this.getServer().getPluginManager();
    2. pm.registerEvents(new BlockListener(this), this);


    It seems that it doesn't even call the EntityChangeBlockEvent so maybe this isn't the event I need?
    Someone has another idea?
     
Thread Status:
Not open for further replies.

Share This Page