BlockPlaceEvent?

Discussion in 'Plugin Development' started by bigbeno37, Jun 22, 2012.

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

    bigbeno37

    Hey there!

    I am new to coding with the Bukkit API, and I am trying to find out (Using the Bukkit Doxygen API site here: http://jd.bukkit.org/doxygen/annotated.html) how to register when a player places a block. If anyone could give any insight into this, I would be glad.

    Thanks,
    bigbeno37
     
  2. Offline

    Njol

  3. Offline

    Jeff.Halbert

    you can use the listener to check for block place events.....

    Code:
    public void onEnable() {
        //register your listener
        PluginManager pm = getServer().getPluginManager();
        pm.registerevents(this, this);
    }
     
    @EventHandler
    public void onBlockPlace(BlockPlaceEvent event) {
        //this listens to when ever a block is placed
        //code in what you want to do with it here...
    }
     
  4. Offline

    bigbeno37

    Ah that's it. I was looking for the 'BlockPlaceEvent' in the arguments. Thanks for replying!
     
  5. Offline

    Jeff.Halbert

Thread Status:
Not open for further replies.

Share This Page