Here's the code: Code: public void onBlockPlace(BlockPlaceEvent event){ Block p = event.getBlockPlaced() ; ChatColor GREEN = ChatColor.GREEN; ChatColor BLUE = ChatColor.BLUE; } I want to be able to put if a certain block is placed, then blah blah blah. So for instance: Code: public void onBlockPlace(BlockPlaceEvent event){ Block p = event.getBlockPlaced() ; ChatColor GREEN = ChatColor.GREEN; ChatColor BLUE = ChatColor.BLUE; if(this block is placed){ } } How would that be done? Also, once I have getBlockPlaced, how would I take that so that everytime someone places a block, it gets logged? EDIT by Moderator: merged posts, please use the edit button instead of double posting.
Code:java public void onBlockPlace(BlockPlaceEvent event){ Block p = event.getBlockPlaced();[/INDENT] ChatColor GREEN = ChatColor.GREEN;[/INDENT] ChatColor BLUE = ChatColor.BLUE;[/INDENT] if(p.getType == Material.(Whatever block you want)){ (How you want it to get logged)[/INDENT] } }
And make sure you register the event in onEnable with getPluginManager().registerEvent(Type.BLOCK_PLACE, new MyBlockListenerHere(), Priority.Normal, this);