Posted September 20, 201411 yr Hey guys, how can I excecute some code when a player places a block? Is there a block place event? I haven't found anything likethis. Would be nice if you could help me!
September 20, 201411 yr Author Not yet, but there is a PullRequest[/code] pending. For now you can use PlayerInteractEvent. Ok thanks! Dankeschön
September 20, 201411 yr Author But how can I get the block that is placed? @EventHandler public void onPlayerInteract(PlayerInteractEvent e){ if(e.action == Action.RIGHT_CLICK_BLOCK){ if(e.isCancelable()) e.setCanceled(true); } }
September 20, 201411 yr Author Get the player's current item. Yes, but I want to replace the placed block with an other block. So I have to get the location of the block, right?
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.